beta-0.89.2
[luatex.git] / source / texk / web2c / luatexdir / tex / expand.h
blob18c0514e317aa1fe1b23bfe216a21cad99cb1d9f
1 /* expand.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 EXPAND_H
22 # define EXPAND_H
24 extern boolean is_in_csname;
25 extern void expand(void);
26 extern void complain_missing_csname(void);
27 extern void manufacture_csname(boolean use);
28 extern void inject_last_tested_cs(void);
29 extern void insert_relax(void);
30 extern void get_x_token(void);
31 extern void x_token(void);
33 # define top_mark_code 0 /* the mark in effect at the previous page break */
34 # define first_mark_code 1 /* the first mark between |top_mark| and |bot_mark| */
35 # define bot_mark_code 2 /* the mark in effect at the current page break */
36 # define split_first_mark_code 3
37 /* the first mark found by \.{\\vsplit} */
38 # define split_bot_mark_code 4 /* the last mark found by \.{\\vsplit} */
39 # define marks_code 5
41 # define top_mark(A) top_marks_array[(A)]
42 # define first_mark(A) first_marks_array[(A)]
43 # define bot_mark(A) bot_marks_array[(A)]
44 # define split_first_mark(A) split_first_marks_array[(A)]
45 # define split_bot_mark(A) split_bot_marks_array[(A)]
47 # define set_top_mark(A,B) top_mark(A)=(B)
48 # define set_first_mark(A,B) first_mark(A)=(B)
49 # define set_bot_mark(A,B) bot_mark(A)=(B)
50 # define set_split_first_mark(A,B) split_first_mark(A)=(B)
51 # define set_split_bot_mark(A,B) split_bot_mark(A)=(B)
53 # define delete_top_mark(A) do { \
54 if (top_mark(A)!=null) \
55 delete_token_ref(top_mark(A)); \
56 top_mark(A)=null; \
57 } while (0)
59 # define delete_bot_mark(A) do { \
60 if (bot_mark(A)!=null) \
61 delete_token_ref(bot_mark(A)); \
62 bot_mark(A)=null; \
63 } while (0)
65 # define delete_first_mark(A) do { \
66 if (first_mark(A)!=null) \
67 delete_token_ref(first_mark(A)); \
68 first_mark(A)=null; \
69 } while (0)
71 # define delete_split_first_mark(A) do { \
72 if (split_first_mark(A)!=null) \
73 delete_token_ref(split_first_mark(A)); \
74 split_first_mark(A)=null; \
75 } while (0)
77 # define delete_split_bot_mark(A) do { \
78 if (split_bot_mark(A)!=null) \
79 delete_token_ref(split_bot_mark(A)); \
80 split_bot_mark(A)=null; \
81 } while (0)
83 # define clear_marks_code 1
85 # define biggest_mark 65535
87 extern halfword top_marks_array[(biggest_mark + 1)];
88 extern halfword first_marks_array[(biggest_mark + 1)];
89 extern halfword bot_marks_array[(biggest_mark + 1)];
90 extern halfword split_first_marks_array[(biggest_mark + 1)];
91 extern halfword split_bot_marks_array[(biggest_mark + 1)];
92 extern halfword biggest_used_mark;
95 extern void initialize_marks(void);
97 extern int long_state;
98 extern halfword pstack[9];
99 extern void macro_call(void);
102 #endif