/***{{{******************************************************************* * This file is part of libco - object library for C * * Copyright (c) 2002 Peter Rockai (yenar) * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public * * License as published by the Free Software Foundation; either * * version 2 of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; see the file COPYING. If not, write to * * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * * Boston, MA 02111-1307, USA. * *******************************************************************}}}***/ /* {{{ file description */ /** * @file clone.c * @brief Test for clone functionality of libco objects. **/ /* }}} */ /* {{{ includes */ #include "co_o_default.h" #include "test_util.h" #include "co_conv.h" /* }}} */ /* {{{ */ CO_OBJECT (person, default) { CO_ATTR (int, id); }; /* }}} */ #include "clone.cometa" /* {{{ */ CO_METH (person, init) { person td; td = new (person_s); this -> data = td; cox_pop (td); } /* }}} */ /* {{{ */ 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_DEBUG (1, "called"); CO_RETURN (int, 0); } /* }}} */ /* {{{ */ int main (void) { co tst1, tst2; int i; co super; super = co_init (); __co_file_init_clone_c (super); tst1 = person_new (); tst2 = M (tst1, clone) . _co; CO_M (super, exit, 0); return 0; } /* }}} */