1
4
5# ifndef LMT_ERRORS_H
6# define LMT_ERRORS_H
7
8
14
15# define print_buffer_size 512
16
17typedef enum interaction_levels {
18 batch_mode,
19 nonstop_mode,
20 scroll_mode,
21 error_stop_mode,
22} interaction_levels;
23
24# define last_interaction_level error_stop_mode
25
26typedef struct error_state_info {
27 char *last_error;
28 char *last_lua_error;
29 char *last_warning_tag;
30 char *last_warning;
31 char *last_error_context;
32 char *help_text;
33
34 int intercept;
35 int last_intercept;
36 int interaction;
37 int default_exit_code;
38 int set_box_allowed;
39 int history;
40 int error_count;
41 int saved_selector;
42 int in_error;
43 int long_help_seen;
44 int context_indent;
45 int padding;
46 limits_data line_limits;
47 limits_data half_line_limits;
48} error_state_info;
49
50extern error_state_info lmt_error_state;
51
52typedef enum error_states {
53 spotless,
54 warning_issued,
55 error_message_issued,
56 fatal_error_stop,
57} error_states;
58
59extern void tex_initialize_errors (void);
60extern void tex_fixup_selector (int log_opened);
61extern void tex_fatal_error (const char *helpinfo);
62extern void tex_overflow_error (const char *s, int n);
63extern int tex_confusion (const char *s);
64extern int tex_normal_error (const char *t, const char *p);
65extern void tex_normal_warning (const char *t, const char *p);
66extern int tex_formatted_error (const char *t, const char *fmt, ...);
67extern void tex_formatted_warning (const char *t, const char *fmt, ...);
68extern void tex_emergency_message (const char *t, const char *fmt, ...);
69extern int tex_emergency_exit (void);
70extern int tex_normal_exit (void);
71
72
73
74# define error_string_clobbered(n) "[clobbered " LMT_TOSTRING(n) "]"
75# define error_string_bad(n) "[bad " LMT_TOSTRING(n) "]"
76# define error_string_impossible(n) "[impossible " LMT_TOSTRING(n) "]"
77# define error_string_nonexistent(n) "[nonexistent " LMT_TOSTRING(n) "]"
78
79
102
103typedef enum error_types {
104 normal_error_type,
105 back_error_type,
106 insert_error_type,
107 succumb_error_type,
108 eof_error_type,
109 condition_error_type,
110 runaway_error_type,
111 warning_error_type,
112} error_types;
113
114extern void tex_handle_error (error_types type, const char *format, ...);
115extern void tex_handle_error_message_only (const char *message);
116
117# endif
118 |