| verzia 1.1, 2003/03/15 15:23:14 |
verzia 1.2, 2003/03/30 10:27:38 |
|
|
| *******************************************************************}}}***/ |
*******************************************************************}}}***/ |
| /* {{{ file description */ |
/* {{{ file description */ |
| /** |
/** |
| * @file vector.c |
* @file python.c |
| * @brief Test libco's vector object. |
* @brief Interactive python bindings test. |
| **/ |
**/ |
| /* }}} */ |
/* }}} */ |
| |
|
|
|
| #include <limits.h> |
#include <limits.h> |
| /* }}} */ |
/* }}} */ |
| |
|
| CO_OBJECT (co_test) |
CO_OBJECT (co_test, default) |
| { |
{ |
| CO_HEAD_FULL; |
|
| int id; |
int id; |
| }; |
}; |
| |
|
| Riadok 47 CO_METH (co_test, hello) |
|
| Riadok 46 CO_METH (co_test, hello) |
|
| } |
} |
| /* }}} */ |
/* }}} */ |
| /* {{{ */ |
/* {{{ */ |
| CO_METH (co_test, setid) |
CO_METH (co_test, setid, int id) |
| { |
{ |
| CO_METH_INI (co_test, setid, int id); |
CO_METH_INI (co_test, setid); |
| this -> id = id; |
td -> id = id; |
| CO_RETURN (int, 0); |
CO_RETURN (int, 0); |
| } |
} |
| /* }}} */ |
/* }}} */ |
| Riadok 58 CO_METH (co_test, setid) |
|
| Riadok 57 CO_METH (co_test, setid) |
|
| CO_METH (co_test, printid) |
CO_METH (co_test, printid) |
| { |
{ |
| CO_METH_INI (co_test, printid); |
CO_METH_INI (co_test, printid); |
| printf ("%d\n", this -> id); |
printf ("%d\n", td -> id); |
| CO_RETURN (int, 0); |
CO_RETURN (int, 0); |
| } |
} |
| /* }}} */ |
/* }}} */ |
| |
|
| /* {{{ */ |
/* {{{ */ |
| static co testo_new (void) |
CO_METH (co_test, init) |
| { |
{ |
| co o; |
co_test td; |
| o = new (co_test_s); |
td = new (co_test_s); |
| cox_pop (o); |
this -> data = td; |
| CO_BLESS (o, co_test, 0); |
CO_RETURN (int, 0); |
| return o; |
|
| } |
} |
| /* }}} */ |
/* }}} */ |
| |
|
| Riadok 81 static co testo_new (void) |
|
| Riadok 78 static co testo_new (void) |
|
| co_vector_item item; |
co_vector_item item; |
| |
|
| co super; |
co super; |
| super = co_super_new (); |
super = co_init (); |
| __co_file_init_python_c (super); |
__co_file_init_python_c (super); |
| |
|
| PyRun_SimpleString ("import co_test\n"); |
PyRun_SimpleString ("import co_test\n"); |