summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/tex/printing.h
blob: e664c51d7200a947c296a984b714743ece1c8e52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* printing.h
   
   Copyright 2009 Taco Hoekwater <taco@luatex.org>

   This file is part of LuaTeX.

   LuaTeX is free software; you can redistribute it and/or modify it under
   the terms of the GNU General Public License as published by the Free
   Software Foundation; either version 2 of the License, or (at your
   option) any later version.

   LuaTeX is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
   License for more details.

   You should have received a copy of the GNU General Public License along
   with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */

/* $Id: printing.h 4722 2014-01-03 09:32:35Z taco $ */

#ifndef PRINTING_H
#  define PRINTING_H

typedef enum {
    no_print = 16,              /* |selector| setting that makes data disappear */
    term_only = 17,             /* printing is destined for the terminal only */
    log_only = 18,              /* printing is destined for the transcript file only */
    term_and_log = 19,          /* normal |selector| setting */
    pseudo = 20,                /* special |selector| setting for |show_context| */
    new_string = 21,            /* printing is deflected to the string pool */
} selector_settings;

#  define ssup_error_line 255
#  define max_selector new_string
                                /* highest selector setting */

extern alpha_file log_file;
extern int selector;
extern int dig[23];
extern int tally;
extern int term_offset;
extern int file_offset;
extern packed_ASCII_code trick_buf[(ssup_error_line + 1)];
extern int trick_count;
extern int first_count;
extern boolean inhibit_par_tokens;

/*
Macro abbreviations for output to the terminal and to the log file are
defined here for convenience. Some systems need special conventions
for terminal output, and it is possible to adhere to those conventions
by changing |wterm|, |wterm_ln|, and |wterm_cr| in this section.
@^system dependencies@>
*/

#  define wterm_cr()   fprintf(term_out,"\n")
#  define wlog_cr()    fprintf(log_file,"\n")

extern void print_ln(void);
extern void print_char(int s);
extern void print(int s);
extern void print_nl(str_number s);
extern void print_nlp(void);
extern void print_banner(const char *, int);
extern void log_banner(const char *, int);
extern void print_version_banner(void);
extern void print_esc(str_number s);
extern void print_the_digs(eight_bits k);
extern void print_int(longinteger n);
extern void print_two(int n);
extern void print_hex(int n);
extern void print_roman_int(int n);
extern void print_current_string(void);

#  define print_font_name(A) tprint(font_name(A))

extern void print_cs(int p);
extern void sprint_cs(pointer p);
extern void tprint(const char *s);
extern void tprint_nl(const char *s);
extern void tprint_esc(const char *s);

extern void prompt_input(const char *s);


#  define single_letter(A)                                              \
    ((str_length(A)==1)||                                               \
     ((str_length(A)==4)&&*(str_string((A)))>=0xF0)||                   \
     ((str_length(A)==3)&&*(str_string((A)))>=0xE0)||                   \
     ((str_length(A)==2)&&*(str_string((A)))>=0xC0))

#  define is_active_cs(a) (a && str_length(a)>3 &&			\
                           (*str_string(a) == 0xEF) &&                  \
                           (*(str_string(a)+1) == 0xBF) &&              \
                           (*(str_string(a)+2) == 0xBF))


#  define active_cs_value(A) pool_to_unichar((str_string((A))+3))

extern void print_glue(scaled d, int order, const char *s);     /* prints a glue component */
extern void print_spec(int p, const char *s);   /* prints a glue specification */

extern int font_in_short_display;       /* an internal font number */
extern void print_font_identifier(internal_font_number f);
extern void short_display(int p);       /* prints highlights of list |p| */
extern void print_font_and_char(int p); /* prints |char_node| data */
extern void print_mark(int p);  /* prints token list data in braces */
extern void print_rule_dimen(scaled d); /* prints dimension in rule node */
extern int depth_threshold;     /* maximum nesting depth in box displays */
extern int breadth_max;         /* maximum number of items shown at the same list level */
extern void show_box(halfword p);
extern void short_display_n(int p, int m);      /* prints highlights of list |p| */

extern void print_csnames(int hstart, int hfinish);
extern void print_file_line(void);

extern void begin_diagnostic(void);
extern void end_diagnostic(boolean blank_line);
extern int global_old_setting;


#endif