OSDN Git Service

596fdb59945b63642ac9449f40c9672ad266ae3e
[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:4135) // conversion between different integral types
28   #pragma warning(disable:4127) // conditional expression is constant
29 #endif
30
31 #include <stdarg.h>
32 #include <setjmp.h>
33 #include <time.h>
34 #include <signal.h>
35
36 #include <kpathsea/c-auto.h>
37 #include <kpathsea/c-std.h>
38 #include <kpathsea/c-pathmx.h>
39 #include <kpathsea/c-fopen.h>
40 #include <kpathsea/c-ctype.h>
41 #include <kpathsea/c-proto.h>
42 #include <kpathsea/config.h>
43 #include <kpathsea/getopt.h>
44 #include <kpathsea/lib.h>
45 #include <kpathsea/line.h>
46 #include <kpathsea/readable.h>
47 #include <kpathsea/types.h>
48 #include <kpathsea/tex-file.h>
49 #include <kpathsea/variable.h>
50 #include <kpathsea/absolute.h>
51 #ifdef _WIN32
52   #include <kpathsea/win32lib.h>
53 #else
54   #include <unistd.h>
55 #endif
56 #include "zlib.h"
57 #include "md5.h"
58
59 typedef long long integer;
60 typedef double    glue_ratio;
61 typedef double    real;
62 typedef FILE * alpha_file;
63 typedef FILE * byte_file;
64 typedef FILE * word_file;
65 typedef unsigned char  ASCII_code;
66 typedef unsigned short KANJI_code;
67 typedef unsigned char  eight_bits;
68 typedef unsigned short sixteen_bits;
69 typedef integer pool_pointer;
70 typedef integer str_number;
71 typedef unsigned char packed_ASCII_code;
72 typedef integer scaled;
73 typedef integer nonnegative_integer;
74 typedef unsigned char small_number;
75
76 typedef enum
77 {
78   TEXFORMATPATH,
79   TEXINPUTPATH,
80   TFMFILEPATH,
81 } path_constant_type;
82
83 #ifdef link
84   #undef link
85 #endif
86
87 #define abs(x)   ((integer)(x) >= 0 ? (integer)(x) : (integer)-(x))
88 #define chr(x)   (x)
89 #define ord(x)   (x)
90 #define odd(x)   ((x) % 2)
91 #define round(x) web2c_round((double) (x))
92 #define decr(x)  --(x)
93 #define incr(x)  ++(x)
94 #define fabs(x)  ((x) >= 0.0 ? (x) : -(x))
95 #define toint(x) ((integer) (x))
96
97 #define MAXLINE 256
98
99 extern integer web2c_round (double r);
100 extern boolean open_input  (FILE ** f, path_constant_type path_index, char * fopen_mode);
101 extern boolean open_output (FILE ** f, char * fopen_mode);
102 extern int check_fclose    (FILE * f);
103
104 #define show_line(str, flag) fputs(str, stdout)
105 #define show_char(chr)       putc(chr, stdout)
106 extern char log_line[];
107
108 #endif