| 1 |
/* expand.h |
| 2 |
|
| 3 |
Copyright 2009 Taco Hoekwater <[email protected]> |
| 4 |
|
| 5 |
This file is part of LuaTeX. |
| 6 |
|
| 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. |
| 11 |
|
| 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. |
| 16 |
|
| 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/>. */ |
| 19 |
|
| 20 |
|
| 21 |
#ifndef EXPAND_H |
| 22 |
# define EXPAND_H |
| 23 |
|
| 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); |
| 32 |
|
| 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 |
| 40 |
|
| 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)] |
| 46 |
|
| 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) |
| 52 |
|
| 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) |
| 58 |
|
| 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) |
| 64 |
|
| 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) |
| 70 |
|
| 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) |
| 76 |
|
| 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) |
| 82 |
|
| 83 |
# define clear_marks_code 1 |
| 84 |
|
| 85 |
# define biggest_mark 65535 |
| 86 |
|
| 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; |
| 93 |
|
| 94 |
|
| 95 |
extern void initialize_marks(void); |
| 96 |
|
| 97 |
extern int long_state; |
| 98 |
extern halfword pstack[9]; |
| 99 |
extern void macro_call(void); |
| 100 |
|
| 101 |
|
| 102 |
#endif |