w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

t1asm.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
Include dependency graph for t1asm.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  command
 

Macros

#define LINESIZE   256
 
#define MAXBLOCKLEN   ((1L<<17)-6)
 
#define MINBLOCKLEN   ((1L<<8)-6)
 
#define MARKER   128
 
#define ASCII   1
 
#define BINARY   2
 
#define DONE   3
 

Typedefs

typedef int int32
 
typedef unsigned short uint16
 
typedef unsigned char byte
 

Functions

static byte eencrypt (byte plain)
 
static byte cencrypt (byte plain)
 
static void output_block ()
 
static void output_byte (byte b)
 
static void eexec_byte (byte b)
 
static void eexec_string (char *string)
 
static void eexec_start ()
 
static void eexec_end ()
 
static void file_end ()
 
static void t1asm_getline ()
 
static int command_compare (const void *key, const void *item)
 
static int is_integer (char *string)
 
static void charstring_start ()
 
static void charstring_byte (int v)
 
static void charstring_end ()
 
static void charstring_int (int num)
 
static void parse_charstring ()
 
static void usage ()
 
static void print_banner ()
 
int runt1asm (int pfbflag)
 

Variables

static char copyright []
 
FILEifp
 
FILEofp
 
static int pfb = 0
 
static int active = 0
 
static int start_charstring = 0
 
static int in_eexec = 0
 
static char line [256]
 
static int lenIV = 4
 
static char cs_start [10]
 
static byte charstring_buf [65535]
 
static bytecharstring_bp
 
static byte blockbuf [((1L<< 17) -6)]
 
static int32 blocklen = ((1L<<17)-6)
 
static int32 blockpos = -1
 
static int blocktyp = 1
 
static uint16 er
 
static uint16 cr
 
static uint16 c1 = 52845
 
static uint16 c2 = 22719
 
static struct command command_table []
 

Macro Definition Documentation

◆ ASCII

#define ASCII   1

Definition at line 81 of file t1asm.c.

◆ BINARY

#define BINARY   2

Definition at line 82 of file t1asm.c.

◆ DONE

#define DONE   3

Definition at line 83 of file t1asm.c.

◆ LINESIZE

#define LINESIZE   256

Definition at line 75 of file t1asm.c.

◆ MARKER

#define MARKER   128

Definition at line 80 of file t1asm.c.

◆ MAXBLOCKLEN

#define MAXBLOCKLEN   ((1L<<17)-6)

Definition at line 77 of file t1asm.c.

◆ MINBLOCKLEN

#define MINBLOCKLEN   ((1L<<8)-6)

Definition at line 78 of file t1asm.c.

Typedef Documentation

◆ byte

typedef unsigned char byte

Definition at line 85 of file t1asm.c.

◆ int32

typedef int int32

Definition at line 65 of file t1asm.c.

◆ uint16

typedef unsigned short uint16

Definition at line 70 of file t1asm.c.

Function Documentation

◆ cencrypt()

static byte cencrypt ( byte  plain)
static

Definition at line 161 of file t1asm.c.

References c1, c2, and cr.

Referenced by charstring_byte(), and charstring_start().

◆ charstring_byte()

static void charstring_byte ( int  v)
static

Definition at line 368 of file t1asm.c.

References b, cencrypt(), charstring_bp, charstring_buf, exit(), fprintf, and v.

Referenced by charstring_int(), and parse_charstring().

◆ charstring_end()

static void charstring_end ( void  )
static

Definition at line 383 of file t1asm.c.

References bp, charstring_bp, charstring_buf, cs_start, eexec_byte(), eexec_string(), and sprintf.

Referenced by parse_charstring().

◆ charstring_int()

static void charstring_int ( int  num)
static

Definition at line 397 of file t1asm.c.

References abs, charstring_byte(), exit(), fprintf, num, and cordic::x.

Referenced by parse_charstring().

◆ charstring_start()

static void charstring_start ( void  )
static

Definition at line 356 of file t1asm.c.

References cencrypt(), charstring_bp, charstring_buf, cr, i, and lenIV.

Referenced by parse_charstring().

◆ command_compare()

static int command_compare ( const void key,
const void item 
)
static

Definition at line 335 of file t1asm.c.

References item, key, name, and strcmp().

Referenced by parse_charstring().

◆ eencrypt()

static byte eencrypt ( byte  plain)
static

Definition at line 152 of file t1asm.c.

References c1, c2, and er.

Referenced by eexec_byte().

◆ eexec_byte()

static void eexec_byte ( byte  b)
static

Definition at line 228 of file t1asm.c.

References b, eencrypt(), in_eexec, and output_byte().

Referenced by charstring_end(), eexec_end(), eexec_start(), and eexec_string().

◆ eexec_end()

static void eexec_end ( void  )
static

Definition at line 269 of file t1asm.c.

References ASCII, blocktyp, eexec_byte(), eexec_string(), i, in_eexec, j, ofp, output_block(), and pfb.

Referenced by runt1asm().

◆ eexec_start()

static void eexec_start ( )
static

Definition at line 249 of file t1asm.c.

References BINARY, blocktyp, eexec_byte(), eexec_string(), er, in_eexec, output_block(), and pfb.

Referenced by runt1asm().

◆ eexec_string()

static void eexec_string ( char *  string)
static

Definition at line 239 of file t1asm.c.

References eexec_byte().

Referenced by charstring_end(), eexec_end(), eexec_start(), and runt1asm().

◆ file_end()

static void file_end ( )
static

Definition at line 294 of file t1asm.c.

References DONE, MARKER, ofp, output_block(), and pfb.

Referenced by remove_intermediates(), runt1asm(), and snap_deps().

◆ is_integer()

static int is_integer ( char *  string)
static

Definition at line 342 of file t1asm.c.

References isdigit.

Referenced by parse_charstring().

◆ output_block()

static void output_block ( )
static

Definition at line 172 of file t1asm.c.

References blockbuf, blockpos, i, and ofp.

Referenced by eexec_end(), eexec_start(), file_end(), and output_byte().

◆ output_byte()

static void output_byte ( byte  b)
static

Definition at line 194 of file t1asm.c.

References b, blockbuf, blocklen, blockpos, blocktyp, hexcol, in_eexec, MARKER, ofp, output_block(), and pfb.

Referenced by eexec_byte().

◆ parse_charstring()

◆ print_banner()

static void print_banner ( )
static

Definition at line 475 of file t1asm.c.

References fprintf, rcs_revision, revision(), and sscanf().

Referenced by main_body().

◆ runt1asm()

◆ t1asm_getline()

static void t1asm_getline ( )
static

Definition at line 308 of file t1asm.c.

References active, c, comment, EOF, fgetc, ifp, line, LINESIZE, p, and start_charstring.

Referenced by runt1asm().

◆ usage()

static void usage ( void  )
static

Definition at line 462 of file t1asm.c.

References exit(), and fprintf.

Variable Documentation

◆ active

int active = 0
static

Definition at line 93 of file t1asm.c.

Referenced by runt1asm(), and t1asm_getline().

◆ blockbuf

byte blockbuf[((1L<< 17) -6)]
static

Definition at line 108 of file t1asm.c.

Referenced by output_block(), and output_byte().

◆ blocklen

int32 blocklen = ((1L<<17)-6)
static

Definition at line 109 of file t1asm.c.

Referenced by output_byte().

◆ blockpos

int32 blockpos = -1
static

Definition at line 110 of file t1asm.c.

Referenced by output_block(), and output_byte().

◆ blocktyp

int blocktyp = 1
static

Definition at line 111 of file t1asm.c.

Referenced by eexec_end(), eexec_start(), and output_byte().

◆ c1

uint16 c1 = 52845
static

Definition at line 115 of file t1asm.c.

Referenced by cencrypt(), and eencrypt().

◆ c2

uint16 c2 = 22719
static

Definition at line 115 of file t1asm.c.

Referenced by cencrypt(), and eencrypt().

◆ charstring_bp

byte* charstring_bp
static

Definition at line 105 of file t1asm.c.

Referenced by charstring_byte(), charstring_end(), and charstring_start().

◆ charstring_buf

byte charstring_buf[65535]
static

Definition at line 104 of file t1asm.c.

Referenced by charstring_byte(), charstring_end(), and charstring_start().

◆ command_table

struct command command_table[]
static
Initial value:
= {
{ "callothersubr", 12, 16 },
{ "callsubr", 10, -1 },
{ "closepath", 9, -1 },
{ "div", 12, 12 },
{ "dotsection", 12, 0 },
{ "endchar", 14, -1 },
{ "hlineto", 6, -1 },
{ "hmoveto", 22, -1 },
{ "hsbw", 13, -1 },
{ "hstem", 1, -1 },
{ "hstem3", 12, 2 },
{ "hvcurveto", 31, -1 },
{ "pop", 12, 17 },
{ "return", 11, -1 },
{ "rlineto", 5, -1 },
{ "rmoveto", 21, -1 },
{ "rrcurveto", 8, -1 },
{ "sbw", 12, 7 },
{ "seac", 12, 6 },
{ "setcurrentpoint", 12, 33 },
{ "vhcurveto", 30, -1 },
{ "vlineto", 7, -1 },
{ "vmoveto", 4, -1 },
{ "vstem", 3, -1 },
{ "vstem3", 12, 1 },
}

Referenced by parse_charstring().

◆ copyright

char copyright[]
static
Initial value:
=
"@(#) Copyright (c) 1992 by I. Lee Hetherington, all rights reserved."

Definition at line 36 of file t1asm.c.

◆ cr

uint16 cr
static

Definition at line 114 of file t1asm.c.

Referenced by cencrypt(), and charstring_start().

◆ cs_start

char cs_start[10]
static

Definition at line 101 of file t1asm.c.

Referenced by charstring_end(), main(), and runt1asm().

◆ er

uint16 er
static

Definition at line 114 of file t1asm.c.

Referenced by eencrypt(), and eexec_start().

◆ ifp

◆ in_eexec

int in_eexec = 0
static

Definition at line 95 of file t1asm.c.

Referenced by eexec_byte(), eexec_end(), eexec_start(), and output_byte().

◆ lenIV

int lenIV = 4
static

Definition at line 100 of file t1asm.c.

Referenced by cencrypt(), charstring_start(), and runt1asm().

◆ line

char line[256]
static

Definition at line 97 of file t1asm.c.

Referenced by parse_charstring(), and t1asm_getline().

◆ ofp

◆ pfb

int pfb = 0
static

Definition at line 92 of file t1asm.c.

Referenced by eexec_end(), eexec_start(), file_end(), output_byte(), and runt1asm().

◆ start_charstring

int start_charstring = 0
static

Definition at line 94 of file t1asm.c.

Referenced by runt1asm(), and t1asm_getline().