Ignore:
Timestamp:
Mar 30, 2007, 10:31:24 PM (18 years ago)
Author:
cinc
Message:

A load of fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/idl-compiler/c/emitter.c

    r278 r280  
    5454    {
    5555      int b;
     56      gchar *chrType;
    5657      PMETHODPARAM pm=(PMETHODPARAM)g_ptr_array_index(pArray, a);
     58
     59      chrType= pm->chrType;
     60
     61      /* For old IDL files using orbit IDL compiler */
     62      if(!strcmp(pm->chrType, "string"))
     63        chrType="CORBA_char*";
     64      if(!strcmp(pm->chrType, "long"))
     65        chrType="CORBA_long";
    5766
    5867      switch(pm->uiDirection)
    5968        {
    6069        case PARM_DIRECTION_IN:
    61           fprintf(fh, "    const %s", pm->chrType);
     70          fprintf(fh, "    const %s", chrType);
    6271          break;
    6372        case PARM_DIRECTION_OUT:
    64           fprintf(fh, "    %s*", pm->chrType);
     73          fprintf(fh, "    %s*", chrType);
    6574          break;
    6675        case PARM_DIRECTION_INOUT:
    67 
     76          fprintf(fh, "    %s*", chrType);
    6877          break;
    6978        default:
    70           fprintf(fh, "    %s*", pm->chrType);
     79
    7180          break;
    7281        }
     
    91100    }
    92101}
     102
     103/**
     104   This function emits the return type of a method. It translates CORBA identifiers
     105   into another representation e.g. long->glong. At the moment it's used to be compatible
     106   with old source written using the orbit IDL compiler.
     107 */
     108void emitReturnType(PPARSEINFO pLocalPI, PINTERFACE pif, PMETHOD pm)
     109{
     110  FILE* fh=pLocalPI->outFile;
     111  int b;
     112  gchar* chrType;
     113
     114  chrType= pm->mpReturn.chrType;
     115
     116  /* Support for orbit IDL files */
     117  if(!strcmp(pm->mpReturn.chrType, "long"))
     118    chrType="CORBA_long";
     119  else if(!strcmp(pm->mpReturn.chrType, "boolean"))
     120    chrType="CORBA_boolean";
     121
     122  fprintf(fh, "%s", chrType);
     123  for(b=0;b<pm->mpReturn.uiStar;b++)
     124    fprintf(fh, "*");
     125}
Note: See TracChangeset for help on using the changeset viewer.