beta-0.89.2
[luatex.git] / source / texk / web2c / luatexdir / tex / printing.h
blob1619c6072de68ffbbec5de9fde0587f1d5492086
1 /* printing.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/>. */
20 #ifndef PRINTING_H
21 # define PRINTING_H
23 #define last_file_selector 127 /* was 15 */
26 Nicer will be to start these with 0 and then use an offset for the write
27 registers internally.
30 typedef enum {
31 no_print = last_file_selector + 1, /* 16 */ /* |selector| setting that makes data disappear */
32 term_only = last_file_selector + 2, /* 17 */ /* printing is destined for the terminal only */
33 log_only = last_file_selector + 3, /* 18 */ /* printing is destined for the transcript file only */
34 term_and_log = last_file_selector + 4, /* 19 */ /* normal |selector| setting */
35 pseudo = last_file_selector + 5, /* 20 */ /* special |selector| setting for |show_context| */
36 new_string = last_file_selector + 6, /* 21 */ /* printing is deflected to the string pool */
37 } selector_settings;
39 extern int escape_controls;
40 extern int new_string_line;
42 # define ssup_error_line 255
43 # define max_selector new_string /* highest selector setting */
45 extern alpha_file log_file;
46 extern int selector;
47 extern int dig[23];
48 extern int tally;
49 extern int term_offset;
50 extern int file_offset;
51 extern packed_ASCII_code trick_buf[(ssup_error_line + 1)];
52 extern int trick_count;
53 extern int first_count;
54 extern boolean inhibit_par_tokens;
57 Macro abbreviations for output to the terminal and to the log file are
58 defined here for convenience. Some systems need special conventions
59 for terminal output, and it is possible to adhere to those conventions
60 by changing |wterm|, |wterm_ln|, and |wterm_cr| in this section.
61 @^system dependencies@>
64 # define wterm_cr() fprintf(term_out,"\n")
65 # define wlog_cr() fprintf(log_file,"\n")
67 extern void print_ln(void);
68 extern void print_char(int s);
69 extern void print(int s);
70 extern void lprint (lstring *ss);
71 extern void print_nl(str_number s);
72 extern void print_nlp(void);
73 extern void print_banner(const char *);
74 extern void log_banner(const char *);
75 extern void print_version_banner(void);
76 extern void print_esc(str_number s);
77 extern void print_the_digs(eight_bits k);
78 extern void print_int(longinteger n);
79 extern void print_two(int n);
80 extern void print_hex(int n);
81 extern void print_roman_int(int n);
82 extern void print_current_string(void);
84 # define print_font_name(A) tprint(font_name(A))
86 extern void print_cs(int p);
87 extern void sprint_cs(pointer p);
88 extern void sprint_cs_name(pointer p);
89 extern void tprint(const char *s);
90 extern void tprint_nl(const char *s);
91 extern void tprint_esc(const char *s);
93 extern void prompt_input(const char *s);
95 # define single_letter(A) \
96 ((str_length(A)==1)|| \
97 ((str_length(A)==4)&&*(str_string((A)))>=0xF0)|| \
98 ((str_length(A)==3)&&*(str_string((A)))>=0xE0)|| \
99 ((str_length(A)==2)&&*(str_string((A)))>=0xC0))
101 # define is_active_cs(a) \
102 (a && str_length(a)>3 && \
103 ( *str_string(a) == 0xEF) && \
104 (*(str_string(a)+1) == 0xBF) && \
105 (*(str_string(a)+2) == 0xBF))
107 # define active_cs_value(A) pool_to_unichar((str_string((A))+3))
109 extern void print_glue(scaled d, int order, const char *s); /* prints a glue component */
110 extern void print_spec(int p, const char *s); /* prints a glue specification */
112 extern int font_in_short_display; /* an internal font number */
113 extern void print_font_identifier(internal_font_number f);
114 extern void short_display(int p); /* prints highlights of list |p| */
115 extern void print_font_and_char(int p); /* prints |char_node| data */
116 extern void print_mark(int p); /* prints token list data in braces */
117 extern void print_rule_dimen(scaled d); /* prints dimension in rule node */
118 extern int depth_threshold; /* maximum nesting depth in box displays */
119 extern int breadth_max; /* maximum number of items shown at the same list level */
120 extern void show_box(halfword p);
121 extern void short_display_n(int p, int m); /* prints highlights of list |p| */
123 extern void print_csnames(int hstart, int hfinish);
124 extern void print_file_line(void);
126 extern void begin_diagnostic(void);
127 extern void end_diagnostic(boolean blank_line);
128 extern int global_old_setting;
130 #endif