blitz_object.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef BLITZ_OBJECT_H
  2. #define BLITZ_OBJECT_H
  3. #include "blitz_types.h"
  4. #ifdef __cplusplus
  5. extern "C"{
  6. #endif
  7. #define BBNULL (&bbNullObject)
  8. #define BBNULLOBJECT (&bbNullObject)
  9. struct BBClass{
  10. //extends BBGCPool
  11. BBClass* super;
  12. void (*free)( BBObject *o );
  13. BBDebugScope*debug_scope;
  14. int instance_size;
  15. void (*ctor)( BBObject *o );
  16. void (*dtor)( BBObject *o );
  17. BBString* (*ToString)( BBObject *x );
  18. int (*Compare)( BBObject *x,BBObject *y );
  19. BBObject* (*SendMessage)( BBObject *m,BBObject *s );
  20. void (*_reserved1_)();
  21. void (*_reserved2_)();
  22. void (*_reserved3_)();
  23. void* vfns[32];
  24. };
  25. struct BBObject{
  26. //extends BBGCMem
  27. BBClass* clas;
  28. int refs;
  29. };
  30. extern BBClass bbObjectClass;
  31. extern BBObject bbNullObject;
  32. BBObject* bbObjectNew( BBClass *t );
  33. void bbObjectFree( BBObject *o );
  34. void bbObjectCtor( BBObject *o );
  35. void bbObjectDtor( BBObject *o );
  36. BBString* bbObjectToString( BBObject *o );
  37. int bbObjectCompare( BBObject *x,BBObject *y );
  38. BBObject* bbObjectSendMessage( BBObject *m,BBObject *s );
  39. void bbObjectReserved();
  40. BBObject* bbObjectDowncast( BBObject *o,BBClass *t );
  41. void bbObjectRegisterType( BBClass *clas );
  42. BBClass** bbObjectRegisteredTypes( int *count );
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif