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 #pragma warning(disable:4201)
24 #pragma warning(disable:4996)
25 #pragma warning(disable:4701)
26 //#pragma warning(disable:4100)
27 //#pragma warning(disable:4244)
28 #pragma warning(disable:4131) // old style declarator
29 #pragma warning(disable:4135) // conversion between different integral types
30 #pragma warning(disable:4127) // conditional expression is constant
32 /* ``Standard'' headers. */
33 #include <kpathsea/c-auto.h>
34 #include <kpathsea/c-std.h>
35 #include <kpathsea/c-pathmx.h>
36 #include <kpathsea/c-fopen.h>
37 #include <kpathsea/c-ctype.h>
38 #include <kpathsea/c-proto.h>
39 #include <kpathsea/config.h>
40 #include <kpathsea/getopt.h>
41 #include <kpathsea/lib.h>
42 #include <kpathsea/line.h>
43 #include <kpathsea/readable.h>
44 #include <kpathsea/types.h>
45 #include <kpathsea/tex-file.h>
46 #include <kpathsea/variable.h>
47 #include <kpathsea/absolute.h>
48 #include <ptexenc/ptexenc.h>
54 #include <kpathsea/win32lib.h>
61 #include "hpdf_utils.h"
63 typedef long long integer;
64 typedef double glue_ratio;
66 typedef FILE * alpha_file;
67 typedef FILE * byte_file;
68 typedef FILE * word_file;
69 typedef unsigned char ASCII_code;
70 typedef unsigned short KANJI_code;
71 typedef unsigned char eight_bits;
72 typedef unsigned short sixteen_bits;
73 typedef integer pool_pointer;
74 typedef integer str_number;
75 typedef unsigned char packed_ASCII_code;
76 typedef integer scaled;
77 typedef integer nonnegative_integer;
78 typedef char small_number;
92 #define abs(x) ((integer)(x) >= 0 ? (integer)(x) : (integer)-(x))
95 #define odd(x) ((x) % 2)
96 #define round(x) zround((double) (x))
99 #define fabs(x) ((x) >= 0.0 ? (x) : -(x))
100 #define toint(x) ((integer) (x))
101 #define a_open_in(f, p) open_input (&(f), p, FOPEN_R_MODE)
102 #define a_open_out(f) open_output (&(f), FOPEN_W_MODE)
103 #define a_close(f) check_fclose (f)
105 #define Hi(x) (((x) >> 8) & 0xff)
106 #define Lo(x) ((x) & 0xff)
110 extern integer zround (double);
111 extern boolean eoln (FILE * file);
112 extern boolean open_input (FILE **f, path_constant_type path_index, char *fopen_mode);
113 extern boolean open_output (FILE **f, char *fopen_mode);
114 extern int check_fclose (FILE * f);
116 #define show_line(str,flag) fputs(str,stdout)
117 #define show_char(chr) putc(chr, stdout)
118 extern char log_line[];