File: texfiles.c

package info (click to toggle)
tetex-bin 3.0-30
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 54,960 kB
  • ctags: 34,640
  • sloc: ansic: 317,441; cpp: 41,854; sh: 22,369; perl: 17,643; makefile: 4,270; yacc: 2,187; awk: 1,126; lex: 932; pascal: 858; lisp: 571; sed: 423; asm: 139; csh: 47
file content (26 lines) | stat: -rw-r--r-- 487 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * File:    texfiles.c
 * Purpose: basic binary TeX reading functions
 * Version: 1.0 (Nov 1993)
 * Author:  Piet Tutelaers (derived from xdvi/pl16)
 */

#include <stdio.h>
#include "texfiles.h"

#define one(fp)		((unsigned char) getc(fp))

unsigned long num(FILE *fp, int size)
{  unsigned long x = 0;

   while (size--) x = (x << 8) | one(fp);
   return x;
}

integer snum(FILE *fp, int size)
{  integer x;

   x = getc(fp);
   while (--size) x = (x << 8) | one(fp);
   return x;
}