beta-0.89.2
[luatex.git] / source / texk / web2c / luatexdir / tex / conditional.h
blobb6abe7578d3ac6291254ba33423e88cc50c2632c
1 /* conditional.h
3 Copyright 2009 Taco Hoekwater <taco@luatex.org>
5 This file is part of LuaTeX.
7 LuaTeX is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2 of the License, or (at your
10 option) any later version.
12 LuaTeX is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License along
18 with LuaTeX; if not, see <http://www.gnu.org/licenses/>.
21 #ifndef CONDITIONAL_H
22 # define CONDITIONAL_H
24 # define unless_code 32 /* amount added for `\.{\\unless}' prefix */
26 typedef enum {
27 if_char_code = 0, /* \.{\\if} */
28 if_cat_code = 1, /* \.{\\ifcat} */
29 if_int_code = 2, /* \.{\\ifnum} */
30 if_dim_code = 3, /* \.{\\ifdim} */
31 if_odd_code = 4, /* \.{\\ifodd} */
32 if_vmode_code = 5, /* \.{\\ifvmode} */
33 if_hmode_code = 6, /* \.{\\ifhmode} */
34 if_mmode_code = 7, /* \.{\\ifmmode} */
35 if_inner_code = 8, /* \.{\\ifinner} */
36 if_void_code = 9, /* \.{\\ifvoid} */
37 if_hbox_code = 10, /* \.{\\ifhbox} */
38 if_vbox_code = 11, /* \.{\\ifvbox} */
39 ifx_code = 12, /* \.{\\ifx} */
40 if_eof_code = 13, /* \.{\\ifeof} */
41 if_true_code = 14, /* \.{\\iftrue} */
42 if_false_code = 15, /* \.{\\iffalse} */
43 if_case_code = 16, /* \.{\\ifcase} */
44 if_def_code = 17, /* \.{\\ifdefined} */
45 if_cs_code = 18, /* \.{\\ifcsname} */
46 if_font_char_code = 19, /* \.{\\iffontchar} */
47 if_in_csname_code = 20, /* \.{\\ifincsname} */
48 if_primitive_code = 21, /* \.{\\ifprimitive} */
49 if_abs_num_code = 22, /* \.{\\ifabsnum} */
50 if_abs_dim_code = 23, /* \.{\\ifabsdim} */
51 } if_type_codes;
53 # define if_limit_subtype(A) subtype((A)+1)
54 # define if_limit_type(A) type((A)+1)
55 # define if_line_field(A) vlink((A)+1)
57 typedef enum {
58 if_code = 1, /* \.{\\if...} */
59 fi_code = 2, /* \.{\\fi} */
60 else_code = 3, /* \.{\\else} */
61 or_code = 4, /* \.{\\or} */
62 } else_type_codes;
64 extern halfword cond_ptr; /* top of the condition stack */
65 extern int if_limit; /* upper bound on |fi_or_else| codes */
66 extern int cur_if; /* type of conditional being worked on */
67 extern int if_line; /* line where that conditional began */
68 extern int skip_line; /* skipping began here */
70 extern void pass_text(void);
71 extern void push_condition_stack(void);
72 extern void pop_condition_stack(void);
73 extern void change_if_limit(int l, halfword p);
75 extern void conditional(void);
77 #endif