Changeset 274 for trunk/idl-compiler
- Timestamp:
- Mar 26, 2007, 9:40:01 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/idl-compiler/h-emitter_c/h_file_emitter.c
r273 r274 109 109 } 110 110 111 static void emitClassDataStruct (PPARSEINFO pLocalPI, PINTERFACE pif)111 static void emitClassDataStructs(PPARSEINFO pLocalPI, PINTERFACE pif) 112 112 { 113 113 int a; … … 125 125 } 126 126 fprintf(fh, "}%sClassData\n\n", pif->chrName); 127 128 fprintf(fh, "NOMEXTERN struct %sCClassDataStructure {\n", pif->chrName); 129 fprintf(fh, " nomMethodTabs parentMtab;\n"); 130 fprintf(fh, " nomDToken instanceDataToken;\n"); 131 fprintf(fh, "} NOMDLINK %sCClassData;\n\n", pif->chrName); 132 127 133 } 128 134 … … 274 280 }; 275 281 282 static void emitNewMacro(PPARSEINFO pLocalPI, PINTERFACE pif) 283 { 284 FILE* fh=pLocalPI->outFile; 285 286 fprintf(fh, "/*\n * Class creation function\n */\n"); 287 fprintf(fh, "NOMEXTERN NOMClass * NOMLINK %sNewClass(gulong clsMajorVersion, gulong clsMinorVersion);\n\n", 288 pif->chrName); 289 290 fprintf(fh, "#define _%s (%s*)%sClassData.classObject\n\n", 291 pif->chrName, pif->chrMetaClass, pif->chrName); 292 293 fprintf(fh, "/*\n * New macro for WPObject\n */\n\n"); 294 fprintf(fh, "#define %sNew() \\\n", pif->chrName); 295 fprintf(fh, " ((%s*)_nomNew((_%s ? _%s : ", pif->chrName, pif->chrName, pif->chrName); 296 fprintf(fh, "(%s*)%sNewClass(%s_MajorVersion, %s_MinorVersion)), (void*) 0))\n\n", 297 pif->chrName, pif->chrName, pif->chrName, pif->chrName); 298 299 } 300 301 static void emitParentClassMethods(PPARSEINFO pLocalPI, PINTERFACE pif) 302 { 303 FILE* fh=pLocalPI->outFile; 304 PINTERFACE pifParent=pif; 305 306 while((pifParent=getParentInterface(pifParent))!=NULLHANDLE) 307 { 308 GPtrArray *pArray; 309 int a; 310 /* Do this parents methods */ 311 pArray=pifParent->pMethodArray; 312 for(a=0;a<pArray->len;a++) 313 { 314 PMETHOD pm=(PMETHOD)g_ptr_array_index(pArray, a); 315 316 fprintf(fh, "#define %s_%s \\\n", pif->chrName, pm->chrName); 317 fprintf(fh, " %s_%s \n", pifParent->chrName, pm->chrName); 318 } 319 } 320 fprintf(fh, "\n"); 321 } 322 276 323 static void emitHFileFooter(PPARSEINFO pLocalPI, PINTERFACE pif) 277 324 { … … 300 347 emitParentHeader(pLocalPI, pif); 301 348 emitClassVersion(pLocalPI, pif); 302 emitClassDataStruct(pLocalPI, pif); 349 emitClassDataStructs(pLocalPI, pif); 350 emitNewMacro(pLocalPI, pif); 303 351 emitObjectCheckFunction(pLocalPI, pif); 304 352 emitNewMethods(pLocalPI, pif); 353 emitParentClassMethods(pLocalPI, pif); 305 354 emitHFileFooter(pLocalPI, pif); 306 355 }
Note:
See TracChangeset
for help on using the changeset viewer.