1 /* Copyright 2014 Clerk Ma
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #define WORDS_BIGENDIAN 0
23 /* ``Standard'' headers. */
24 #include <kpathsea/c-auto.h>
25 #include <kpathsea/c-std.h>
26 #include <kpathsea/c-pathmx.h>
27 #include <kpathsea/c-fopen.h>
28 #include <kpathsea/c-proto.h>
29 #include <kpathsea/getopt.h>
30 #include <kpathsea/lib.h>
31 #include <kpathsea/types.h>
35 typedef signed char schar;
37 typedef double glue_ratio;
38 typedef double glueratio;
40 typedef char * ccharpointer;
42 typedef FILE * file_ptr;
43 typedef FILE * alpha_file;
44 typedef unsigned char ASCII_code;
45 typedef unsigned short KANJI_code;
46 typedef unsigned char eight_bits;
47 typedef unsigned short sixteen_bits;
48 typedef integer pool_pointer;
49 typedef integer str_number;
50 typedef unsigned char packed_ASCII_code;
51 typedef integer scaled;
52 typedef integer nonnegative_integer;
53 typedef char small_number;
64 #define TEXFORMATPATHBIT (1 << TEXFORMATPATH)
65 #define TEXINPUTPATHBIT (1 << TEXINPUTPATH)
66 #define TFMFILEPATHBIT (1 << TFMFILEPATH)
72 #define abs(x) ((integer)(x) >= 0 ? (integer)(x) : (integer)-(x))
75 #define odd(x) ((x) % 2)
76 #define round(x) zround ((double) (x))
79 #define fabs(x) ((x) >= 0.0 ? (x) : -(x))
80 #define PATHMAX PATH_MAX
81 #define toint(x) ((integer) (x))
82 #define a_open_in(f,p) open_input (&(f), p, FOPEN_R_MODE)
83 #define a_open_out(f) open_output (&(f), FOPEN_W_MODE)
84 #define a_close(f) check_fclose (f)
86 extern bool trace_flag;
87 extern bool open_trace_flag;
89 extern integer zround (double);
90 extern bool test_eof (FILE * file);
91 extern bool eoln (FILE * file);
92 extern bool open_input (FILE **f, path_constant_type path_index, char *fopen_mode);
93 extern bool open_output (FILE **f, char *fopen_mode);
94 extern int check_fclose (FILE * f);
96 #define show_line(str,flag) fputs(str,stdout)
97 #define show_char(chr) putc(chr, stdout)
98 extern char log_line[];