#include "../libco/co_object.h" #include "../libco/co_super.h" #include "../libco/co_util.h" /* {{{ */ CO_OBJECT (person) { CO_HEAD_FULL; CO_ATTR (int, id); }; /* }}} */ #include "co_module_testing.cometa" /* {{{ */ static co person_new (void) { co_o_head_full o; o = (co_o_head_full) new (person_s); person_meth_ar_init (o); CO_BLESS (o, person, 0); return o; } /* }}} */ /* {{{ */ CO_METH (person, getid) { int i; CO_METH_INI (person, getid); i = CO_A (int, self, id); CO_DEBUG (1, "returning %d", i); CO_RETURN (int, i); } /* }}} */ /* {{{ */ CO_METH (person, default) { CO_METH_INI (person, default); CO_RETURN (int, 0); } /* }}} */ co __co_mod_init (co_super super); /* {{{ */ co __co_mod_init (co_super super) { person ret; __co_file_init_co_module_testing_c (super); CO_DEBUG (2, "will create person..."); CO_DEBUG (2, "id of clone is %d", COM (clone)); ret = person_new (); ret -> id = 0xF0A42; // test value cox_pop (ret); return ret; } /* }}} */