I think the time has come to begin leaving GitHub behind. I'm more active on Codeberg, but I still check GitHub notifications.
My personal website has more on my projects and interests, and also points to some further places where you'll find me.
SCOOP: Simple C library for Object-Oriented Programming (2013 proof-of-concept library)
I think the time has come to begin leaving GitHub behind. I'm more active on Codeberg, but I still check GitHub notifications.
My personal website has more on my projects and interests, and also points to some further places where you'll find me.
Here is what I have done:
#ifndef MY_CLASS_H
#define MY_CLASS_H
#include <scoop/BEGIN.h>
#include <scoop/Object.h>
#define MyClass_ \
int x; \
int y; \
int z;
#define MyClass__ \
void (*mul)(SCO_TYPE* o,int m);
SCOclass(MyClass);
SCOclassctor(MyClass,sco_MyClass,(SCO_TYPE*o,int sx,int sy,int sz));
#define sco_MyClass_mul(o) \
(o)->classdesc->vtab.mul(o,m)
void sco_MyClass_mul_(SCO_TYPE *o,int m);
#include <scoop/END.h>
#endif
And the C File:
#define SCO_MODULE MyClass
#include "MyClass.h"
#include <stdio.h>
void sco_MyClass_mul_(SCO_TYPE *o,int m) {
printf(" %d * %d * %d = %d", o->x,o->y,o->z, (o->x * o->y * o->z * m) );
}
static void MyClass_vtinit(MyClass_CD *o)
{
MyClass_VT *vt = &o->vtab;
vt->mul = sco_MyClass_mul_;
}
SCO_CLASSDEF(MyClass, scoNull, 0, MyClass_vtinit);
SCO_CLASSCTOR(MyClass, sco_MyClass, (MyClass *o,int sx,int sy,int sz), (o,sx,sy,sz), o)
{
o->x = sx;
o->y = sy;
o->z = sz;
return 1;
}
My Question is: How can I easily call mul? Do I have to call it direct with sco_MyClass_mul(mc,30) ?
Also, it was working a minute ago, and now I get: Object-test.c:(.text.startup+0x53): undefined reference to
sco_MyClass_new'`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.