TeX in C
Explore TeX with modern c compiler.
PART 3: Input and output

宏定义

#define wopenout   a_open_out
 [p14#27] open a file for output. 更多...
 
#define TERM_IN   stdin
 [#32] the terminal as an input file. 更多...
 
#define TERM_OUT   stdout
 [#32] the terminal as an output file. 更多...
 
#define TERM_ERR   stderr
 错误输出到 stderr 更多...
 
#define update_terminal()   fflush(TERM_OUT)
 [#34] empty the terminal output buffer. 更多...
 
#define clear_terminal()
 [#34] clear the terminal input buffer. 更多...
 
#define LOC   cur_input.locfield
 [p18#36] location of first unread character in buffer. 更多...
 

类型定义

typedef UChar EightBits
 [#25]: EightBits::UChar(8) = [0, 255] 更多...
 

函数

void aclose (FILE **f)
 
void w_close (FILE **f)
 
Boolean inputln (FILE *f, Boolean bypass_eoln)
 [#31] inputs the next line or returns false. 更多...
 
Boolean initterminal (void)
 [#37] gets the terminal input started. 更多...
 

变量

Char name_of_file [FILE_NAME_SIZE+1]
 [#26]: on some systems this may be a record variable. 更多...
 
UInt16 namelength
 [#26]: this many characters are actually relevant in name_of_file (the rest are blank). 更多...
 
ASCIICode buffer [BUF_SIZE+1]
 [#30]: lines of characters being read 更多...
 
UInt16 first
 [#30]: the first unused position in buffer. [0, BUF_SIZE=5000] 更多...
 
UInt16 last
 [#30]: end of the line just input to buffer. [0, BUF_SIZE=5000] 更多...
 
UInt16 max_buf_stack
 [#30]: largest index used in buffer. [0, BUF_SIZE=5000] 更多...
 

详细描述

宏定义说明

◆ clear_terminal

#define clear_terminal ( )

[#34] clear the terminal input buffer.

xref: 330(clearforerrorprompt), 530(prompt_file_name).

◆ LOC

#define LOC   cur_input.locfield

[p18#36] location of first unread character in buffer.

◆ TERM_ERR

#define TERM_ERR   stderr

错误输出到 stderr

◆ TERM_IN

#define TERM_IN   stdin

[#32] the terminal as an input file.

◆ TERM_OUT

#define TERM_OUT   stdout

[#32] the terminal as an output file.

◆ update_terminal

#define update_terminal ( )    fflush(TERM_OUT)

[#34] empty the terminal output buffer.

◆ wopenout

#define wopenout   a_open_out

[p14#27] open a file for output.

类型定义说明

◆ EightBits

typedef UChar EightBits

[#25]: EightBits::UChar(8) = [0, 255]

函数说明

◆ aclose()

void aclose ( FILE **  f)

◆ initterminal()

Boolean initterminal ( void  )

[#37] gets the terminal input started.

◆ inputln()

Boolean inputln ( FILE *  f,
Boolean  bypass_eoln 
)

[#31] inputs the next line or returns false.

30, [31], 37, 58, 71, 362, 485, 486, 538

◆ w_close()

void w_close ( FILE **  f)

变量说明

◆ buffer

ASCIICode buffer[BUF_SIZE+1]

[#30]: lines of characters being read

◆ first

UInt16 first

[#30]: the first unused position in buffer. [0, BUF_SIZE=5000]

◆ last

UInt16 last

[#30]: end of the line just input to buffer. [0, BUF_SIZE=5000]

◆ max_buf_stack

UInt16 max_buf_stack

[#30]: largest index used in buffer. [0, BUF_SIZE=5000]

◆ name_of_file

Char name_of_file[FILE_NAME_SIZE+1]

[#26]: on some systems this may be a record variable.

◆ namelength

UInt16 namelength

[#26]: this many characters are actually relevant in name_of_file (the rest are blank).

[0, FILE_NAME_SIZE=240]