Changeset 289 for trunk/idl-compiler
- Timestamp:
- Apr 1, 2007, 2:03:04 PM (18 years ago)
- Location:
- trunk/idl-compiler
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/idl-compiler/c/nom-idl-compiler.c
r280 r289 624 624 625 625 g_scanner_destroy(gScanner); 626 close(fd); 627 fclose(parseInfo.outFile); 626 if(0!=fd) 627 close(fd); /* We read from stdin */ 628 if(parseInfo.outFile) 629 fclose(parseInfo.outFile); 628 630 return 0; 629 631 } -
trunk/idl-compiler/h-emitter_c/h_file_emitter.c
r287 r289 328 328 { 329 329 PINTERFACE pif=g_ptr_array_index(pLocalPI->pInterfaceArray, a); 330 330 331 /* Only interfaces from the file given on the command line */ 331 332 if(!strcmp(pif->chrSourceFileName, pLocalPI->chrRootSourceFile)) 332 333 { 333 gchar* chrTemp; 334 335 chrTemp=g_strconcat(pif->chrFileStem, ".h", NULL); 336 337 //printInterface(pif); 338 if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULLHANDLE) 334 /* Only interfaces which are fully defined. No forwarder */ 335 if(!pif->fIsForwardDeclaration) 339 336 { 340 emitHFileHeader(pLocalPI, pif); 341 emitInterfaceIncludes(pLocalPI, pif); 342 emitClassVersion(pLocalPI, pif); 343 emitClassDataStructs(pLocalPI, pif); 344 emitNewMacro(pLocalPI, pif); 345 emitObjectCheckFunction(pLocalPI, pif); 346 emitNewMethods(pLocalPI, pif); 347 emitParentClassMethods(pLocalPI, pif); 348 emitHFileFooter(pLocalPI, pif); 349 closeOutfile(pLocalPI->outFile); 350 } 351 g_free(chrTemp); 352 } 353 } 354 } 355 356 337 gchar* chrTemp; 338 339 chrTemp=g_strconcat(pif->chrFileStem, ".h", NULL); 340 341 //printInterface(pif); 342 if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULLHANDLE) 343 { 344 emitHFileHeader(pLocalPI, pif); 345 emitInterfaceIncludes(pLocalPI, pif); 346 emitClassVersion(pLocalPI, pif); 347 emitClassDataStructs(pLocalPI, pif); 348 emitNewMacro(pLocalPI, pif); 349 emitObjectCheckFunction(pLocalPI, pif); 350 emitNewMethods(pLocalPI, pif); 351 emitParentClassMethods(pLocalPI, pif); 352 emitHFileFooter(pLocalPI, pif); 353 closeOutfile(pLocalPI->outFile); 354 } 355 g_free(chrTemp); 356 }/* fIsForwardDeclaration */ 357 } 358 } 359 } 360 361 -
trunk/idl-compiler/parser_c/interface_parser.c
r287 r289 46 46 { 47 47 PSYMBOL pNewSymbol=g_malloc0(sizeof(SYMBOL)); 48 49 // g_message("In %s for %s", __FUNCTION__, pParseInfo->pCurInterface->chrName); 48 50 49 51 pParseInfo->pCurInterface->pSymbolIFace=pNewSymbol; … … 79 81 static void deRegisterInterface(PINTERFACE pif) 80 82 { 83 // g_message("In %s", __FUNCTION__); 84 81 85 /* Remove the interface from our list */ 82 86 g_ptr_array_remove(pParseInfo->pInterfaceArray, (gpointer) pif); … … 363 367 g_free(pParseInfo->pCurInterface); 364 368 } 365 pParseInfo->pCurInterface->chrSourceFileName=g_strdup(pParseInfo->chrCurrentSourceFile); 366 pParseInfo->pCurInterface->fIsForwardDeclaration=TRUE; 367 /* It's save to register the interface right here even if the struct is almost empty. 368 If anything goes wrong later we will exit anyway. */ 369 registerInterface(); 369 else{ 370 pParseInfo->pCurInterface->chrSourceFileName=g_strdup(pParseInfo->chrCurrentSourceFile); 371 pParseInfo->pCurInterface->fIsForwardDeclaration=TRUE; 372 /* It's save to register the interface right here even if the struct is almost empty. 373 If anything goes wrong later we will exit anyway. */ 374 registerInterface(); 375 } 370 376 } 371 377 else … … 396 402 } 397 403 pParseInfo->pCurInterface->chrSourceFileName=g_strdup(pParseInfo->chrCurrentSourceFile); 398 pParseInfo->pCurInterface->fIsForwardDeclaration=TRUE;399 404 /* It's save to register the interface right here even if the struct is almost empty. 400 405 If anything goes wrong later we will exit anyway. */ 401 406 registerInterface(); 402 407 if(matchNext(':')) 403 { 404 408 { 405 409 parseSubclassedIFace(); 406 410 }
Note:
See TracChangeset
for help on using the changeset viewer.