/* BCU SDK bcu development enviroment Copyright (C) 2005-2007 Martin Koegler 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; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #undef OBJECT #define OBJECT(A) static void Write##A(FILE* f,const A&d) { int i; fprintf(f,"%s {\n",#A); #undef CI_OBJECT #define CI_OBJECT(A) #undef END_OBJECT #define END_OBJECT fprintf(f,"};\n"); } #undef ATTRIB_IDENT #define ATTRIB_IDENT(A) if(d.A##_lineno) fprintf(f,"%s %s;\n",#A,d.A()); #undef ATTRIB_FLOAT #define ATTRIB_FLOAT(A) if(d.A##_lineno) fprintf(f,"%s %f;\n",#A,d.A); #undef ATTRIB_INT #define ATTRIB_INT(A) if(d.A##_lineno) fprintf(f,"%s %d;\n",#A,d.A); #undef ATTRIB_BOOL #define ATTRIB_BOOL(A) if(d.A##_lineno) fprintf(f,"%s %s;\n",#A,d.A?"true":"false"); #undef ATTRIB_INT_MAP #define ATTRIB_INT_MAP(A,B) if(d.A##_lineno) fprintf(f,"%s %d;\n",#A,d.A); #undef ATTRIB_FLOAT_MAP #define ATTRIB_FLOAT_MAP(A,B) if(d.A##_lineno) fprintf(f,"%s %f;\n",#A,d.A); #undef ATTRIB_KEY_MAP #define ATTRIB_KEY_MAP(A) if(d.A##_lineno){fprintf(f,"%s {",#A);for(i=0;i