Comparing files dic_comm.c and C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
***** dic_comm.c
*                                                        Copyright (c)
*         c Digital Equipment Corporation 1998. All rights reserved.
*
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
*                                                        Copyright (c)
*         c Digital Equipment Corporation 1996. All rights reserved.
*
*****

***** dic_comm.c
*                                                the default is MSDOS
* 002 JAW   30-Jan-1998  Vastly increased performance by doing loading/sorting of dictionary
*                        entries in memory instead of on hard drive.  ifdef'd out old/unused
*                        code, cleaned up screen output, and added comments.  Added quiet mode
*                        (only displays status when an action has completed), controllable by the
*                        /q switch.
*/
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
*                                                the default is MSDOS
*/
*****

***** dic_comm.c

/* dictionary entry */
#pragma pack (1)
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C

#pragma pack (1)
*****

***** dic_comm.c
#endif
        unsigned char gr_ph[256]; /* grapheme and phoneme separated by a null character */
};
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
#endif
        unsigned char gr_ph[256];
};
*****

***** dic_comm.c

struct d_ent entry_array[50000];
U32 entry_cnt;

#ifdef OLD_CODE
U32 _huge *disk_entries;
#endif
U32 _huge  *links;
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C

U32 _huge *disk_entries;
U32 _huge  *links;
*****

***** dic_comm.c
long linenumber=0;      /* the linenumber for output purposes */
#ifdef OLD_CODE
FILE *tfp;
#endif

int quietmode;

***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
long linenumber=0;      /* the linenumber for output purposes */
FILE *tfp;

*****

***** dic_comm.c
        unsigned char grapheme [50] = {'\0'}, * grapheme_index; 
#ifdef OLD_CODE
        char blanks[10];
#endif

        
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
        unsigned char grapheme [50] = {'\0'}, * grapheme_index; 
        char blanks[10];
        
        
*****

***** dic_comm.c
        unsigned char buff[1024];
#ifdef OLD_CODE
        unsigned long free_offset;
#endif
        long i,total_bytes;
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
        unsigned char buff[1024];
        unsigned long free_offset;
        long i,total_bytes;
*****

***** dic_comm.c
        short target=MSDOS_FORMAT;

        int ch_index; /* character index */
        unsigned int lcv; /* loop-control variable */

        /*
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
        short target=MSDOS_FORMAT;
        
        /*
*****

***** dic_comm.c
        {
                printf("DIC_COMM.C; main; Usage: dic infile outfile [options]\n");
                printf("options: /p:###     use entries with a priority <= ###\n");
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
        {
                printf("DIC_COMM.C; main; Useage: dic_comm infile outfile [options]\n");
                printf("options: /p:###     use entries with a priority <= ###\n");
*****

***** dic_comm.c
                printf("         /t:win32   build the dictionary for win32\n");
                printf("         /q         quiet mode\n");             
                exit(0);
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                printf("         /t:win32   build the dictionary for win32\n");
                
                exit(0);
*****

***** dic_comm.c
        }

#ifdef OLD_CODE
        /* moved halloc to beginning because opening large files first can leave 
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
        }
        
        /* moved halloc to beginning because opening large files first can leave 
*****

***** dic_comm.c
        */
#endif
        header.no_of_entries=50000; /*eab just tell it for now*/
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
        */
        header.no_of_entries=50000; /*eab just tell it for now*/
*****

***** dic_comm.c
        max_entries_in_memory = header.no_of_entries;
#ifdef OLD_CODE
/* DISK_ENTRIES are all the offsets of each input_entry that are in the TMPFILE*/
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
        max_entries_in_memory = header.no_of_entries;
/* DISK_ENTRIES are all the offsets of each input_entry that are in the TMPFILE*/
*****

***** dic_comm.c
                }
#endif
                
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                }
                
*****

***** dic_comm.c

#ifdef OLD_CODE
/*memset blanks is used to add memory to the input_entry stuct for when we write to BYTE alined system only. */                
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C

/*memset blanks is used to add memory to the input_entry stuct for when we write to BYTE alined system only. */                
*****

***** dic_comm.c

                        memset (blanks, 0, 10);
#endif
                        /* section added to support priorities and name exclusion 
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C

                        memset (blanks, 0, 10); 
                        /* section added to support priorities and name exclusion 
*****

***** dic_comm.c
                        oldformat=0;
                        excludenames=0;
                        quietmode=0;
                        os=NULL;
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                        oldformat=0;
                        excludenames=0;                 
                        os=NULL;
*****

***** dic_comm.c
                                                break;
                                        case 'Q':
                                        case 'q':
                                                quietmode=1;
                                                break;
                                        default:
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                                                break;
                                        default:
*****

***** dic_comm.c

#ifdef OLD_CODE
        /*tmpfile is where we put the entries to sort them them we write them to dic_<lang><lang>.dic */
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C

        /*tmpfile is where we put the entries to sort them them we write them to dic_<lang><lang>.dic */
*****

***** dic_comm.c
                        }
#endif


                        /*
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                        }
                        
                        
                        /*
*****

***** dic_comm.c
                        free_entry = 0L;
#ifdef OLD_CODE
                        free_offset = 0L;
#endif
                        total_bytes = 0L;
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                        free_entry = 0L;
                        free_offset = 0L;
                        total_bytes = 0L;
*****

***** dic_comm.c
                        header.no_of_entries=0;
                        printf("DIC_COMM; main; Building dictionary %s with %ld entries\n\n",os,header.no_of_entries);
                        
                        count = 1;
                        while(fgets(buff, sizeof(buff), infp) != NULL)
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                        header.no_of_entries=0;
                        printf("DIC_COMM; main; Building dictionary %s with %ld entries\n",os,header.no_of_entries);
                        
                        while(fgets(buff, sizeof(buff), infp) != NULL)
*****

***** dic_comm.c
                        {
                                if((count++ & 0xff) == 0 && !quietmode)
                                {
                                        printf("\r DIC_COMM; main;");
                                        printf(" Reading entry %d",count-1);
                                }

                                ++linenumber;
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                        {
                                ++linenumber;
*****

***** dic_comm.c
                                if (buff[0] == ';')
                                {
                                        count--;
                                        continue;
                                }

***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                                if (buff[0] == ';')
                                        continue;

*****

***** dic_comm.c
                                                header.no_of_entries--;  
                                                count--;
                                                continue;                       /* stop processing this element */
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                                                header.no_of_entries--;  
                                                continue;                       /* stop processing this element */
*****

***** dic_comm.c
                                
/************** add the entry into the array ..*****/
#ifdef OLD_CODE
/************** write the entry into the temp file and add the index in ..*****/
#endif
                                if (target==MSDOS_FORMAT)
                                        entry_array[entry_cnt++] = input_entry;
#ifdef OLD_CODE
                                        fwrite(&input_entry,input_entry.size,1,tfp);
#endif
                                else
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                                
/************** write the entry into the temp file and add the index in ..*****/
                                if (target==MSDOS_FORMAT)
                                        fwrite(&input_entry,input_entry.size,1,tfp);
                                else
*****

***** dic_comm.c
                                        }
                                        ch_index = input_entry.size - 4;
                                        k=input_entry.size;
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                                        }
                                        k=input_entry.size;
*****

***** dic_comm.c
                                        input_entry.size+=(k+2);
                                        entry_array[entry_cnt++] = input_entry;
                                        for (lcv = 0; lcv < k; lcv++)
                                                entry_array[entry_cnt].gr_ph[ch_index++] = ' ';
#ifdef OLD_CODE
                                        fwrite(&input_entry,input_entry.size-k,1,tfp);
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                                        input_entry.size+=(k+2);
                                        fwrite(&input_entry,input_entry.size-k,1,tfp);
*****

***** dic_comm.c
                                        fwrite(blanks,k,1,tfp);
#endif
                                }
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                                        fwrite(blanks,k,1,tfp);
                                }
*****

***** dic_comm.c
#endif
#ifdef OLD_CODE
/*remeber the offset if the file by saving it in disk_entires*/
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
#endif
/*remeber the offset if the file by saving it in disk_entires*/
*****

***** dic_comm.c
                                disk_entries[free_entry] = free_offset;
#endif
                                free_entry += 1;
#ifdef OLD_CODE
                                free_offset += input_entry.size;
#endif
                                total_bytes += input_entry.size;                
   }
   printf("\r DIC_COMM; main;");
   printf(" Reading entry %d\n",count-1);
   fclose(infp);
#ifdef OLD_CODE
   printf("\n                                              ");
#endif

   /*
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
                                disk_entries[free_entry] = free_offset;
                                free_entry += 1;
                                free_offset += input_entry.size;
                                total_bytes += input_entry.size;
   }
   fclose(infp);
   printf("\n                                              ");
   
   /*
*****

***** dic_comm.c
           {
                   if((count++ & 0xff) == 0 && !quietmode)
                   {
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
           {
                   if((count++ & 0xff) == 0)
                   {
*****

***** dic_comm.c
           {
                   if((count++ & 0xff) == 0 && !quietmode)
                   {
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
           {
                   if((count++ & 0xff) == 0)
                   {
*****

***** dic_comm.c
        {
                if(((count++) % 100) == 0 && !quietmode)
                {
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
        {
                if(((count++) % 100) == 0)
                {
*****

***** dic_comm.c
{
        *ent = entry_array[index];
#ifdef OLD_CODE
#ifdef DEBUG3
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
{
#ifdef DEBUG3
*****

***** dic_comm.c
        
        fseek(tfp,*(disk_entries+index),SEEK_SET); 
        fread(&(*ent).size,sizeof(ent->size),1,tfp);
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
        
        fseek(tfp,*(disk_entries+index),SEEK_SET);
        fread(&(*ent).size,sizeof(ent->size),1,tfp);
*****

***** dic_comm.c
#endif
#endif
}                                                                                               
***** C:\WINNT\PROFILES\JASONW\DESKTOP\NEWDIC\DTALKDIC\DIC_COMM.C
#endif
}                                                                                               
*****

