TeX in C
Explore TeX with modern c compiler.
|
结构体 | |
struct | StrPoolPtr |
宏定义 | |
#define | POOLPOINTER_IS_POINTER 1 |
#define | POOL_TOP (str_pool + POOL_SIZE) |
#define | POOL_ELEM(x, y) ((x)[(y)]) |
#define | S(x) (x) |
标记字符串序号 更多... | |
类型定义 | |
typedef ASCIICode * | PoolPtr |
[#38] for variables that point into str_pool. 更多... | |
typedef uint_fast32_t | StrNumber |
typedef char * | Str |
real string. 更多... | |
函数 | |
int | str_length (StrNumber x) |
[#40]: the number of characters in string number x. 更多... | |
int | cur_length () |
[#41]: The length of the current string. 更多... | |
void | append_char (ASCIICode s) |
[#42]: put ASCII code s at the end of str_pool. 更多... | |
void | flush_char (void) |
[#42]: forget the last character in the pool. 更多... | |
void | str_room (StrNumber l) |
[#42]: make sure that the pool hasn’t overflowed. 更多... | |
StrNumber | makestring (void) |
[#43]: current string enters the pool. 更多... | |
void | flush_string (void) |
[#44]: destroy the most recently made string. 更多... | |
int | str_cmp (StrNumber s, StrNumber t) |
比较两个 str 的差别。返回 0 为相同,非 0 为有差异。 更多... | |
Boolean | str_eq_str (StrNumber s, StrNumber t) |
[p21#46]: test equality of strings。 更多... | |
Boolean | get_strings_started (void) |
[#47]: initializes the string pool, but returns false if something goes wrong. 更多... | |
static void | app_lc_hex (UChar l) |
[#48] int to hex 更多... | |
Boolean | str_pool_init (void) |
[p21#47] Make the first 256 strings, and copy all string in pool_strs[] to string pool. 更多... | |
变量 | |
static ASCIICode | str_pool [POOL_SIZE+1] |
[#39] the characters. 更多... | |
static PoolPtr | str_start [MAX_STRINGS+1] |
[#39] the starting pointers. 更多... | |
static PoolPtr | pool_ptr |
[#39] first unused position in str_pool. 更多... | |
static StrNumber | str_ptr |
[#39] number of the current string being created. 更多... | |
static PoolPtr | init_pool_ptr |
[#39] the starting value of pool_ptr. 更多... | |
static StrNumber | init_str_ptr |
[#39] the starting value of str_ptr. 更多... | |
#define POOL_ELEM | ( | x, | |
y | |||
) | ((x)[(y)]) |
#define POOLPOINTER_IS_POINTER 1 |
#define S | ( | x | ) | (x) |
标记字符串序号
[#38] for variables that point into str_pool.
[PoolPointer => PoolPtr], [0, POOL_SIZE=4MB-1B]
typedef char* Str |
real string.
typedef uint_fast32_t StrNumber |
|
static |
[#48] int to hex
int cur_length | ( | void | ) |
[#41]: The length of the current string.
void flush_char | ( | void | ) |
[#42]: forget the last character in the pool.
void flush_string | ( | void | ) |
[#44]: destroy the most recently made string.
Boolean get_strings_started | ( | void | ) |
[#47]: initializes the string pool, but returns false if something goes wrong.
called by: main()
StrNumber makestring | ( | void | ) |
[#43]: current string enters the pool.
Once a sequence of characters has been appended to str pool, it officially becomes a string when the function make string is called.
This function returns the identification number of the new string as its value.
int str_length | ( | StrNumber | x | ) |
[#40]: the number of characters in string number x.
Boolean str_pool_init | ( | void | ) |
[p21#47] Make the first 256 strings, and copy all string in pool_strs[] to string pool.
length of pool_strs[].
[#48] Make the first 256 strings. ASCII 输入表见 TeXBook: Appendix C: Character Codes.
[#52] Copy strings from 'pool_strs[]' to the pool
void str_room | ( | StrNumber | l | ) |
[#42]: make sure that the pool hasn’t overflowed.
|
static |
[#39] number of the current string being created.
|
static |
[#39] the starting pointers.