[gforth] / gforth / Attic / main.c  

gforth: gforth/Attic/main.c

Diff for /gforth/Attic/main.c between version 1.24 and 1.25

version 1.24, Thu Feb 23 20:17:22 1995 UTC version 1.25, Tue Jul 25 15:28:07 1995 UTC
Line 43 
Line 43 
 /* image file format:  /* image file format:
  *   preamble (is skipped off), size multiple of 8   *   preamble (is skipped off), size multiple of 8
  *   magig: "gforth00" (means format version 0.0)   *   magig: "gforth00" (means format version 0.0)
    *   "gforth0x" means format 0.1,
    *              whereas x in 2 4 8 for big endian and 3 5 9 for little endian
    *              and x & -2 is the size of the cell in byte.
  *   size of image with stacks without tags (in bytes)   *   size of image with stacks without tags (in bytes)
  *   size of image without stacks and tags (in bytes)   *   size of image without stacks and tags (in bytes)
  *   size of data and FP stack (in bytes)   *   size of data and FP stack (in bytes)
Line 98 
Line 101 
   int wholesize;    int wholesize;
   int imagesize; /* everything needed by the image */    int imagesize; /* everything needed by the image */
   
     static char* endsize[10]=
       {
         "no size information", "",
         "16 bit big endian", "16 bit little endian",
         "32 bit big endian", "32 bit little endian",
         "n/n", "n/n",
         "64 bit big endian", "64 bit little endian",
       };
   
   do    do
     {      {
       if(fread(magic,sizeof(Char),8,imagefile) < 8) {        if(fread(magic,sizeof(Char),8,imagefile) < 8) {
         fprintf(stderr,"This file doesn't seem to be a gforth image\n");          fprintf(stderr,"This image doesn't seem to be a gforth image.\n");
         exit(1);          exit(1);
       }        }
 #ifdef DEBUG  #ifdef DEBUG
       printf("Magic found: %s\n",magic);        printf("Magic found: %s\n",magic);
 #endif  #endif
     }      }
   while(memcmp(magic,"gforth00",8));    while(memcmp(magic,"gforth0",7));
   
     if(!(magic[7]=='0' || magic[7] == sizeof(Cell) +
   #ifdef WORDS_BIGENDIAN
          '0'
   #else
          '1'
   #endif
          ))
       { fprintf(stderr,"This image is %s, whereas the machine is %s.\n",
                 endsize[magic[7]-'0'],
                 endsize[sizeof(Cell) +
   #ifdef WORDS_BIGENDIAN
                         0
   #else
                         1
   #endif
                         ]);
         exit(-2);
       };
   
   fread(header,sizeof(Cell),3,imagefile);    fread(header,sizeof(Cell),3,imagefile);
   if (dictsize==0)    if (dictsize==0)


Generate output suitable for use with a patch program
Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help