Beispiel #1
0
globle void WriteNeededSymbols(
  void *theEnv,
  FILE *fp)
  {
   unsigned long i;
   size_t length;
   SYMBOL_HN **symbolArray;
   SYMBOL_HN *symbolPtr;
   unsigned long int numberOfUsedSymbols = 0;
   size_t size = 0;

   /*=================================*/
   /* Get a copy of the symbol table. */
   /*=================================*/

   symbolArray = GetSymbolTable(theEnv);

   /*======================================================*/
   /* Get the number of symbols and the total string size. */
   /*======================================================*/

   for (i = 0; i < SYMBOL_HASH_SIZE; i++)
     {
      for (symbolPtr = symbolArray[i];
           symbolPtr != NULL;
           symbolPtr = symbolPtr->next)
        {
         if (symbolPtr->neededSymbol)
           {
            numberOfUsedSymbols++;
            size += strlen(symbolPtr->contents) + 1;
           }
        }
     }

   /*=============================================*/
   /* Write out the symbols and the string sizes. */
   /*=============================================*/

   GenWrite((void *) &numberOfUsedSymbols,(unsigned long) sizeof(unsigned long int),fp);
   GenWrite((void *) &size,(unsigned long) sizeof(unsigned long int),fp);

   for (i = 0; i < SYMBOL_HASH_SIZE; i++)
     {
      for (symbolPtr = symbolArray[i];
           symbolPtr != NULL;
           symbolPtr = symbolPtr->next)
        {
         if (symbolPtr->neededSymbol)
           {
            length = strlen(symbolPtr->contents) + 1;
            GenWrite((void *) symbolPtr->contents,(unsigned long) length,fp);
           }
        }
     }
  }
Beispiel #2
0
static int SymbolHashNodesToCode(
  void *theEnv,
  EXEC_STATUS,
  char *fileName,
  char *pathName,
  char *fileNameBuffer,
  int version)
  {
   unsigned long i, j;
   struct symbolHashNode *hashPtr;
   int count;
   int numberOfEntries;
   struct symbolHashNode **symbolTable;
   int newHeader = TRUE;
   int arrayVersion = 1;
   FILE *fp;

   /*====================================*/
   /* Count the total number of entries. */
   /*====================================*/

   symbolTable = GetSymbolTable(theEnv,execStatus);
   count = numberOfEntries = 0;

   for (i = 0; i < SYMBOL_HASH_SIZE; i++)
     {
      for (hashPtr = symbolTable[i];
           hashPtr != NULL;
           hashPtr = hashPtr->next)
        { numberOfEntries++; }
     }

   if (numberOfEntries == 0) return(version);

   for (i = 1; i <= (unsigned long) (numberOfEntries / ConstructCompilerData(theEnv,execStatus)->MaxIndices) + 1 ; i++)
     { fprintf(ConstructCompilerData(theEnv,execStatus)->HeaderFP,"extern struct symbolHashNode S%d_%ld[];\n",ConstructCompilerData(theEnv,execStatus)->ImageID,i); }

   /*==================*/
   /* Create the file. */
   /*==================*/

   if ((fp = NewCFile(theEnv,execStatus,fileName,pathName,fileNameBuffer,1,version,FALSE)) == NULL) return(-1);

   /*===================*/
   /* List the entries. */
   /*===================*/

   j = 0;

   for (i = 0; i < SYMBOL_HASH_SIZE; i++)
     {
      for (hashPtr = symbolTable[i];
           hashPtr != NULL;
           hashPtr = hashPtr->next)
        {
         if (newHeader)
           {
            fprintf(fp,"struct symbolHashNode S%d_%d[] = {\n",ConstructCompilerData(theEnv,execStatus)->ImageID,arrayVersion);
            newHeader = FALSE;
           }

         if (hashPtr->next == NULL)
           { fprintf(fp,"{NULL,"); }
         else
           {
            if ((j + 1) >= (unsigned long) ConstructCompilerData(theEnv,execStatus)->MaxIndices)
              { fprintf(fp,"{&S%d_%d[%d],",ConstructCompilerData(theEnv,execStatus)->ImageID,arrayVersion + 1,0); }
            else
              { fprintf(fp,"{&S%d_%d[%ld],",ConstructCompilerData(theEnv,execStatus)->ImageID,arrayVersion,j + 1); }
           }

         fprintf(fp,"%ld,0,1,0,0,%ld,",hashPtr->count + 1,i);
         PrintCString(fp,hashPtr->contents);

         count++;
         j++;

         if ((count == numberOfEntries) || (j >= (unsigned) ConstructCompilerData(theEnv,execStatus)->MaxIndices))
           {
            fprintf(fp,"}};\n");
            GenClose(theEnv,execStatus,fp);
            j = 0;
            arrayVersion++;
            version++;
            if (count < numberOfEntries)
              {
               if ((fp = NewCFile(theEnv,execStatus,fileName,pathName,fileNameBuffer,1,version,FALSE)) == NULL) return(0);
               newHeader = TRUE;
              }
           }
         else
           { fprintf(fp,"},\n"); }
        }
     }

   return(version);
  }
Beispiel #3
0
static int HashTablesToCode(
  void *theEnv,
  EXEC_STATUS,
  char *fileName,
  char *pathName,
  char *fileNameBuffer)
  {
   unsigned long i;
   FILE *fp;
   struct symbolHashNode **symbolTable;
   struct floatHashNode **floatTable;
   struct integerHashNode **integerTable;
   struct bitMapHashNode **bitMapTable;

   /*======================================*/
   /* Write the code for the symbol table. */
   /*======================================*/

   symbolTable = GetSymbolTable(theEnv,execStatus);

   if ((fp = NewCFile(theEnv,execStatus,fileName,pathName,fileNameBuffer,1,1,FALSE)) == NULL) return(0);

   fprintf(ConstructCompilerData(theEnv,execStatus)->HeaderFP,"extern struct symbolHashNode *sht%d[];\n",ConstructCompilerData(theEnv,execStatus)->ImageID);
   fprintf(fp,"struct symbolHashNode *sht%d[%ld] = {\n",ConstructCompilerData(theEnv,execStatus)->ImageID,SYMBOL_HASH_SIZE);

   for (i = 0; i < SYMBOL_HASH_SIZE; i++)
      {
       PrintSymbolReference(theEnv,execStatus,fp,symbolTable[i]);

       if (i + 1 != SYMBOL_HASH_SIZE) fprintf(fp,",\n");
      }

    fprintf(fp,"};\n");

    GenClose(theEnv,execStatus,fp);

   /*=====================================*/
   /* Write the code for the float table. */
   /*=====================================*/

   floatTable = GetFloatTable(theEnv,execStatus);

   if ((fp = NewCFile(theEnv,execStatus,fileName,pathName,fileNameBuffer,1,2,FALSE)) == NULL) return(0);

   fprintf(ConstructCompilerData(theEnv,execStatus)->HeaderFP,"extern struct floatHashNode *fht%d[];\n",ConstructCompilerData(theEnv,execStatus)->ImageID);
   fprintf(fp,"struct floatHashNode *fht%d[%d] = {\n",ConstructCompilerData(theEnv,execStatus)->ImageID,FLOAT_HASH_SIZE);

   for (i = 0; i < FLOAT_HASH_SIZE; i++)
      {
       if (floatTable[i] == NULL) { fprintf(fp,"NULL"); }
       else PrintFloatReference(theEnv,execStatus,fp,floatTable[i]);

       if (i + 1 != FLOAT_HASH_SIZE) fprintf(fp,",\n");
      }

    fprintf(fp,"};\n");

    GenClose(theEnv,execStatus,fp);

   /*=======================================*/
   /* Write the code for the integer table. */
   /*=======================================*/

   integerTable = GetIntegerTable(theEnv,execStatus);

   if ((fp = NewCFile(theEnv,execStatus,fileName,pathName,fileNameBuffer,1,3,FALSE)) == NULL) return(0);

   fprintf(ConstructCompilerData(theEnv,execStatus)->HeaderFP,"extern struct integerHashNode *iht%d[];\n",ConstructCompilerData(theEnv,execStatus)->ImageID);
   fprintf(fp,"struct integerHashNode *iht%d[%d] = {\n",ConstructCompilerData(theEnv,execStatus)->ImageID,INTEGER_HASH_SIZE);

   for (i = 0; i < INTEGER_HASH_SIZE; i++)
      {
       if (integerTable[i] == NULL) { fprintf(fp,"NULL"); }
       else PrintIntegerReference(theEnv,execStatus,fp,integerTable[i]);

       if (i + 1 != INTEGER_HASH_SIZE) fprintf(fp,",\n");
      }

    fprintf(fp,"};\n");

    GenClose(theEnv,execStatus,fp);

   /*======================================*/
   /* Write the code for the bitmap table. */
   /*======================================*/

   bitMapTable = GetBitMapTable(theEnv,execStatus);

   if ((fp = NewCFile(theEnv,execStatus,fileName,pathName,fileNameBuffer,1,4,FALSE)) == NULL) return(0);

   fprintf(ConstructCompilerData(theEnv,execStatus)->HeaderFP,"extern struct bitMapHashNode *bmht%d[];\n",ConstructCompilerData(theEnv,execStatus)->ImageID);
   fprintf(fp,"struct bitMapHashNode *bmht%d[%d] = {\n",ConstructCompilerData(theEnv,execStatus)->ImageID,BITMAP_HASH_SIZE);

   for (i = 0; i < BITMAP_HASH_SIZE; i++)
      {
       PrintBitMapReference(theEnv,execStatus,fp,bitMapTable[i]);

       if (i + 1 != BITMAP_HASH_SIZE) fprintf(fp,",\n");
      }

    fprintf(fp,"};\n");

    GenClose(theEnv,execStatus,fp);

    return(1);
   }
Beispiel #4
0
globle void PrimitiveTablesUsage(
  void *theEnv)
  {
   unsigned long i;
   int symbolCounts[COUNT_SIZE], floatCounts[COUNT_SIZE];
   SYMBOL_HN **symbolArray, *symbolPtr;
   FLOAT_HN **floatArray, *floatPtr;
   unsigned long int symbolCount, totalSymbolCount = 0;
   unsigned long int floatCount, totalFloatCount = 0;

   EnvArgCountCheck(theEnv,"primitives-usage",EXACTLY,0);

   for (i = 0; i < 21; i++)
     {
      symbolCounts[i] = 0;
      floatCounts[i] = 0; 
     }
     
   /*====================================*/
   /* Count entries in the symbol table. */
   /*====================================*/

   symbolArray = GetSymbolTable(theEnv);
   for (i = 0; i < SYMBOL_HASH_SIZE; i++)
     {
      symbolCount = 0;
      for (symbolPtr = symbolArray[i]; symbolPtr != NULL; symbolPtr = symbolPtr->next)
        { 
         symbolCount++;
         totalSymbolCount++;
        }
           
      if (symbolCount < (COUNT_SIZE - 1))
        { symbolCounts[symbolCount]++; }
      else
        { symbolCounts[COUNT_SIZE - 1]++; }
     }

   /*===================================*/
   /* Count entries in the float table. */
   /*===================================*/
   
   floatArray = GetFloatTable(theEnv);
   for (i = 0; i < FLOAT_HASH_SIZE; i++)
     {
      floatCount = 0;
      for (floatPtr = floatArray[i]; floatPtr != NULL; floatPtr = floatPtr->next)
        { 
         floatCount++;
         totalFloatCount++;
        }
           
      if (floatCount < (COUNT_SIZE - 1))
        { floatCounts[floatCount]++; }
      else
        { floatCounts[COUNT_SIZE - 1]++; }
     }


   /*========================*/
   /* Print the information. */
   /*========================*/

   EnvPrintRouter(theEnv,WDISPLAY,"Total Symbols: ");
   PrintLongInteger(theEnv,WDISPLAY,(long) totalSymbolCount);
   EnvPrintRouter(theEnv,WDISPLAY,"\n");
   for (i = 0; i < COUNT_SIZE; i++)
     {
      PrintLongInteger(theEnv,WDISPLAY,(long) i);
      EnvPrintRouter(theEnv,WDISPLAY," ");
      PrintLongInteger(theEnv,WDISPLAY,(long) symbolCounts[i]);
      EnvPrintRouter(theEnv,WDISPLAY,"\n");
     }

   EnvPrintRouter(theEnv,WDISPLAY,"\nTotal Floats: ");
   PrintLongInteger(theEnv,WDISPLAY,(long) totalFloatCount);
   EnvPrintRouter(theEnv,WDISPLAY,"\n");
   for (i = 0; i < COUNT_SIZE; i++)
     {
      PrintLongInteger(theEnv,WDISPLAY,(long) i);
      EnvPrintRouter(theEnv,WDISPLAY," ");
      PrintLongInteger(theEnv,WDISPLAY,(long) floatCounts[i]);
      EnvPrintRouter(theEnv,WDISPLAY,"\n");
     }

  }
Beispiel #5
0
globle void PrimitiveTablesInfo(
  void *theEnv)
  {
   unsigned long i;
   SYMBOL_HN **symbolArray, *symbolPtr;
   FLOAT_HN **floatArray, *floatPtr;
   INTEGER_HN **integerArray, *integerPtr;
   BITMAP_HN **bitMapArray, *bitMapPtr;
   unsigned long int symbolCount = 0, integerCount = 0;
   unsigned long int floatCount = 0, bitMapCount = 0;

   EnvArgCountCheck(theEnv,"primitives-info",EXACTLY,0);

   /*====================================*/
   /* Count entries in the symbol table. */
   /*====================================*/

   symbolArray = GetSymbolTable(theEnv);
   for (i = 0; i < SYMBOL_HASH_SIZE; i++)
     {
      for (symbolPtr = symbolArray[i]; symbolPtr != NULL; symbolPtr = symbolPtr->next)
        { symbolCount++; }
     }

   /*====================================*/
   /* Count entries in the integer table. */
   /*====================================*/

   integerArray = GetIntegerTable(theEnv);
   for (i = 0; i < INTEGER_HASH_SIZE; i++)
     {
      for (integerPtr = integerArray[i]; integerPtr != NULL; integerPtr = integerPtr->next)
        { integerCount++; }
     }

   /*====================================*/
   /* Count entries in the float table. */
   /*====================================*/

   floatArray = GetFloatTable(theEnv);
   for (i = 0; i < FLOAT_HASH_SIZE; i++)
     {
      for (floatPtr = floatArray[i]; floatPtr != NULL; floatPtr = floatPtr->next)
        { floatCount++; }
     }

   /*====================================*/
   /* Count entries in the bitmap table. */
   /*====================================*/

   bitMapArray = GetBitMapTable(theEnv);
   for (i = 0; i < BITMAP_HASH_SIZE; i++)
     {
      for (bitMapPtr = bitMapArray[i]; bitMapPtr != NULL; bitMapPtr = bitMapPtr->next)
        { bitMapCount++; }
     }

   /*========================*/
   /* Print the information. */
   /*========================*/

   EnvPrintRouter(theEnv,WDISPLAY,"Symbols: ");
   PrintLongInteger(theEnv,WDISPLAY,(long) symbolCount);
   EnvPrintRouter(theEnv,WDISPLAY,"\n");
   EnvPrintRouter(theEnv,WDISPLAY,"Integers: ");
   PrintLongInteger(theEnv,WDISPLAY,(long) integerCount);
   EnvPrintRouter(theEnv,WDISPLAY,"\n");
   EnvPrintRouter(theEnv,WDISPLAY,"Floats: ");
   PrintLongInteger(theEnv,WDISPLAY,(long) floatCount);
   EnvPrintRouter(theEnv,WDISPLAY,"\n");
   EnvPrintRouter(theEnv,WDISPLAY,"BitMaps: ");
   PrintLongInteger(theEnv,WDISPLAY,(long) bitMapCount);
   EnvPrintRouter(theEnv,WDISPLAY,"\n");
   //EnvPrintRouter(theEnv,WDISPLAY,"Ephemerals: ");
   //PrintLongInteger(theEnv,WDISPLAY,(long) EphemeralSymbolCount());
   //EnvPrintRouter(theEnv,WDISPLAY,"\n");
  }
Beispiel #6
0
globle void InitAtomicValueNeededFlags(
  void *theEnv)
  {
   unsigned long i;
   SYMBOL_HN *symbolPtr, **symbolArray;
   FLOAT_HN *floatPtr, **floatArray;
   INTEGER_HN *integerPtr, **integerArray;
   BITMAP_HN *bitMapPtr, **bitMapArray;

   /*===============*/
   /* Mark symbols. */
   /*===============*/

   symbolArray = GetSymbolTable(theEnv);

   for (i = 0; i < SYMBOL_HASH_SIZE; i++)
     {
      symbolPtr = symbolArray[i];
      while (symbolPtr != NULL)
        {
         symbolPtr->neededSymbol = FALSE;
         symbolPtr = symbolPtr->next;
        }
     }

   /*==============*/
   /* Mark floats. */
   /*==============*/

   floatArray = GetFloatTable(theEnv);

   for (i = 0; i < FLOAT_HASH_SIZE; i++)
     {
      floatPtr = floatArray[i];
      while (floatPtr != NULL)
        {
         floatPtr->neededFloat = FALSE;
         floatPtr = floatPtr->next;
        }
     }

   /*================*/
   /* Mark integers. */
   /*================*/

   integerArray = GetIntegerTable(theEnv);

   for (i = 0; i < INTEGER_HASH_SIZE; i++)
     {
      integerPtr = integerArray[i];
      while (integerPtr != NULL)
        {
         integerPtr->neededInteger = FALSE;
         integerPtr = integerPtr->next;
        }
     }

   /*===============*/
   /* Mark bitmaps. */
   /*===============*/

   bitMapArray = GetBitMapTable(theEnv);

   for (i = 0; i < BITMAP_HASH_SIZE; i++)
     {
      bitMapPtr = bitMapArray[i];
      while (bitMapPtr != NULL)
        {
         bitMapPtr->neededBitMap = FALSE;
         bitMapPtr = bitMapPtr->next;
        }
     }
  }
Beispiel #7
0
static int SymbolHashNodesToCode(
    char *fileName,
    int version)
{
    int i, j;
    struct symbolHashNode *hashPtr;
    int count;
    int numberOfEntries;
    struct symbolHashNode **symbolTable;
    int newHeader = TRUE;
    int arrayVersion = 1;
    FILE *fp;

    /*====================================*/
    /* Count the total number of entries. */
    /*====================================*/

    symbolTable = GetSymbolTable();
    count = numberOfEntries = 0;

    for (i = 0; i < SYMBOL_HASH_SIZE; i++)
    {
        for (hashPtr = symbolTable[i];
                hashPtr != NULL;
                hashPtr = hashPtr->next)
        {
            numberOfEntries++;
        }
    }

    if (numberOfEntries == 0) return(version);

    for (i = 1; i <= (numberOfEntries / MaxIndices) + 1 ; i++)
    {
        fprintf(HeaderFP,"extern struct symbolHashNode S%d_%d[];\n",ImageID,i);
    }

    /*==================*/
    /* Create the file. */
    /*==================*/

    if ((fp = NewCFile(fileName,1,version,FALSE)) == NULL) return(-1);

    /*===================*/
    /* List the entries. */
    /*===================*/

    j = 0;

    for (i = 0; i < SYMBOL_HASH_SIZE; i++)
    {
        for (hashPtr = symbolTable[i];
                hashPtr != NULL;
                hashPtr = hashPtr->next)
        {
            if (newHeader)
            {
                fprintf(fp,"struct symbolHashNode S%d_%d[] = {\n",ImageID,arrayVersion);
                newHeader = FALSE;
            }

            if (hashPtr->next == NULL)
            {
                fprintf(fp,"{NULL,");
            }
            else
            {
                if ((j + 1) >= MaxIndices)
                {
                    fprintf(fp,"{&S%d_%d[%d],",ImageID,arrayVersion + 1,0);
                }
                else
                {
                    fprintf(fp,"{&S%d_%d[%d],",ImageID,arrayVersion,j + 1);
                }
            }

            fprintf(fp,"%ld,0,0,0,%d,",hashPtr->count + 1,i);
            PrintCString(fp,hashPtr->contents);

            count++;
            j++;

            if ((count == numberOfEntries) || (j >= MaxIndices))
            {
                fprintf(fp,"}};\n");
                fclose(fp);
                j = 0;
                arrayVersion++;
                version++;
                if (count < numberOfEntries)
                {
                    if ((fp = NewCFile(fileName,1,version,FALSE)) == NULL) return(0);
                    newHeader = TRUE;
                }
            }
            else
            {
                fprintf(fp,"},\n");
            }
        }
    }

    return(version);
}
Beispiel #8
0
static int HashTablesToCode(
    char *fileName)
{
    int i;
    FILE *fp;
    struct symbolHashNode **symbolTable;
    struct floatHashNode **floatTable;
    struct integerHashNode **integerTable;
    struct bitMapHashNode **bitMapTable;
#if FUZZY_DEFTEMPLATES
    struct fuzzyValueHashNode **fuzzyValueTable;
#endif

    /*======================================*/
    /* Write the code for the symbol table. */
    /*======================================*/

    symbolTable = GetSymbolTable();

    if ((fp = NewCFile(fileName,1,1,FALSE)) == NULL) return(0);

    fprintf(HeaderFP,"extern struct symbolHashNode *sht%d[];\n",ImageID);
    fprintf(fp,"struct symbolHashNode *sht%d[%d] = {\n",ImageID,SYMBOL_HASH_SIZE);

    for (i = 0; i < SYMBOL_HASH_SIZE; i++)
    {
        PrintSymbolReference(fp,symbolTable[i]);

        if (i + 1 != SYMBOL_HASH_SIZE) fprintf(fp,",\n");
    }

    fprintf(fp,"};\n");

    fclose(fp);

    /*=====================================*/
    /* Write the code for the float table. */
    /*=====================================*/

    floatTable = GetFloatTable();

    if ((fp = NewCFile(fileName,1,2,FALSE)) == NULL) return(0);

    fprintf(HeaderFP,"extern struct floatHashNode *fht%d[];\n",ImageID);
    fprintf(fp,"struct floatHashNode *fht%d[%d] = {\n",ImageID,FLOAT_HASH_SIZE);

    for (i = 0; i < FLOAT_HASH_SIZE; i++)
    {
        if (floatTable[i] == NULL) {
            fprintf(fp,"NULL");
        }
        else PrintFloatReference(fp,floatTable[i]);

        if (i + 1 != FLOAT_HASH_SIZE) fprintf(fp,",\n");
    }

    fprintf(fp,"};\n");

    fclose(fp);

    /*=======================================*/
    /* Write the code for the integer table. */
    /*=======================================*/

    integerTable = GetIntegerTable();

    if ((fp = NewCFile(fileName,1,3,FALSE)) == NULL) return(0);

    fprintf(HeaderFP,"extern struct integerHashNode *iht%d[];\n",ImageID);
    fprintf(fp,"struct integerHashNode *iht%d[%d] = {\n",ImageID,INTEGER_HASH_SIZE);

    for (i = 0; i < INTEGER_HASH_SIZE; i++)
    {
        if (integerTable[i] == NULL) {
            fprintf(fp,"NULL");
        }
        else PrintIntegerReference(fp,integerTable[i]);

        if (i + 1 != INTEGER_HASH_SIZE) fprintf(fp,",\n");
    }

    fprintf(fp,"};\n");

    fclose(fp);

    /*======================================*/
    /* Write the code for the bitmap table. */
    /*======================================*/

    bitMapTable = GetBitMapTable();

    if ((fp = NewCFile(fileName,1,4,FALSE)) == NULL) return(0);

    fprintf(HeaderFP,"extern struct bitMapHashNode *bmht%d[];\n",ImageID);
    fprintf(fp,"struct bitMapHashNode *bmht%d[%d] = {\n",ImageID,BITMAP_HASH_SIZE);

    for (i = 0; i < BITMAP_HASH_SIZE; i++)
    {
        PrintBitMapReference(fp,bitMapTable[i]);

        if (i + 1 != BITMAP_HASH_SIZE) fprintf(fp,",\n");
    }

    fprintf(fp,"};\n");

    fclose(fp);

#if FUZZY_DEFTEMPLATES

    /*=============================*/
    /* Dump the fuzzy value table. */
    /*=============================*/

    fuzzyValueTable = GetFuzzyValueTable();

    if ((fp = NewCFile(fileName,1,5,FALSE)) == NULL) return(0);

    fprintf(HeaderFP,"extern struct fuzzyValueHashNode *fvht%d[];\n",ImageID);
    fprintf(fp,"struct fuzzyValueHashNode *fvht%d[%d] = {\n",ImageID,FUZZY_VALUE_HASH_SIZE);

    for (i = 0; i < FUZZY_VALUE_HASH_SIZE; i++)
    {
        PrintFuzzyValueReference(fp,fuzzyValueTable[i]);

        if (i + 1 != FUZZY_VALUE_HASH_SIZE) fprintf(fp,",\n");
    }

    fprintf(fp,"};\n");

    fclose(fp);

#endif /* FUZZY_DEFTEMPLATES */

    return(1);
}