summaryrefslogtreecommitdiff
path: root/src/cobj.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cobj.h')
-rw-r--r--src/cobj.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cobj.h b/src/cobj.h
index 196649c..fd28746 100644
--- a/src/cobj.h
+++ b/src/cobj.h
@@ -38,6 +38,22 @@
# define DEL(klass, body, ...) \
void klass ## _del(klass self, ## __VA_ARGS__) \
body
+# define NCLASS(klass, data) \
+ typedef struct __##klass##_impl * klass; \
+ struct __##klass##_impl data
+
+# define LIST(klass, field, type, dim, ...) \
+ type _property_ ## field dim; \
+ type* (*get_ ## field)(klass, ## __VA_ARGS__); \
+ bool (*set_ ## field)(klass, ## __VA_ARGS__, type *)
+
+# define ATOM(klass, field, type, ...) \
+ type _property_ ## field; \
+ type (*get_ ## field)(klass, ## __VA_ARGS__);\
+ bool (*set_ ## field)(klass, ## __VA_ARGS__, type)
+
+# define DEFN(klass, name, type, ...) \
+ type (*name)(klass, ## __VA_ARGS__)
#else
# define CLASS(klass) \
typedef struct klass ## _impl_struct * klass