Changeset 204 for trunk/ORBit2-2.14.0/src/idl-compiler
- Timestamp:
- Jan 20, 2007, 2:51:11 PM (19 years ago)
- Location:
- trunk/ORBit2-2.14.0/src/idl-compiler
- Files:
-
- 2 edited
-
orbit-idl-c-skelimpl.c (modified) (3 diffs)
-
orbit-idl-c-stubs.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ORBit2-2.14.0/src/idl-compiler/orbit-idl-c-skelimpl.c
r202 r204 123 123 orbit_cbe_ski_process_piece(&ski); 124 124 } 125 fprintf(outfile, "\n#endif /* NOM_CLASS_IMPLEMENTATION_FILE */\n"); 125 126 } 126 127 … … 1257 1258 /* Create the static class data structs */ 1258 1259 fprintf(ski->of, "/* %s, %s line %d */\n", __FILE__, __FUNCTION__, __LINE__); 1260 fprintf(ski->of, "#ifdef NOM_%s_IMPLEMENTATION_FILE\n\n", id); 1259 1261 fprintf(ski->of, "struct %sClassDataStructure %sClassData = {0};\n", id, id); 1260 1262 fprintf(ski->of, "static struct %sCClassDataStructure %sCClassData = {0};\n\n", id, id); … … 1412 1414 /* Get data macro */ 1413 1415 fprintf(ski->of, "\n/*\n * Get data macros for %s\n */\n", id); 1414 fprintf(ski->of, "#warning NOM kernel devs: these macros are preliminary\n\n");1415 1416 fprintf(ski->of, "typedef %sData* NOMLINK nomTP_%s_DataThunk(void*);\n", id, id); 1416 1417 fprintf(ski->of, "typedef nomTP_%s_DataThunk *nomTD_%s_DataThunk;\n", id, id); -
trunk/ORBit2-2.14.0/src/idl-compiler/orbit-idl-c-stubs.c
r117 r204 448 448 } 449 449 450 /* 451 This function returns the interface name from the given tree. It returns the first 452 name found. Works for what it's build for (getting the toplevel name for single class 453 IDL files). No idea what happens with files containing several interfaces... 454 */ 455 static void 456 VoyagerFindInterfaceName(IDL_tree tree, char** iface_id) 457 { 458 459 if (!tree) 460 return; 461 462 switch (IDL_NODE_TYPE (tree)) { 463 case IDLN_MODULE: 464 break; 465 case IDLN_LIST: { 466 IDL_tree sub; 467 for (sub = tree; sub; sub = IDL_LIST (sub).next){ 468 VoyagerFindInterfaceName((IDL_LIST (sub).data), iface_id); 469 } 470 break; 471 } 472 case IDLN_ATTR_DCL: { 473 break; 474 } 475 case IDLN_INTERFACE: { 476 VoyagerFindInterfaceName(IDL_INTERFACE (tree).body, iface_id); 477 break; 478 } 479 case IDLN_OP_DCL: 480 { 481 char *priviface_id = IDL_ns_ident_to_qstring ( 482 IDL_IDENT_TO_NS (IDL_INTERFACE ( 483 IDL_get_parent_node (tree, IDLN_INTERFACE, NULL) 484 ).ident), "_", 0); 485 //printf("----------> %s\n", priviface_id); 486 if(priviface_id) 487 *iface_id=priviface_id; /* This is a copy */ 488 break; 489 } 490 default: 491 break; 492 } 493 return; 494 } 495 450 496 void 451 497 orbit_idl_output_c_stubs (IDL_tree tree, … … 453 499 OIDL_C_Info *ci) 454 500 { 455 fprintf (ci->fh, OIDL_C_WARNING); 456 fprintf (ci->fh, "#include <string.h>\n"); 501 char *iface_id=NULL; 502 fprintf (ci->fh, OIDL_C_WARNING); 503 VoyagerFindInterfaceName(tree, &iface_id); /* get name of this interface/class */ 504 g_assert(iface_id); 505 fprintf (ci->fh, "#ifndef NOM_%s_IMPLEMENTATION_FILE\n", iface_id); 506 fprintf (ci->fh, "#define NOM_%s_IMPLEMENTATION_FILE\n#endif\n\n", iface_id); 507 508 fprintf (ci->fh, "#include <string.h>\n"); 457 509 #ifdef USE_LIBIDL_CODE 458 510 fprintf (ci->fh, "#define ORBIT2_STUBS_API\n"); … … 460 512 fprintf (ci->fh, "#include \"%s.ih\"\n\n", ci->base_name); 461 513 cs_output_stubs (tree, ci, NULL); 462 } 514 515 } 516 517 518 519 520 521
Note:
See TracChangeset
for help on using the changeset viewer.
