1
4
5# ifndef LMT_PRINTING_H
6# define LMT_PRINTING_H
7
8typedef enum selector_settings {
9 no_print_selector_code,
10 terminal_selector_code,
11 logfile_selector_code,
12 terminal_and_logfile_selector_code,
13 pseudo_selector_code,
14 new_string_selector_code,
15 luabuffer_selector_code,
16} selector_settings;
17
18typedef struct print_state_info {
19 FILE *logfile;
20 char *loggable_info;
21 int selector;
22 int terminal_offset;
23 int logfile_offset;
24 int new_string_line;
25 int tally;
26 unsigned char trick_buffer[max_error_line + 1];
27 int trick_count;
28 int first_count;
29 int saved_selector;
30 int font_in_short_display;
31 FILE *saved_logfile;
32 int saved_logfile_offset;
33} print_state_info;
34
35extern print_state_info lmt_print_state;
36
37typedef enum spec_units {
38 no_unit,
39 pt_unit,
40 mu_unit,
41} spec_units;
42
43
52
53extern void tex_print_ln (void);
54extern void tex_print_char (int s);
55extern void tex_print_tex_str (int s);
56extern void tex_print_tex_str_esc (strnumber s);
57extern void tex_print_nlp (void);
58extern void tex_print_banner (void);
59extern void tex_print_log_banner (void);
60extern void tex_print_version_banner (void);
61extern void tex_print_int (int n);
62extern void tex_print_hex (long long n);
63extern void tex_print_uhex (long long n);
64extern void tex_print_qhex (long long n);
65extern void tex_print_roman_int (int n);
66extern void tex_print_current_string (void);
67extern void tex_print_cs_checked (halfword p);
68extern void tex_print_cs (halfword p);
69extern void tex_print_cs_name (halfword p);
70extern void tex_print_str (const char *s);
71extern void tex_print_str_esc (const char *s);
72extern void tex_print_posit (halfword d);
73extern void tex_print_dimension (scaled d, int unit);
74extern void tex_print_sparse_dimension (scaled d, int unit);
75extern void tex_print_unit (int unit);
76extern void tex_print_glue (scaled d, int order, int unit);
77extern void tex_print_spec (int p, int unit);
78extern void tex_print_fontspec (int p);
79extern void tex_print_mathspec (int p);
80extern void tex_print_font_identifier (halfword f);
81extern void tex_print_font_specifier (halfword e);
82extern void tex_print_font (halfword f);
83extern void tex_print_char_identifier (halfword c);
84extern void tex_print_token_list (const char *s, halfword p);
85extern void tex_print_rule_dimension (scaled d);
86extern void tex_print_group (int e);
87extern void tex_print_format (const char *format, ...);
88extern const char *tex_print_format_args (const char *format, va_list args);
89extern void tex_begin_diagnostic (void);
90extern void tex_print_levels (void);
91extern void tex_end_diagnostic (void);
92extern void tex_show_box (halfword p);
93extern void tex_short_display (halfword p);
94extern void tex_print_message (const char *s);
95
96static inline int tex_single_letter(strnumber s)
97{
98 return (
99 (str_length(s) == 1)
100 || ( (str_length(s) == 4) && *(str_string(s) ) >= 0xF0)
101 || ( (str_length(s) == 3) && *(str_string(s) ) >= 0xE0)
102 || ( (str_length(s) == 2) && *(str_string(s) ) >= 0xC0)
103 );
104}
105
106static inline int tex_is_active_cs(strnumber s)
107{
108 if (s && str_length(s) > 3) {
109 const unsigned char *ss = str_string(s);
110 return (ss[0] == active_first) && (ss[1] == active_second) && (ss[2] == active_third);
111 } else {
112 return 0;
113 }
114}
115
116# endif
117 |