Changeset 379 for trunk/idl-compiler
- Timestamp:
- Jul 1, 2008, 6:23:14 PM (17 years ago)
- Location:
- trunk/idl-compiler
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/idl-compiler/c/emitter.c
r326 r379 93 93 } 94 94 95 96 /* 97 \param pArray Pointer to the list of parameters. 98 */ 99 void emitMethodParamsForNOMCompiler(PPARSEINFO pLocalPI, PINTERFACE pif, GPtrArray *pArray) 100 { 101 FILE* fh=pLocalPI->outFile; 102 int a; 103 104 for(a=0;a<pArray->len;a++) 105 { 106 int b; 107 gchar *chrType; 108 PMETHODPARAM pm=(PMETHODPARAM)g_ptr_array_index(pArray, a); 109 110 chrType= pm->chrType; 111 112 #if 0 113 /* For old IDL files using orbit IDL compiler */ 114 if(!strcmp(pm->chrType, "string")) 115 chrType="CORBA_char*"; 116 else if(!strcmp(pm->chrType, "long")) 117 chrType="CORBA_long"; 118 else if(!strcmp(pm->chrType, "unsigned long")) 119 chrType="CORBA_unsigned_long"; 120 else if(!strcmp(pm->chrType, "boolean")) 121 chrType="CORBA_boolean"; 122 #endif 123 124 switch(pm->uiDirection) 125 { 126 case PARM_DIRECTION_IN: 127 fprintf(fh, " in %s", chrType); 128 break; 129 case PARM_DIRECTION_OUT: 130 fprintf(fh, " out %s", chrType); 131 break; 132 case PARM_DIRECTION_INOUT: 133 fprintf(fh, " inout %s", chrType); 134 break; 135 default: 136 137 break; 138 } 139 for(b=0;b<pm->uiStar;b++) 140 fprintf(fh, "*"); 141 fprintf(fh, " %s", pm->chrName); 142 if(a<pArray->len-1) 143 fprintf(fh, ","); 144 145 } 146 } 147 148 95 149 /* 96 150 \param pArray Pointer to the list of parameters. … … 133 187 fprintf(fh, "*"); 134 188 } 189 190 191 void emitReturnTypeForNOMCompiler(PPARSEINFO pLocalPI, PINTERFACE pif, PMETHOD pm) 192 { 193 FILE* fh=pLocalPI->outFile; 194 int b; 195 gchar* chrType; 196 197 chrType= pm->mpReturn.chrType; 198 199 #if 0 200 /* Support for orbit IDL files */ 201 if(!strcmp(pm->mpReturn.chrType, "long")) 202 chrType="CORBA_long"; 203 else if(!strcmp(pm->mpReturn.chrType, "boolean")) 204 chrType="CORBA_boolean"; 205 else if(!strcmp(pm->mpReturn.chrType, "unsigned long")) 206 chrType="CORBA_unsigned_long"; 207 #endif 208 209 if(!strcmp(pm->mpReturn.chrType, "boolean")) 210 chrType="gboolean"; 211 212 fprintf(fh, "%s", chrType); 213 for(b=0;b<pm->mpReturn.uiStar;b++) 214 fprintf(fh, "*"); 215 } -
trunk/idl-compiler/h-emitter_c/h_file_emitter.c
r376 r379 57 57 fprintf(fh, "#ifndef %s_H\n#define %s_H\n\n", pif->chrName, pif->chrName); 58 58 59 fprintf(fh, "#ifndef NOMCOMPILER\n"); 60 59 61 fprintf(fh, "#include <glib.h>\n"); 60 62 fprintf(fh, "#include <nomcls.h> /* This is needed for _nomNew() */\n\n"); … … 63 65 fprintf(fh, "extern \"C\" {\n"); 64 66 fprintf(fh, "#endif /* __cplusplus */\n\n"); 65 66 fprintf(fh, "#ifndef NOMCOMPILER\n");67 67 68 68 /* Define the name as an object */ … … 352 352 { 353 353 FILE* fh=pLocalPI->outFile; 354 GPtrArray *pArray;355 354 int a; 355 356 fprintf(fh, "#else /* NOMCOMPILER */\n"); 357 358 emitInterfaceIncludes(pLocalPI, pif); 359 360 /* Output all interfaces */ 361 for(a=0; a<pLocalPI->pInterfaceArray->len; a++) 362 { 363 PINTERFACE pifAll=g_ptr_array_index(pLocalPI->pInterfaceArray, a); 364 int b; 365 366 if(pifAll->fIsForwardDeclaration) 367 { 368 fprintf(fh, "interface %s;\n", pifAll->chrName); 369 } 370 else 371 { 372 GPtrArray *pArray; 373 374 pArray=pifAll->pMethodArray; 375 376 fprintf(fh, "#ifndef %s_INTERFACE\n", pifAll->chrName); 377 fprintf(fh, "#define %s_INTERFACE\n", pifAll->chrName); 378 379 fprintf(fh, "interface %s", pifAll->chrName); 380 381 if(pifAll->chrParent) 382 { 383 fprintf(fh, " : %s", pif->chrParent); 384 } 385 386 fprintf(fh, "\n{\n"); 387 388 /* Print known methods */ 389 for(b=0; b<pArray->len; b++) 390 { 391 PMETHOD pm=(PMETHOD)g_ptr_array_index(pArray, b); 392 393 fprintf(fh, " "); 394 395 emitReturnTypeForNOMCompiler(pLocalPI, pifAll, pm); 396 397 fprintf(fh, " %s(", pm->chrName); /* Methodname */ 398 emitMethodParamsForNOMCompiler(pLocalPI, pifAll, pm->pParamArray); 399 fprintf(fh, ");\n"); 400 } /* for */ 401 fprintf(fh, "}\n"); 402 fprintf(fh, "#endif /* %s_INTERFACE */\n", pifAll->chrName); 403 } 404 405 } 356 406 357 pArray=pif->pMethodArray;358 359 fprintf(fh, "#else /* NOMCOMPILER */\n");360 361 emitInterfaceIncludes(pLocalPI, pif);362 363 fprintf(fh, "interface %s", pif->chrName);364 if(pif->chrParent)365 {366 fprintf(fh, " : %s", pif->chrParent);367 }368 fprintf(fh, "\n{\n");369 370 /* Print known methods */371 for(a=0;a<pArray->len;a++)372 {373 int b;374 PMETHOD pm=(PMETHOD)g_ptr_array_index(pArray, a);375 376 fprintf(fh, " %s(", pm->chrName); /* Methodname */377 emitMethodParams(pLocalPI, pif, pm->pParamArray);378 fprintf(fh, ");\n");379 }380 fprintf(fh, "}\n");381 407 fprintf(fh, "\n#endif /* NOMCOMPILER */\n\n"); 382 408 } … … 390 416 fprintf(fh, "#endif /* __cplusplus */\n\n"); 391 417 418 emitNomCompilerInfo(pLocalPI, pif); 419 392 420 fprintf(fh, "\n#endif /* %s_H */\n", pif->chrName); 393 421 } … … 423 451 emitNewMethods(pLocalPI, pif); 424 452 emitParentClassMethods(pLocalPI, pif); 425 emitNomCompilerInfo(pLocalPI, pif);426 453 emitHFileFooter(pLocalPI, pif); 427 454 closeOutfile(pLocalPI->outFile); -
trunk/idl-compiler/include/parser.h
r311 r379 193 193 void emitMethodParamsNoTypes(PPARSEINFO pLocalPI, PINTERFACE pif, GPtrArray *pArray); 194 194 void emitReturnType(PPARSEINFO pLocalPI, PINTERFACE pif, PMETHOD pm); 195 void emitMethodParamsForNOMCompiler(PPARSEINFO pLocalPI, PINTERFACE pif, GPtrArray *pArray); 196 void emitReturnTypeForNOMCompiler(PPARSEINFO pLocalPI, PINTERFACE pif, PMETHOD pm); 195 197 196 198 /* In printdata.c */
Note:
See TracChangeset
for help on using the changeset viewer.