Diff for libco/test/co_module_testing.c between version 1.1 and 1.2
| version 1.1, 2003/02/15 15:23:54 |
version 1.2, 2003/02/21 09:00:37 |
|
|
| void __co_mod_init_libco_module_testing (void) |
#include "../libco/co_object.h" |
| |
#include "../libco/co_super.h" |
| |
#include "../libco/co_util.h" |
| |
|
| |
/* {{{ */ |
| |
CO_OBJECT (person) |
| { |
{ |
| printf ("module 'libco_module_testing' initialized!\n"); |
CO_HEAD_FULL; |
| |
CO_ATTR (int, id); |
| |
}; |
| |
/* }}} */ |
| |
|
| |
#include "co_module_testing.cometa" |
| |
|
| |
/* {{{ */ static co person_new (void) |
| |
{ |
| |
co_o_head_full o; |
| |
o = new (person_s); |
| |
person_meth_ar_init (o); |
| |
CO_BLESS (o, person, 0); |
| |
return o; |
| |
} /* }}} */ |
| |
|
| |
/* {{{ */ |
| |
CO_METH (person, getid) |
| |
{ |
| |
CO_METH_INI (person, getid); |
| |
CO_RETURN (int, CO_A (int, self, id)); |
| |
} |
| |
/* }}} */ |
| |
/* {{{ */ |
| |
CO_METH (person, default) |
| |
{ |
| |
CO_METH_INI (person, default); |
| |
CO_RETURN (int, 0); |
| |
} |
| |
/* }}} */ |
| |
|
| |
/* {{{ */ |
| |
co __co_mod_init (co_super super) |
| |
{ |
| |
person ret; |
| |
__co_mod_init_co_module_testing_c (super); |
| |
ret = person_new (); |
| |
ret -> id = 0xF0A42; // test value |
| |
cox_pop (ret); |
| |
return ret; |
| } |
} |
| |
/* }}} */ |
Platon Group <platon@platon.org> http://platon.org/
|
|