Back to index

tetex-bin  3.0
Defines | Functions | Variables
aleph.c File Reference
#include "alephd.h"

Go to the source code of this file.

Defines

#define EXTERN   extern

Functions

void btestin (void)
int getfilemode P2C (FILE *, f, int, def)
int getc_two_LE P1C (FILE *, f)
void ungetc_two_LE P2C (int, c, FILE *, f)
boolean zpnewinputln ()
boolean newinputln P4C (FILE *, f, halfword, themode, halfword, translation, boolean, bypass)
boolean new_input_line P2C (FILE *, f, halfword, themode)
memoryword ziniteqtbentry ()
void inithhashtable P1H (void)
hashword *createeqtbpos P1C (int, p)
void odateandtime P4C (int, timecode, int, daycode, int, monthcode, int, yearcode)
void allocatefonttable P2C (int, font_number, int, font_size)
void dumpfonttable P2C (int, font_number, int, words)
void undumpfonttable (int font_number)
void allocatefontsorttable P2C (int, fontsort_number, int, fontsort_size)
void dumpfontsorttable P2C (int, fontsort_number, int, words)
void undumpfontsorttable (int fontsort_number)
void allocateocptable P2C (int, ocp_number, int, ocp_size)
void dumpocptable P1C (int, ocp_number)

Variables

hashword hashtable [HASHTABLESIZE]
memoryword ** fonttables
static int font_entries = 0
memoryword ** fontsorttables
static int fontsort_entries = 0
int ** ocptables
static int ocp_entries = 0

Define Documentation

#define EXTERN   extern

Definition at line 22 of file aleph.c.


Function Documentation

void btestin ( void  )

Definition at line 26 of file aleph.c.

{
    string fname =
    kpse_find_file (nameoffile + 1, kpse_program_binary_format, true);

    if (fname) {
      libcfree(nameoffile);
      nameoffile = xmalloc(2+strlen(fname));
      namelength = strlen(fname);
      strcpy(nameoffile+1, fname);
    }
    else {
      libcfree(nameoffile);
      nameoffile = xmalloc(2);
      namelength = 0;
      nameoffile[0] = 0;
      nameoffile[1] = 0;
    }
}
int getc_two_LE P1C ( FILE ,
f   
)

Definition at line 97 of file aleph.c.

{
    register int i,j;
    i = getc(f);
    if (i==EOF) { return i; }
    j = getc(f);
    if (j==EOF) { return j; }
    return ((j<<8)|i);
}
hashword *createhashpos P1C ( int  ,
p   
)

Definition at line 209 of file aleph.c.

{
   hashword *runner= &(hashtable[p%HASHTABLESIZE]);
   if (runner->p==p) return runner;
   while (runner->p != -1) {
      runner = runner->ptr; 
      if (runner->p == p) return runner;
   } 
   runner->p = p;
   runner->mw = ziniteqtbentry(p);
   runner->ptr = (hashword *) xmalloc(sizeof(hashword));
   (runner->ptr)->p = -1;
   return runner;
}

Here is the call graph for this function:

void undumpocptable P1C ( int  ,
ocp_number   
)

Definition at line 459 of file aleph.c.

{
    dumpthings(ocptables[ocp_number][0], ocptables[ocp_number][0]+1);
}
void inithhashtable P1H ( void  ) [read]

Definition at line 199 of file aleph.c.

{
   int i;
   for (i=0; i<HASHTABLESIZE; i++) {
      hashtable[i].p = -1;
   }
      
}
int getfilemode P2C ( FILE ,
f  ,
int  ,
def   
)

Definition at line 47 of file aleph.c.

{
    int c,m;
    if ((def==0)||(feof(f))) m=0;
    else {
       c = getc(f);
       if (c==EOF) m=0;
       else if (c==0x5c) {
          if (feof(f)) m=0;
          else {
             c = getc(f);
             if (c==EOF) m=0;
             else if (c==0) m=4;
             else m=1;
             ungetc(c,f);
             c=0x5c;
          }
       }
       else if (c==0x25) {
          if (feof(f)) m=0;
          else {
             c = getc(f);
             if (c==EOF) m=0;
             else if (c==0) m=4;
             else m=1;
             ungetc(c,f);
             c=0x25;
          }
       }
       else if (c==0xe0) m=2;
       else if (c==0x6c) m=2;
       else if (c==0) {
          if (feof(f)) m=0;
          else {
             c = getc(f);
             if (c==EOF) m=0;
             else if (c==0x5c) m=3;
             else if (c==0x25) m=3;
             else m=def;
             ungetc(c,f);
             c=0;
          }
       }
       else m=def;
       ungetc(c,f);
    }
    return m;
}
void ungetc_UTF16LE P2C ( int  ,
c  ,
FILE ,
f   
)

Definition at line 108 of file aleph.c.

{
    ungetc((c>>8), f);
    ungetc((c&0377), f);
}
boolean new_input_line P2C ( FILE ,
f  ,
halfword  ,
themode   
)

Definition at line 144 of file aleph.c.

{
  register int i=EOF;
 
  last = first;
  otpinputend = 0;
 
  if (themode==1) {
     while ((otpinputend < ocpbufsize) && ((i = getc (f)) != EOF) &&
            ((i != '\r') && (i != '\n')))
        otpinputbuf[++otpinputend] = i;
     if (i=='\r') {
         i=getc(f); if (i != '\n') ungetc(i,f);
     }
  } else if (themode==2) {
     while ((otpinputend < ocpbufsize) && ((i = getc (f)) != EOF) &&
            (i != 0x25))
        otpinputbuf[++otpinputend] = i;
  } else if (themode==3) {
     while ((otpinputend < ocpbufsize) && ((i = getc_two (f)) != EOF) &&
            ((i != '\r') && (i != '\n')))
        otpinputbuf[++otpinputend] = i;
     if (i=='\r') {
         i=getc_two(f); if (i != '\n') ungetc_two(i,f);
     }
  } else /* themode==4 */ {
     while ((otpinputend < ocpbufsize) && ((i = getc_two_LE (f)) != EOF) &&
            ((i != '\r') && (i != '\n')))
        otpinputbuf[++otpinputend] = i;
     if (i=='\r') {
         i=getc_two_LE(f); if (i != '\n') ungetc_two_LE(i,f);
     }
  }
 
  if (i == EOF && otpinputend == 0)
      return false;
 
  /* We didn't get the whole line because our buffer was too small.
*/
 if (i != EOF && (((themode!=2) && (i != '\n')) || ((themode==2) && (i != 0x25))))
    {
      (void) fprintf (stderr,
                     "! Unable to read an entire line---ocp_buf_size=%ld.\n",ocpbufsize);
      (void) fprintf (stderr, "Please increase ocp_buf_size in texmf.cnf.\n");
      uexit (1);
    }
 
    return true;
}

Here is the call graph for this function:

void allocatefonttable P2C ( int  ,
font_number  ,
int  ,
font_size   
)

Definition at line 337 of file aleph.c.

{
    int i;
    if (font_entries==0) {
      fonttables = (memoryword **) xmalloc(256*sizeof(memoryword**));
      font_entries=256;
    } else if ((font_number==256)&&(font_entries==256)) {
      fonttables = xrealloc(fonttables, 65536);
      font_entries=65536;
    }
    fonttables[font_number] =
       (memoryword *) xmalloc((font_size+1)*sizeof(memoryword));
    fonttables[font_number][0].cint = font_size;
    fonttables[font_number][0].cint1 = 0;
    for (i=1; i<=font_size; i++) {
        fonttables[font_number][i].cint  = 0;
        fonttables[font_number][i].cint1 = 0;
    }
}

Here is the call graph for this function:

void dumpfonttable P2C ( int  ,
font_number  ,
int  ,
words   
)

Definition at line 358 of file aleph.c.

{
    fonttables[font_number][0].cint=words;
    dumpthings(fonttables[font_number][0], fonttables[font_number][0].cint+1);
}
void allocatefontsorttable P2C ( int  ,
fontsort_number  ,
int  ,
fontsort_size   
)

Definition at line 388 of file aleph.c.

{
    int i;
    if (fontsort_entries==0) {
      fontsorttables = (memoryword **) xmalloc(256*sizeof(memoryword**));
      fontsort_entries=256;
    } else if ((fontsort_number==256)&&(fontsort_entries==256)) {
      fontsorttables = xrealloc(fontsorttables, 65536);
      fontsort_entries=65536;
    }
    fontsorttables[fontsort_number] =
       (memoryword *) xmalloc((fontsort_size+1)*sizeof(memoryword));
    fontsorttables[fontsort_number][0].cint = fontsort_size;
    fontsorttables[fontsort_number][0].cint1 = 0;
    for (i=1; i<=fontsort_size; i++) {
        fontsorttables[fontsort_number][i].cint  = 0;
        fontsorttables[fontsort_number][i].cint1 = 0;
    }
}

Here is the call graph for this function:

void dumpfontsorttable P2C ( int  ,
fontsort_number  ,
int  ,
words   
)

Definition at line 409 of file aleph.c.

{
    fontsorttables[fontsort_number][0].cint=words;
    dumpthings(fontsorttables[fontsort_number][0],
               fontsorttables[fontsort_number][0].cint+1);
}
void allocateocptable P2C ( int  ,
ocp_number  ,
int  ,
ocp_size   
)

Definition at line 440 of file aleph.c.

{
    int i;
    if (ocp_entries==0) {
      ocptables = (int **) xmalloc(256*sizeof(int**));
      ocp_entries=256;
    } else if ((ocp_number==256)&&(ocp_entries==256)) {
      ocptables = xrealloc(ocptables, 65536);
      ocp_entries=65536;
    }
    ocptables[ocp_number] =
       (int *) xmalloc((1+ocp_size)*sizeof(int));
    ocptables[ocp_number][0] = ocp_size;
    for (i=1; i<=ocp_size; i++) {
        ocptables[ocp_number][i]  = 0;
    }
}

Here is the call graph for this function:

boolean newinputln P4C ( FILE ,
f  ,
halfword  ,
themode  ,
halfword  ,
translation  ,
boolean  ,
bypass   
)

Definition at line 135 of file aleph.c.

{
    return zpnewinputln((alphafile)f,
                        (halfword)themode,
                        (halfword)translation,
                        (boolean) bypass);
}

Here is the call graph for this function:

void odateandtime P4C ( int  ,
timecode  ,
int  ,
daycode  ,
int  ,
monthcode  ,
int  ,
yearcode   
)

Definition at line 323 of file aleph.c.

{
    integer tc,dc,mc,yc;
    dateandtime(tc,dc,mc,yc);
    setneweqtbint(timecode,tc);
    setneweqtbint(daycode,dc);
    setneweqtbint(monthcode,mc);
    setneweqtbint(yearcode,yc);
}
void undumpfontsorttable ( int  fontsort_number)

Definition at line 417 of file aleph.c.

{
    memoryword sizeword;
    if (fontsort_entries==0) {
      fontsorttables = (memoryword **) xmalloc(256*sizeof(memoryword**));
      fontsort_entries=256;
    } else if ((fontsort_number==256)&&(fontsort_entries==256)) {
      fontsorttables = xrealloc(fontsorttables, 65536);
      fontsort_entries=65536;
    }

    undumpthings(sizeword,1);
    fontsorttables[fontsort_number] =
        (memoryword *) xmalloc((sizeword.cint+1)*sizeof(memoryword));
    fontsorttables[fontsort_number][0].cint = sizeword.cint;
    undumpthings(fontsorttables[fontsort_number][1], sizeword.cint);
}

Here is the call graph for this function:

void undumpfonttable ( int  font_number)

Definition at line 365 of file aleph.c.

{
    memoryword sizeword;
    if (font_entries==0) {
      fonttables = (memoryword **) xmalloc(256*sizeof(memoryword**));
      font_entries=256;
    } else if ((font_number==256)&&(font_entries==256)) {
      fonttables = xrealloc(fonttables, 65536);
      font_entries=65536;
    }

    undumpthings(sizeword,1);
    fonttables[font_number] =
        (memoryword *) xmalloc((sizeword.cint+1)*sizeof(memoryword));
    fonttables[font_number][0].cint = sizeword.cint;
    undumpthings(fonttables[font_number][1], sizeword.cint);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:


Variable Documentation

int font_entries = 0 [static]

Definition at line 334 of file aleph.c.

int fontsort_entries = 0 [static]

Definition at line 385 of file aleph.c.

Definition at line 384 of file aleph.c.

Definition at line 333 of file aleph.c.

Definition at line 196 of file aleph.c.

int ocp_entries = 0 [static]

Definition at line 437 of file aleph.c.

Definition at line 436 of file aleph.c.