Ignore:
Timestamp:
Apr 1, 2007, 12:52:34 PM (18 years ago)
Author:
cinc
Message:

Implemented interface forward declaration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/idl-compiler/h-emitter_c/h_file_emitter.c

    r282 r287  
    7272}
    7373
    74 
    75 static void emitParentHeader(PPARSEINFO pLocalPI, PINTERFACE pif)
    76 {
    77   FILE* fh=pLocalPI->outFile;
    78   PINTERFACE pifParent=getParentInterface(pif);
    79 
    80   /* Include header of parent */
    81   if(pifParent){
    82     fprintf(fh, "/* Include for the parent class */\n");
    83     if(pifParent->chrFileStem)
    84       fprintf(fh, "#include \"%s.h\"\n\n", pifParent->chrFileStem);
    85   }
     74/**
     75   This function writes an #include statement to the header for each found
     76   interface. Thus all the interface information is known to the sourcefile
     77   using this header.
     78 */
     79static void emitInterfaceIncludes(PPARSEINFO pLocalPI, PINTERFACE pif)
     80{
     81  FILE* fh=pLocalPI->outFile;
     82  int a;
     83
     84  for(a=0;a<pLocalPI->pInterfaceArray->len;a++)
     85    {
     86      PINTERFACE pifAll=g_ptr_array_index(pLocalPI->pInterfaceArray, a);
     87
     88      fprintf(fh, "/* Include for class %s */\n", pifAll->chrName);
     89      if(pifAll->chrFileStem)
     90        fprintf(fh, "#include \"%s.h\"\n", pifAll->chrFileStem);
     91    }
     92  fprintf(fh, "\n");
    8693}
    8794
     
    332339            {
    333340              emitHFileHeader(pLocalPI, pif);
    334               emitParentHeader(pLocalPI, pif);
     341              emitInterfaceIncludes(pLocalPI, pif);
    335342              emitClassVersion(pLocalPI, pif);
    336343              emitClassDataStructs(pLocalPI, pif);
Note: See TracChangeset for help on using the changeset viewer.