1 /* luatex.h
2 
3    Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
4    Copyright 2006-2013 Taco Hoekwater <taco@luatex.org>
5 
6    This file is part of LuaTeX.
7 
8    LuaTeX is free software; you can redistribute it and/or modify it under
9    the terms of the GNU General Public License as published by the Free
10    Software Foundation; either version 2 of the License, or (at your
11    option) any later version.
12 
13    LuaTeX is distributed in the hope that it will be useful, but WITHOUT
14    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
16    License for more details.
17 
18    You should have received a copy of the GNU General Public License along
19    with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
20 
21 
22 #ifndef LUATEX_H
23 #  define LUATEX_H
24 
25 /* texmf.h: Main include file for TeX and Metafont in C. This file is
26    included by {tex,mf}d.h, which is the first include in the C files
27    output by web2c.  */
28 
29 #  include "cpascal.h"
30 
31 #  include <kpathsea/c-pathch.h>        /* for IS_DIR_SEP, used in the change files */
32 #  include <kpathsea/tex-make.h>        /* for kpse_make_tex_discard_errors */
33 
34 /* If we have these macros, use them, as they provide a better guide to
35    the endianess when cross-compiling. */
36 #  if defined (BYTE_ORDER) && defined (BIG_ENDIAN) && defined (LITTLE_ENDIAN)
37 #    ifdef WORDS_BIGENDIAN
38 #      undef WORDS_BIGENDIAN
39 #    endif
40 #    if BYTE_ORDER == BIG_ENDIAN
41 #      define WORDS_BIGENDIAN
42 #    endif
43 #  endif
44 /* More of the same, but now NeXT-specific. */
45 #  ifdef NeXT
46 #    ifdef WORDS_BIGENDIAN
47 #      undef WORDS_BIGENDIAN
48 #    endif
49 #    ifdef __BIG_ENDIAN__
50 #      define WORDS_BIGENDIAN
51 #    endif
52 #  endif
53 
54 
55 /* Some things are the same except for the name.  */
56 
57 #  define TEXMFPOOLNAME "luatex.pool"
58 #  define TEXMFENGINENAME "luatex"
59 
60 #  define DUMP_FILE fmt_file
61 #  define DUMP_FORMAT kpse_fmt_format
62 #  define write_dvi WRITE_OUT
63 #  define flush_dvi flush_out
64 #  define OUT_FILE dvi_file
65 #  define OUT_BUF dvi_buf
66 
67 /* Restore underscores.  */
68 #  define kpsetexformat kpse_tex_format
69 #  define t_open_in topenin
70 
71 /* Executing shell commands.  */
72 extern void mk_shellcmdlist(char *);
73 extern void init_shell_escape(void);
74 extern int shell_cmd_is_allowed(const char *cmd, char **safecmd,
75                                 char **cmdname);
76 extern int runsystem(const char *cmd);
77 
78 
79 #if defined(WIN32) && !defined(__MINGW32__) && defined(DLLPROC)
80 extern __declspec(dllexport) int DLLPROC (int ac, string *av);
81 #else
82 #undef DLLPROC
83 #endif
84 
85 #  ifndef GLUERATIO_TYPE
86 #    define GLUERATIO_TYPE double
87 #  endif
88 typedef GLUERATIO_TYPE glueratio;
89 
90 #  if defined(__DJGPP__) && defined (IPC)
91 #    undef IPC
92 #  endif
93 
94 #  ifdef IPC
95 extern void ipcpage(int);
96 #  endif                        /* IPC */
97 
98 
99 #  define flush_out() fflush (OUT_FILE)
100 
101 /* Read a line of input as quickly as possible.  */
102 #  define	input_ln(stream, flag) input_line (stream)
103 
104 extern boolean input_line(FILE *);
105 
106 #  define COPYRIGHT_HOLDER "Taco Hoekwater"
107 #  define AUTHOR NULL
108 #  define PROGRAM_HELP LUATEXHELP
109 #  define BUG_ADDRESS "dev-luatex@ntg.nl"
110 #  define DUMP_OPTION "fmt"
111 #  define DUMP_EXT ".fmt"
112 #  define INPUT_FORMAT kpse_tex_format
113 #  define INI_PROGRAM "luainitex"
114 #  define VIR_PROGRAM "luavirtex"
115 #  define TEXMFENGINENAME "luatex"
116 
117 /* this counteracts the macro definition in cpascal.h */
118 #  undef Xchr
119 #  define Xchr(a) a
120 
121 #endif
122