OSDN Git Service

7e57588fbda360d1634a95d2251c8e0b305ac9c4
[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 /* ``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>
32 #include "hpdf.h"
33 #include "avl.h"
34
35 typedef signed char schar;
36 typedef long        integer;
37 typedef double      glue_ratio;
38 typedef double      glueratio;
39 typedef boolean     bool;
40 typedef char *      ccharpointer;
41 typedef double      real;
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;
54
55 typedef enum
56 {
57   NO_FILE_PATH = -1,
58   TEXFORMATPATH,
59   TEXINPUTPATH,
60   TFMFILEPATH,
61   LAST_PATH
62 } path_constant_type;
63
64 #define TEXFORMATPATHBIT (1 << TEXFORMATPATH)
65 #define TEXINPUTPATHBIT  (1 << TEXINPUTPATH)
66 #define TFMFILEPATHBIT   (1 << TFMFILEPATH)
67
68 #ifdef link
69   #undef link
70 #endif
71
72 #define abs(x)   ((integer)(x) >= 0 ? (integer)(x) : (integer)-(x))
73 #define chr(x)   (x)
74 #define ord(x)   (x)
75 #define odd(x)   ((x) % 2)
76 #define round(x) zround ((double) (x))
77 #define decr(x)  --(x)
78 #define incr(x)  ++(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)
85
86 extern bool trace_flag;
87 extern bool open_trace_flag;
88
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);
95
96 #define show_line(str,flag) fputs(str,stdout)
97 #define show_char(chr) putc(chr, stdout)
98 extern char log_line[];
99
100 #endif