OSDN Git Service

29f141e0b41749f00fd19b967c673a9469e30c72
[putex/putex.git] / src / texsourc / yandytex.h
1 /* Copyright 2014 Clerk Ma
2
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.
7
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.
12
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
16    02110-1301 USA.  */
17
18 #ifndef _YANDYTEX_H
19 #define _YANDYTEX_H
20
21 #define WORDS_BIGENDIAN 0
22
23 #ifdef _WIN32
24   #pragma warning(disable:4201) // nameless struct/union
25   #pragma warning(disable:4996) // a function that was marked with deprecated
26   #pragma warning(disable:4701) // potentially uninitialized local variable 'name' used
27   #pragma warning(disable:4131) // old style declarator
28   #pragma warning(disable:4135) // conversion between different integral types
29   #pragma warning(disable:4127) // conditional expression is constant
30 #endif
31
32 #include <stdarg.h>
33 #include <setjmp.h>
34 #include <time.h>
35 #include <signal.h>
36
37 #include <kpathsea/c-auto.h>
38 #include <kpathsea/c-std.h>
39 #include <kpathsea/c-pathmx.h>
40 #include <kpathsea/c-fopen.h>
41 #include <kpathsea/c-ctype.h>
42 #include <kpathsea/c-proto.h>
43 #include <kpathsea/config.h>
44 #include <kpathsea/getopt.h>
45 #include <kpathsea/lib.h>
46 #include <kpathsea/line.h>
47 #include <kpathsea/readable.h>
48 #include <kpathsea/types.h>
49 #include <kpathsea/tex-file.h>
50 #include <kpathsea/variable.h>
51 #include <kpathsea/absolute.h>
52 #ifdef _WIN32
53   #include <kpathsea/win32lib.h>
54 #else
55   #include <unistd.h>
56 #endif
57 #include "zlib.h"
58 #include "md5.h"
59
60 typedef long long   integer;
61 typedef double      glue_ratio;
62 typedef double      real;
63 typedef FILE * alpha_file;
64 typedef FILE * byte_file;
65 typedef FILE * word_file;
66 typedef unsigned char  ASCII_code;
67 typedef unsigned short KANJI_code;
68 typedef unsigned char  eight_bits;
69 typedef unsigned short sixteen_bits;
70 typedef integer pool_pointer;
71 typedef integer str_number;
72 typedef unsigned char packed_ASCII_code;
73 typedef integer scaled;
74 typedef integer nonnegative_integer;
75 typedef char small_number;
76
77 typedef enum
78 {
79   NO_FILE_PATH = -1,
80   TEXFORMATPATH,
81   TEXINPUTPATH,
82   TFMFILEPATH,
83 } path_constant_type;
84
85 #ifdef link
86   #undef link
87 #endif
88
89 #define abs(x)   ((integer)(x) >= 0 ? (integer)(x) : (integer)-(x))
90 #define chr(x)   (x)
91 #define ord(x)   (x)
92 #define odd(x)   ((x) % 2)
93 #define round(x) zround((double) (x))
94 #define decr(x)  --(x)
95 #define incr(x)  ++(x)
96 #define fabs(x)  ((x) >= 0.0 ? (x) : -(x))
97 #define toint(x) ((integer) (x))
98 #define a_open_in(f, p) open_input (&(f), p, FOPEN_R_MODE)
99 #define a_open_out(f)   open_output (&(f), FOPEN_W_MODE)
100 #define a_close(f)          check_fclose (f)
101
102 #define MAXLINE 256
103
104 extern integer zround (double);
105 extern boolean eoln (FILE * file);
106 extern boolean open_input (FILE **f, path_constant_type path_index, char *fopen_mode);
107 extern boolean open_output (FILE **f, char *fopen_mode);
108 extern int check_fclose (FILE * f);
109
110 #define show_line(str,flag) fputs(str,stdout)
111 #define show_char(chr) putc(chr, stdout)
112 extern char log_line[];
113
114 #endif