27 lines
418 B
C
27 lines
418 B
C
#include <stddef.h>
|
|
|
|
struct Object
|
|
{
|
|
struct Class* class;
|
|
};
|
|
|
|
struct Class
|
|
{
|
|
struct Class* class;
|
|
|
|
const char* name;
|
|
struct Class* super;
|
|
struct Method* methods;
|
|
size_t methods_count;
|
|
};
|
|
|
|
typedef struct Object* (*MethodImplementation)(struct Object* self);
|
|
|
|
struct Method
|
|
{
|
|
const char* sel;
|
|
MethodImplementation impl;
|
|
};
|
|
|
|
struct Object* msg_send(struct Object* self, const char* sel);
|
|
|