home *** CD-ROM | disk | FTP | other *** search
/ Dream 57 / Amiga_Dream_57.iso / Amiga / Programmation / c / Docs / cxref-1.4a.lha / warn-raw.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-12-07  |  17.8 KB  |  628 lines

  1. /***************************************
  2.   $Header: /home/amb/cxref/RCS/warn-raw.c 1.23 1997/11/20 19:19:07 amb Exp $
  3.  
  4.   C Cross Referencing & Documentation tool. Version 1.4a.
  5.  
  6.   Writes the raw information and / or warnings out.
  7.   ******************/ /******************
  8.   Written by Andrew M. Bishop
  9.  
  10.   This file Copyright 1995,96,97 Andrew M. Bishop
  11.   It may be distributed under the GNU Public License, version 2, or
  12.   any higher version.  See section COPYING of the GNU Public license
  13.   for conditions under which this file may be redistributed.
  14.   ***************************************/
  15.  
  16. #include <stdlib.h>
  17. #include <stdio.h>
  18. #include <string.h>
  19.  
  20. #ifdef AMIGA /* olsen */
  21. #include "amiga.h"
  22. #endif /* AMIGA */
  23.  
  24. #include "datatype.h"
  25. #include "cxref.h"
  26. #include "memory.h"
  27.  
  28. static void WriteWarnRawFilePart(File file);
  29. static void WriteWarnRawInclude(Include inc);
  30. static void WriteWarnRawSubInclude(Include inc,int depth);
  31. static void WriteWarnRawDefine(Define def);
  32. static void WriteWarnRawTypedef(Typedef type);
  33. static void WriteWarnRawStructUnion(StructUnion su, int depth,StructUnion base);
  34. static void WriteWarnRawVariable(Variable var);
  35. static void WriteWarnRawFunction(Function func);
  36.  
  37. /*+ Output option. +*/
  38. extern int option_warn,option_raw,option_xref,option_index;
  39.  
  40. /*+ The name of the current file. +*/
  41. static char* filename=NULL;
  42.  
  43. /*++++++++++++++++++++++++++++++++++++++
  44.   Write the raw / warning output for a complete File structure and all components.
  45.  
  46.   File file The File structure to output.
  47.   ++++++++++++++++++++++++++++++++++++++*/
  48.  
  49. void WriteWarnRawFile(File file)
  50. {
  51.  Include   inc =file->includes;
  52.  Define    def =file->defines;
  53.  Typedef   type=file->typedefs;
  54.  Variable  var=file->variables;
  55.  Function  func=file->functions;
  56.  
  57.  filename=file->name;
  58.  
  59.  /*+ The file structure is broken into its components and they are each written out. +*/
  60.  
  61.  if(option_raw)
  62.     printf("----------------------------------------\n");
  63.  
  64.  WriteWarnRawFilePart(file);
  65.  
  66.  while(inc)
  67.    {
  68.     WriteWarnRawInclude(inc);
  69.     inc=inc->next;
  70.    }
  71.  
  72.  while(def)
  73.    {
  74.     WriteWarnRawDefine(def);
  75.     def=def->next;
  76.    }
  77.  
  78.  while(type)
  79.    {
  80.     WriteWarnRawTypedef(type);
  81.     type=type->next;
  82.    }
  83.  
  84.  while(var)
  85.    {
  86.     WriteWarnRawVariable(var);
  87.     var=var->next;
  88.    }
  89.  
  90.  while(func)
  91.    {
  92.     WriteWarnRawFunction(func);
  93.     func=func->next;
  94.    }
  95.  
  96.  if(option_raw)
  97.     printf("----------------------------------------\n\n");
  98. }
  99.  
  100.  
  101. /*++++++++++++++++++++++++++++++++++++++
  102.   Write a File structure out.
  103.  
  104.   File file The File structure to output.
  105.   ++++++++++++++++++++++++++++++++++++++*/
  106.  
  107. static void WriteWarnRawFilePart(File file)
  108. {
  109.  int i;
  110.  
  111.  if(option_raw)
  112.     printf("FILE : '%s'\n",file->name);
  113.  
  114.  if(file->comment && option_raw)
  115.     printf("<<<\n%s\n>>>\n",file->comment);
  116.  
  117.  if(option_warn&WARN_COMMENT && !file->comment)
  118.     printf("Warning %16s : File does not have a comment.\n",filename);
  119.  
  120.  if(option_xref&XREF_FILE)
  121.    {
  122.     if(option_raw)
  123.        for(i=0;i<file->inc_in->n;i++)
  124.           printf("Included in %s\n",file->inc_in->s[i]);
  125.  
  126.     if(option_warn&WARN_XREF)
  127.       {
  128.        int len=strlen(file->name)-2;
  129.        if(!file->inc_in->n && !strcmp(&file->name[len],".h"))
  130.           printf("Warning %16s : Header file %s is not included in any files.\n",filename,file->name);
  131.        if( file->inc_in->n && !strcmp(&file->name[len],".c"))
  132.           printf("Warning %16s : Source file %s is included in another file.\n",filename,file->name);
  133.       }
  134.    }
  135.  
  136.  if(option_xref&XREF_FUNC)
  137.     for(i=0;i<file->f_refs->n;i++)
  138.       {
  139.        if(option_raw)
  140.           if(file->f_refs->s2[i])
  141.              printf("References Function %s : %s\n",file->f_refs->s1[i],file->f_refs->s2[i]);
  142.           else
  143.              printf("References Function %s\n",file->f_refs->s1[i]);
  144.        if(option_warn&WARN_XREF && !file->f_refs->s2[i])
  145.           printf("Warning %16s : File references function %s() whose definition is unknown.\n",filename,file->f_refs->s1[i]);
  146.       }
  147.  
  148.  if(option_xref&XREF_VAR)
  149.     for(i=0;i<file->v_refs->n;i++)
  150.       {
  151.        if(option_raw)
  152.           if(file->v_refs->s2[i])
  153.              printf("References Variable %s : %s\n",file->v_refs->s1[i],file->v_refs->s2[i]);
  154.           else
  155.              printf("References Variable %s\n",file->v_refs->s1[i]);
  156.        if(option_warn&WARN_XREF && !file->v_refs->s2[i])
  157.           printf("Warning %16s : File references variable %s whose definition is unknown.\n",filename,file->v_refs->s1[i]);
  158.       }
  159. }
  160.  
  161.  
  162. /*++++++++++++++++++++++++++++++++++++++
  163.   Write an Include structure out.
  164.  
  165.   Include inc The Include structure to output.
  166.   ++++++++++++++++++++++++++++++++++++++*/
  167.  
  168. static void WriteWarnRawInclude(Include inc)
  169. {
  170.  if(option_raw)
  171.     printf("\nINCLUDES : '%s' [%s file]\n",inc->name,(inc->scope==GLOBAL?"System":"Local"));
  172.  
  173.  if(inc->comment && option_raw)
  174.     printf("<<<\n%s\n>>>\n",inc->comment);
  175.  if(option_warn&WARN_COMMENT && !inc->comment)
  176.     printf("Warning %16s : #Include %s does not have a comment.\n",filename,inc->name);
  177.  
  178.  if(option_raw && inc->includes)
  179.     WriteWarnRawSubInclude(inc->includes,1);
  180. }
  181.  
  182.  
  183. /*++++++++++++++++++++++++++++++++++++++
  184.   Write an Sub-Include structure out.
  185.  
  186.   Include inc The Include structure to output.
  187.  
  188.   int depth The depth of the include hierarchy.
  189.   ++++++++++++++++++++++++++++++++++++++*/
  190.  
  191. static void WriteWarnRawSubInclude(Include inc,int depth)
  192. {
  193.  int i;
  194.  
  195.  while(inc)
  196.    {
  197.     for(i=0;i<depth;i++) printf("   ");
  198.     printf("INCLUDES : '%s' [%s file]\n",inc->name,(inc->scope==GLOBAL?"System":"Local"));
  199.  
  200.     if(inc->includes)
  201.        WriteWarnRawSubInclude(inc->includes,depth+1);
  202.  
  203.     inc=inc->next;
  204.    }
  205. }
  206.  
  207.  
  208. /*++++++++++++++++++++++++++++++++++++++
  209.   Write a Define structure out.
  210.  
  211.   Define def The Define structure to output.
  212.   ++++++++++++++++++++++++++++++++++++++*/
  213.  
  214. static void WriteWarnRawDefine(Define def)
  215. {
  216.  int i;
  217.  
  218.  if(option_raw)
  219.    {
  220.     printf("\nDEFINES : '%s' ",def->name);
  221.  
  222.     if(def->value)
  223.        printf("= %s",def->value);
  224.  
  225.     if(def->args->n)
  226.       {
  227.        printf("(");
  228.        for(i=0;i<def->args->n;i++)
  229.           printf(i?",%s":"%s",def->args->s1[i]);
  230.        printf(")");
  231.       }
  232.  
  233.     printf("\n");
  234.    }
  235.  
  236.  if(def->comment && option_raw)
  237.     printf("<<<\n%s\n>>>\n",def->comment);
  238.  if(option_warn&WARN_COMMENT && !def->comment)
  239.     printf("Warning %16s : #Define %s does not have a comment.\n",filename,def->name);
  240.  
  241.  for(i=0;i<def->args->n;i++)
  242.    {
  243.     if(option_raw)
  244.        if(def->args->s2[i])
  245.           printf("Arguments: %s <<<%s>>>\n",def->args->s1[i],def->args->s2[i]);
  246.        else
  247.           printf("Arguments: %s\n",def->args->s1[i]);
  248.     if(option_warn&WARN_COMMENT && !def->args->s2[i])
  249.        printf("Warning %16s : #Define %s has an argument %s with no comment.\n",filename,def->name,def->args->s1[i]);
  250.    }
  251. }
  252.  
  253.  
  254. /*++++++++++++++++++++++++++++++++++++++
  255.   Write a Typedef structure out.
  256.  
  257.   Typedef type The Typedef structure to output.
  258.   ++++++++++++++++++++++++++++++++++++++*/
  259.  
  260. static void WriteWarnRawTypedef(Typedef type)
  261. {
  262.  if(option_raw)
  263.     if(type->type)
  264.        printf("\nTYPEDEF : '%s'\n",type->name);
  265.     else
  266.        printf("\nTYPE : '%s'\n",type->name);
  267.  
  268.  if(type->comment && option_raw)
  269.     printf("<<<\n%s\n>>>\n",type->comment);
  270.  if(option_warn&WARN_COMMENT && !type->comment)
  271.     printf("Warning %16s : Type %s does not have a comment.\n",filename,type->name);
  272.  
  273.  if(option_raw)
  274.     if(type->type)
  275.        printf("Type: %s\n",type->type);
  276.  
  277.  if(option_raw)
  278.     if(type->typexref)
  279.        printf("See: %s %s\n",type->typexref->type?"Typedef":"Type",type->typexref->name);
  280.  
  281.  if(type->sutype)
  282.     WriteWarnRawStructUnion(type->sutype,0,type->sutype);
  283. }
  284.  
  285.  
  286. /*++++++++++++++++++++++++++++++++++++++
  287.   Write a structure / union / enum out.
  288.  
  289.   StructUnion su The structure / union / enum to write.
  290.  
  291.   int depth The depth within the structure.
  292.  
  293.   StructUnion base The base struct union that this one is part of.
  294.   ++++++++++++++++++++++++++++++++++++++*/
  295.  
  296. static void WriteWarnRawStructUnion(StructUnion su, int depth,StructUnion base)
  297. {
  298.  int i;
  299.  char* splitsu=NULL;
  300.  
  301.  if(option_warn&WARN_COMMENT && depth && !su->comment)
  302.     printf("Struct/Union component %s in %s does not have a comment.\n",su->name,base->name);
  303.  
  304.  splitsu=strstr(su->name,"{...}");
  305.  if(splitsu) splitsu[-1]=0;
  306.  
  307.  if(option_raw)
  308.    {
  309.     for(i=0;i<depth;i++) printf("   ");
  310.     if(depth && su->comment && !su->comps)
  311.        printf("%s; <<<%s>>>\n",su->name,su->comment);
  312.     else
  313.        printf("%s%s\n",su->name,su->comps?"":";");
  314.    }
  315.  
  316.  if(su->comps)
  317.    {
  318.     if(option_raw)
  319.       {
  320.        for(i=0;i<depth;i++) printf("   ");
  321.        printf("  {\n");
  322.       }
  323.     for(i=0;i<su->n_comp;i++)
  324.        WriteWarnRawStructUnion(su->comps[i],depth+1,base);
  325.     if(option_raw)
  326.       {
  327.        for(i=0;i<depth;i++) printf("   ");
  328.        printf("  }\n");
  329.        if(splitsu)
  330.          {
  331.           for(i=0;i<depth;i++) printf("   ");
  332.           if(depth && su->comment)
  333.              printf("%s; <<<%s>>>\n",splitsu[5]?&splitsu[6]:"",su->comment);
  334.           else
  335.              printf("%s;\n",splitsu[5]?&splitsu[6]:"");
  336.          }
  337.       }
  338.    }
  339.  
  340.  if(splitsu) splitsu[-1]=' ';
  341. }
  342.  
  343.  
  344. /*++++++++++++++++++++++++++++++++++++++
  345.   Write a Variable structure out.
  346.  
  347.   Variable var The Variable structure to output.
  348.   ++++++++++++++++++++++++++++++++++++++*/
  349.  
  350. static void WriteWarnRawVariable(Variable var)
  351. {
  352.  int i;
  353.  
  354.  if(option_raw)
  355.    {
  356.     int done=0;
  357.  
  358.     printf("\nVARIABLE : %s [",var->name);
  359.     if(var->scope&LOCAL)    done=printf("Local");
  360.     if(var->scope&GLOBAL)   done=printf("Global");
  361.     if(var->scope&EXTERNAL) done=printf("%sExternal",done?" and ":"");
  362.     if(var->scope&EXTERN_H) done=printf("%sExternal from header file",done?" and ":"");
  363.     if(var->scope&EXTERN_F)      printf("%sExternal within function",done?" and ":"");
  364.     printf("]\n");
  365.  
  366.     if(var->comment)
  367.        printf("<<<\n%s\n>>>\n",var->comment);
  368.    }
  369.  
  370.  if(option_warn&WARN_COMMENT && !var->comment && (var->scope&(GLOBAL|LOCAL|EXTERNAL|EXTERN_F) || option_raw))
  371.     printf("Warning %16s : Variable %s does not have a comment.\n",filename,var->name);
  372.  
  373.  if(option_raw)
  374.     printf("Type: %s\n",var->type);
  375.  
  376.  if(option_raw && var->incfrom)
  377.     printf("Included from: %s\n",var->incfrom);
  378.  
  379.  if(option_xref&XREF_VAR)
  380.    {
  381.     if(option_raw)
  382.       {
  383.        if(var->scope&(EXTERNAL|EXTERN_F) && var->defined)
  384.           printf("Declared global in '%s'\n",var->defined);
  385.  
  386.        if(var->scope&(GLOBAL|LOCAL))
  387.          {
  388.           for(i=0;i<var->visible->n;i++)
  389.              if(var->visible->s1[i][0]=='$')
  390.                 printf("Visible in %s\n",var->visible->s2[i]);
  391.              else
  392.                 printf("Visible in %s : %s\n",var->visible->s1[i],var->visible->s2[i]);
  393.  
  394.           for(i=0;i<var->used->n;i++)
  395.              if(var->used->s1[i][0]=='$')
  396.                 printf("Used in %s\n",var->used->s2[i]);
  397.              else
  398.                 printf("Used in %s : %s\n",var->used->s1[i],var->used->s2[i]);
  399.          }
  400.       }
  401.  
  402.     if(option_warn&WARN_XREF)
  403.       {
  404.        if(var->scope&(EXTERNAL|EXTERN_F) && !var->defined)
  405.           printf("Warning %16s : Variable %s has an unknown global definition.\n",filename,var->name);
  406.  
  407.        if(var->scope&(GLOBAL|LOCAL|EXTERNAL|EXTERN_F) && !var->used->n)
  408.           printf("Warning %16s : Variable %s is not used anywhere.\n",filename,var->name);
  409.  
  410.        if(var->scope&(GLOBAL|EXTERNAL|EXTERN_F) && var->used->n)
  411.          {
  412.           int is_used_elsewhere=0,is_used_here=0;
  413.           for(i=0;i<var->used->n;i++)
  414.              if(!strcmp(filename,var->used->s2[i]))
  415.                 is_used_here=1;
  416.              else
  417.                 is_used_elsewhere=1;
  418.           if(!is_used_elsewhere)
  419.              printf("Warning %16s : Variable %s is %s but only used in this file.\n",filename,var->name,var->scope&GLOBAL?"global":"extern");
  420.           if(!is_used_here)
  421.              printf("Warning %16s : Variable %s is %s but not used in this file.\n",filename,var->name,var->scope&GLOBAL?"global":"extern");
  422.          }
  423.       }
  424.    }
  425. }
  426.  
  427.  
  428. /*++++++++++++++++++++++++++++++++++++++
  429.   Write a Function structure out.
  430.  
  431.   Function func The Function structure to output.
  432.   ++++++++++++++++++++++++++++++++++++++*/
  433.  
  434. static void WriteWarnRawFunction(Function func)
  435. {
  436.  int i;
  437.  
  438.  if(option_raw)
  439.    {
  440.     int done=0;
  441.  
  442.     printf("\nFUNCTION : %s [",func->name);
  443.     if(func->scope&LOCAL)    done=printf("Local");
  444.     if(func->scope&GLOBAL)   done=printf("Global");
  445.     if(func->scope&EXTERNAL) done=printf("External");
  446.     if(func->scope&INLINED)       printf("%sInline",done?" and ":"");
  447.     printf("]\n");
  448.  
  449.     if(func->comment)
  450.        printf("<<<\n%s\n>>>\n",func->comment);
  451.    }
  452.  
  453.  if(option_warn&WARN_COMMENT && !func->comment)
  454.     printf("Warning %16s : Function %s() does not have a comment.\n",filename,func->name);
  455.  
  456.  if(option_xref&XREF_FUNC)
  457.    {
  458.     if(func->protofile && option_raw)
  459.        printf("Prototyped in %s\n",func->protofile);
  460.     if(option_warn&WARN_XREF && !func->protofile)
  461.        printf("Warning %16s : Function %s() is not prototyped.\n",filename,func->name);
  462.    }
  463.  
  464.  if(option_raw)
  465.     if(func->cret)
  466.        printf("Type: %s <<<%s>>>\n",func->type,func->cret);
  467.     else
  468.        printf("Type: %s\n",func->type);
  469.  if(option_warn&WARN_COMMENT && !func->cret && strncmp("void ",func->type,5))
  470.     printf("Warning %16s : Function %s() has a return value with no comment.\n",filename,func->name);
  471.  
  472.  for(i=0;i<func->args->n;i++)
  473.    {
  474.     if(option_raw)
  475.        if(func->args->s2[i])
  476.           printf("Arguments: %s <<<%s>>>\n",func->args->s1[i],func->args->s2[i]);
  477.        else
  478.           printf("Arguments: %s\n",func->args->s1[i]);
  479.     if(option_warn&WARN_COMMENT && !func->args->s2[i] && strcmp("void",func->args->s1[i]))
  480.        printf("Warning %16s : Function %s() has an argument %s with no comment.\n",filename,func->name,func->args->s1[i]);
  481.    }
  482.  
  483.  if(option_raw && func->incfrom)
  484.     printf("Included from: %s\n",func->incfrom);
  485.  
  486.  if(option_xref&XREF_FUNC)
  487.    {
  488.     for(i=0;i<func->calls->n;i++)
  489.       {
  490.        if(option_raw)
  491.           if(func->calls->s2[i])
  492.              printf("Calls %s : %s\n",func->calls->s1[i],func->calls->s2[i]);
  493.           else
  494.              printf("Calls %s\n",func->calls->s1[i]);
  495. #if 0 /* Too verbose */
  496.        if(option_warn&WARN_XREF && !func->calls->s2[i])
  497.           printf("Warning %16s : Function %s() calls function %s() whose definition is unknown.\n",filename,func->name,func->calls->s1[i]);
  498. #endif
  499.       }
  500.  
  501.     if(option_raw)
  502.        for(i=0;i<func->called->n;i++)
  503.           printf("Called from %s : %s\n",func->called->s1[i],func->called->s2[i]);
  504.  
  505.     if(option_raw)
  506.        for(i=0;i<func->used->n;i++)
  507.          {
  508.           if(func->used->s1[i][0]=='$')
  509.              printf("Used in %s\n",func->used->s2[i]);
  510.           else
  511.              printf("Used in %s : %s\n",func->used->s1[i],func->used->s2[i]);
  512.          }
  513.  
  514.     for(i=0;i<func->f_refs->n;i++)
  515.       {
  516.        if(option_raw)
  517.           if(func->f_refs->s2[i])
  518.              printf("References Function %s : %s\n",func->f_refs->s1[i],func->f_refs->s2[i]);
  519.           else
  520.              printf("References Function %s\n",func->f_refs->s1[i]);
  521.        if(option_warn&WARN_XREF && !func->f_refs->s2[i])
  522.           printf("Warning %16s : Function %s() references function %s() whose definition is unknown.\n",filename,func->name,func->f_refs->s1[i]);
  523.       }
  524.    }
  525.  
  526.  if(option_xref&XREF_VAR)
  527.     for(i=0;i<func->v_refs->n;i++)
  528.       {
  529.        if(option_raw)
  530.           if(func->v_refs->s2[i])
  531.              printf("References Variable %s : %s\n",func->v_refs->s1[i],func->v_refs->s2[i]);
  532.           else
  533.              printf("References Variable %s\n",func->v_refs->s1[i]);
  534.        if(option_warn&WARN_XREF && !func->v_refs->s2[i])
  535.           printf("Warning %16s : Function %s() references variable %s whose definition is unknown.\n",filename,func->name,func->v_refs->s1[i]);
  536.       }
  537.  
  538.  
  539.  if(option_warn&WARN_XREF)
  540.    {
  541.     if(!func->used->n && !func->called->n)
  542.        printf("Warning %16s : Function %s() is not used anywhere.\n",filename,func->name);
  543.  
  544.     if(func->scope&GLOBAL && (func->called->n || func->used->n))
  545.       {
  546.        int is_used_elsewhere=0;
  547.        for(i=0;i<func->called->n;i++)
  548.           if(strcmp(func->called->s2[i],filename))
  549.             {is_used_elsewhere=1;break;}
  550.        for(i=0;i<func->used->n;i++)
  551.           if(strcmp(func->used->s2[i],filename))
  552.             {is_used_elsewhere=1;break;}
  553.        if(!is_used_elsewhere)
  554.           printf("Warning %16s : Function %s() is global but is only used in this file.\n",filename,func->name);
  555.       }
  556.    }
  557. }
  558.  
  559.  
  560. /*++++++++++++++++++++++++++++++++++++++
  561.   Write out a raw version of the appendix.
  562.  
  563.   StringList files The list of files to write.
  564.  
  565.   StringList2 funcs The list of functions to write.
  566.  
  567.   StringList2 vars The list of variables to write.
  568.  
  569.   StringList2 types The list of types to write.
  570.   ++++++++++++++++++++++++++++++++++++++*/
  571.  
  572. void WriteWarnRawAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types)
  573. {
  574.  int i;
  575.  
  576.  /* Write out the appendix of files. */
  577.  
  578.  if(option_index&INDEX_FILE)
  579.     if(files->n)
  580.       {
  581.        printf("\nAppendix - Files\n\n");
  582.        for(i=0;i<files->n;i++)
  583.           printf("%s\n",files->s[i]);
  584.       }
  585.     else
  586.        if(option_warn&WARN_XREF)
  587.           printf("Warning Index : No global files to index.\n");
  588.  
  589.  /* Write out the appendix of functions. */
  590.  
  591.  if(option_index&INDEX_FUNC)
  592.     if(funcs->n)
  593.       {
  594.        printf("\nAppendix - Global Functions\n\n");
  595.        for(i=0;i<funcs->n;i++)
  596.           printf("%s : %s\n",funcs->s1[i],funcs->s2[i]);
  597.       }
  598.     else
  599.        if(option_warn&WARN_XREF)
  600.           printf("Warning Index : No global functions to index.\n");
  601.  
  602.  /* Write out the appendix of variables. */
  603.  
  604.  if(option_index&INDEX_VAR)
  605.     if(vars->n)
  606.       {
  607.        printf("\nAppendix - Global Variables\n\n");
  608.        for(i=0;i<vars->n;i++)
  609.           printf("%s : %s\n",vars->s1[i],vars->s2[i]);
  610.       }
  611.     else
  612.        if(option_warn&WARN_XREF)
  613.           printf("Warning Index : No global variables to index.\n");
  614.  
  615.  /* Write out the appendix of types. */
  616.  
  617.  if(option_index&INDEX_TYPE)
  618.     if(types->n)
  619.       {
  620.        printf("\nAppendix - Defined Types\n\n");
  621.        for(i=0;i<types->n;i++)
  622.           printf("%s : %s\n",types->s1[i],types->s2[i]);
  623.       }
  624.     else
  625.        if(option_warn&WARN_XREF)
  626.           printf("Warning Index : No types to index.\n");
  627. }
  628.