TeX in C
Explore TeX with modern c compiler.
PART 6: Reporting errors

宏定义

#define help1(x1)   set_help(1, x1)
 [#79] 更多...
 
#define help2(x1, x2)   set_help(2, x1, x2)
 
#define help3(x1, x2, x3)   set_help(3, x1, x2, x3)
 
#define help4(x1, x2, x3, x4)   set_help(4, x1, x2, x3, x4)
 
#define help5(x1, x2, x3, x4, x5)   set_help(5, x1, x2, x3, x4, x5)
 
#define help6(x1, x2, x3, x4, x5, x6)   set_help(6, x1, x2, x3, x4, x5, x6)
 
#define checkinterrupt()   ((interrupt != 0) ? (pause_for_instructions(), 0) : 0)
 [p36#96] 更多...
 

枚举

enum  UserInteractionMode { BATCH_MODE , NON_STOP_MODE , SCROLL_MODE , ERROR_STOP_MODE }
 [p30#73]: four settings, representing increasing amounts of user interaction. 更多...
 
enum  ErrorLevel { SPOTLESS = 0 , WARNING_ISSUED , ERROR_MESSAGE_ISSUED , FATAL_ERROR_STOP }
 [p31#76]: four possible values for the worst level of error that has been detected. 更多...
 

函数

void error_init ()
 [#74, #77, #80, #97] Set initial values of key variables. 更多...
 
void error_selector_init ()
 [p30#75]: Initialize the print selector based on interaction. 更多...
 
void print_err (StrNumber s)
 
void print_err_str (Str s)
 
void set_help (SChar k,...)
 
void jumpout (void)
 [#81]: goto end of TEX. 更多...
 
void error (void)
 [#82]: completes the job of error reporting. 更多...
 
void int_error (Integer n)
 [#91] error messages end with a parenthesized integer. 更多...
 
void normalize_selector (void)
 [#92] fix selector state just enough to keep running a bit longer. 更多...
 
void succumb (void)
 [#93]: prints TEX’s last words before dying. 更多...
 
void fatalerror (StrNumber s)
 [#93] prints s, and that’s it. 更多...
 
void overflow (StrNumber s, Integer n)
 [#94] stop due to finiteness. 更多...
 
void confusion (StrNumber s)
 [#95] consistency check violated; s tells where. 更多...
 
void pause_for_instructions (void)
 [#98] 更多...
 

变量

UChar interaction
 [p30#73] current level of interaction. 更多...
 
Boolean deletions_allowed
 [#76] is it safe for error to call get_token? 更多...
 
Boolean set_box_allowed
 [#76] is it safe to do a \setbox assignment? 更多...
 
ErrorLevel history
 [#76] has the source input been clean so far? [SPOTLESS, FATAL_ERROR_STOP] 更多...
 
SChar errorcount
 [#76] the number of scrolled errors since the last paragraph ended. 更多...
 
StrNumber help_line [6]
 [#79] helps for the next error. 更多...
 
UChar help_ptr
 [#79] the number of help lines present. 更多...
 
Boolean use_err_help
 [#79] should the errhelp list be shown? 更多...
 
Integer interrupt
 [#96] should TeX pause for instructions? 更多...
 
Boolean OK_to_interrupt
 [#96] should interrupts be observed? 更多...
 

详细描述

宏定义说明

◆ checkinterrupt

#define checkinterrupt ( )    ((interrupt != 0) ? (pause_for_instructions(), 0) : 0)

[p36#96]

◆ help1

#define help1 (   x1)    set_help(1, x1)

[#79]

◆ help2

#define help2 (   x1,
  x2 
)    set_help(2, x1, x2)

◆ help3

#define help3 (   x1,
  x2,
  x3 
)    set_help(3, x1, x2, x3)

◆ help4

#define help4 (   x1,
  x2,
  x3,
  x4 
)    set_help(4, x1, x2, x3, x4)

◆ help5

#define help5 (   x1,
  x2,
  x3,
  x4,
  x5 
)    set_help(5, x1, x2, x3, x4, x5)

◆ help6

#define help6 (   x1,
  x2,
  x3,
  x4,
  x5,
  x6 
)    set_help(6, x1, x2, x3, x4, x5, x6)

枚举类型说明

◆ ErrorLevel

enum ErrorLevel

[p31#76]: four possible values for the worst level of error that has been detected.

[REPORTING ERRORS]

枚举值
SPOTLESS 

nothing has been amiss yet.

WARNING_ISSUED 

begin_diagnostic has been called.

ERROR_MESSAGE_ISSUED 

error has been called.

FATAL_ERROR_STOP 

termination was premature.

◆ UserInteractionMode

[p30#73]: four settings, representing increasing amounts of user interaction.

[REPORTING ERRORS]

枚举值
BATCH_MODE 

omits all stops and omits terminal output.

NON_STOP_MODE 

omits all stops.

SCROLL_MODE 

omits error stops.

ERROR_STOP_MODE 

stops at every opportunity to interact.

函数说明

◆ confusion()

void confusion ( StrNumber  s)

[#95] consistency check violated; s tells where.

◆ error()

void error ( void  )

[#82]: completes the job of error reporting.

◆ error_init()

void error_init ( )

[#74, #77, #80, #97] Set initial values of key variables.

[p30#74]

[p31#77]

< history is initialized elsewhere .

[p32#80]

[p37#97]

◆ error_selector_init()

void error_selector_init ( )

[p30#75]: Initialize the print selector based on interaction.

◆ fatalerror()

void fatalerror ( StrNumber  s)

[#93] prints s, and that’s it.

◆ int_error()

void int_error ( Integer  n)

[#91] error messages end with a parenthesized integer.

◆ jumpout()

void jumpout ( void  )

[#81]: goto end of TEX.

jump out: [81], 82, 84, 93

◆ normalize_selector()

void normalize_selector ( void  )

[#92] fix selector state just enough to keep running a bit longer.

used in anomalous cases.

  • fatalerror
  • overflow
  • confusion

◆ overflow()

void overflow ( StrNumber  s,
Integer  n 
)

[#94] stop due to finiteness.

◆ pause_for_instructions()

void pause_for_instructions ( void  )

[#98]

◆ print_err()

void print_err ( StrNumber  s)
inline

◆ print_err_str()

void print_err_str ( Str  s)
inline

◆ set_help()

void set_help ( SChar  k,
  ... 
)

◆ succumb()

void succumb ( void  )

[#93]: prints TEX’s last words before dying.

变量说明

◆ deletions_allowed

Boolean deletions_allowed

[#76] is it safe for error to call get_token?

◆ errorcount

SChar errorcount

[#76] the number of scrolled errors since the last paragraph ended.

errorcount = [-1, 100]

◆ help_line

StrNumber help_line[6]

[#79] helps for the next error.

◆ help_ptr

UChar help_ptr

[#79] the number of help lines present.

◆ history

ErrorLevel history

[#76] has the source input been clean so far? [SPOTLESS, FATAL_ERROR_STOP]

◆ interaction

UChar interaction

[p30#73] current level of interaction.

interaction = [BATCH_MODE=0, ERROR_STOP_MODE=3]

[REPORTING ERRORS]

◆ interrupt

Integer interrupt

[#96] should TeX pause for instructions?

◆ OK_to_interrupt

Boolean OK_to_interrupt

[#96] should interrupts be observed?

◆ set_box_allowed

Boolean set_box_allowed

[#76] is it safe to do a \setbox assignment?

◆ use_err_help

Boolean use_err_help

[#79] should the errhelp list be shown?