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/h-emitter_c/h_file_emitter.c

    r278 r280  
    8080  /* Include header of parent */
    8181  if(pifParent){
    82     char* chrTemp=strlwr(g_strdup(pifParent->chrName));
    8382    fprintf(fh, "/* Include for the parent class */\n");
    84     fprintf(fh, "#include \"%s.h\"\n\n", chrTemp);
    85     g_free(chrTemp);
     83    if(pifParent->chrFileStem)
     84      fprintf(fh, "#include \"%s.h\"\n\n", pifParent->chrFileStem);
    8685  }
    8786}
     
    110109      fprintf(fh, "    nomMToken %s;\n", pm->chrName);
    111110    }
    112   fprintf(fh, "}%sClassData\n\n", pif->chrName);
     111  fprintf(fh, "}%sClassData;\n\n", pif->chrName);
    113112
    114113  fprintf(fh, "NOMEXTERN struct %sCClassDataStructure {\n", pif->chrName);
     
    124123  FILE* fh=pLocalPI->outFile;
    125124
    126   fprintf(fh, "/* This function is used to check if a given object is valid and the\n");
    127   fprintf(fh, "   object supports the method */\n");
    128   fprintf(fh, "NOMEXTERN gboolean NOMLINK nomCheckObjectPtr(NOMObject *nomSelf, NOMClass* nomClass, gchar* chrMethodName, CORBA_Environment *ev);\n\n");
     125  if(strcmp(pif->chrName , "NOMObject"))
     126    {
     127      fprintf(fh, "/* This function is used to check if a given object is valid and the\n");
     128      fprintf(fh, "   object supports the method */\n");
     129      fprintf(fh, "NOMEXTERN gboolean NOMLINK nomCheckObjectPtr(NOMObject *nomSelf, NOMClass* nomClass, gchar* chrMethodName, CORBA_Environment *ev);\n\n");
     130    }
     131  else
     132    {
     133      fprintf(fh, "/* This function is used to check if the given object is valid and a NOMObject */\n");
     134      fprintf(fh, "NOMEXTERN gboolean NOMLINK nomCheckNOMObjectPtr(NOMObject *nomSelf, NOMClass* nomClass, gchar* chrMethodName, CORBA_Environment *ev);\n\n");
     135    }
    129136}
    130137
     
    157164      emitMethodParams(pLocalPI, pif, pm->pParamArray);
    158165
    159       fprintf(fh, "    Corba_Environment *ev);\n");
    160       fprintf(fh, "typedef nomTP_%s_%s *nomTD_%s_%s\n", pif->chrName,  pm->chrName,
     166      fprintf(fh, "    CORBA_Environment *ev);\n");
     167      fprintf(fh, "typedef nomTP_%s_%s *nomTD_%s_%s;\n", pif->chrName,  pm->chrName,
    161168              pif->chrName,  pm->chrName);
    162169      fprintf(fh, "/* define the name for this method */\n");
     
    173180      /* Do parameters */
    174181      emitMethodParams(pLocalPI, pif, pm->pParamArray);
    175       fprintf(fh, "    Corba_Environment *ev);\n");
     182      fprintf(fh, "    CORBA_Environment *ev);\n");
    176183
    177184      fprintf(fh, "#define %s_%s(nomSelf,", pif->chrName, pm->chrName);
     
    193200      emitMethodParamsNoTypes(pLocalPI, pif, pm->pParamArray);
    194201      fprintf(fh, " ev) \\\n");
    195       fprintf(fh, "        (nomCheckObjectPtr((NOMObject*)nomSelf, %sClassData.classObject,",pif->chrName);
     202      if(strcmp(pif->chrName , "NOMObject"))
     203        fprintf(fh, "        (nomCheckObjectPtr((NOMObject*)nomSelf, %sClassData.classObject,",pif->chrName);
     204      else
     205        fprintf(fh, "        (nomCheckNOMObjectPtr(nomSelf, %sClassData.classObject,",pif->chrName);
    196206      fprintf(fh, "\"%s_%s\", ev) ? \\\n", pif->chrName, pm->chrName);
    197207
     
    200210      /* Do parameters */
    201211      emitMethodParamsNoTypes(pLocalPI, pif, pm->pParamArray);
    202       fprintf(fh, " ev)) : (gpointer) NULL)\n");
     212      fprintf(fh, " ev)) : (%s", pm->mpReturn.chrType);
     213      for(b=0;b<pm->mpReturn.uiStar;b++)
     214        fprintf(fh, "*");
     215      fprintf(fh, ") NULL)\n");
    203216      fprintf(fh, "#endif\n");
    204217      fprintf(fh, "#else /* NOM_NO_PARAM_CHECK */\n");
     
    285298          chrTemp=g_strconcat(pif->chrFileStem, ".h", NULL);
    286299
    287           printInterface(pif);
     300          //printInterface(pif);
    288301          if((pLocalPI->outFile=openOutfile(gScanner, chrTemp))!=NULLHANDLE)
    289302            {
Note: See TracChangeset for help on using the changeset viewer.