Back to index

tetex-bin  3.0
texfiles.c
Go to the documentation of this file.
00001 /*
00002  * File:    texfiles.c
00003  * Purpose: basic binary TeX reading functions
00004  * Version: 1.0 (Nov 1993)
00005  * Author:  Piet Tutelaers (derived from xdvi/pl16)
00006  */
00007 
00008 #include <stdio.h>
00009 #include "texfiles.h"
00010 
00011 #define one(fp)             ((unsigned char) getc(fp))
00012 
00013 unsigned long num(FILE *fp, int size)
00014 {  unsigned long x = 0;
00015 
00016    while (size--) x = (x << 8) | one(fp);
00017    return x;
00018 }
00019 
00020 integer snum(FILE *fp, int size)
00021 {  integer x;
00022 
00023    x = getc(fp);
00024    while (--size) x = (x << 8) | one(fp);
00025    return x;
00026 }