TeX in C
Explore TeX with modern c compiler.
PART 18: The hash table

宏定义

#define next(x)   hash[x - HASH_BASE].UU.lh
 [p102#256] link for coalesced lists 更多...
 
#define text(x)   hash[x - HASH_BASE].rh
 [p102#256] string number for control sequence name 更多...
 
#define hash_is_full   (hash_used == HASH_BASE)
 [p102#256] test if all positions are occupied 更多...
 

函数

void hash_var_init ()
 [#257] 更多...
 
void hash_init_once ()
 [#258] 更多...
 
StrNumber get_text (size_t x)
 
void set_text (size_t x, StrNumber s)
 
StrNumber fontidtext (InternalFontNumber x)
 [#256] a frozen font identifier’s name 更多...
 
void set_fontidtext (InternalFontNumber x, StrNumber s)
 
HalfWord idlookup_p (ASCIICode buf_ptr[], Integer len, Boolean no_new_cs)
 [#259] search the hash table. 更多...
 
void print_cs (long p)
 [#262] prints a purported control sequence. 更多...
 
void sprint_cs (Pointer p)
 [#263]: prints a control sequence. 更多...
 
void primitive (StrNumber s, QuarterWord c, HalfWord o)
 [p105#264] 更多...
 

变量

TwoHalves hash [UNDEFINED_CONTROL_SEQUENCE - HASH_BASE]
 [#256] 更多...
 
Pointer hash_used
 
Integer cs_count
 

详细描述

宏定义说明

◆ hash_is_full

#define hash_is_full   (hash_used == HASH_BASE)

[p102#256] test if all positions are occupied

◆ next

#define next (   x)    hash[x - HASH_BASE].UU.lh

[p102#256] link for coalesced lists

◆ text

#define text (   x)    hash[x - HASH_BASE].rh

[p102#256] string number for control sequence name

函数说明

◆ fontidtext()

StrNumber fontidtext ( InternalFontNumber  x)

[#256] a frozen font identifier’s name

◆ get_text()

StrNumber get_text ( size_t  x)

◆ hash_init_once()

void hash_init_once ( )

[#258]

◆ hash_var_init()

void hash_var_init ( )

[#257]

◆ idlookup_p()

HalfWord idlookup_p ( ASCIICode  buf_ptr[],
Integer  len,
Boolean  no_new_cs 
)

[#259] search the hash table.

that matches a given string of length l > 1 appearing in `buffer[j, (j + l − 1)]

If the identifier is found, the corresponding hash table address is returned. if variable no_new_cs==true, the dummy address UNDEFINED_CONTROL_SEQUENCE is returned. Otherwise the identifier is inserted into the hash table and its location is returned.

xref[3]: 264, 356, 374

[#261] Compute the hash code hash_code.

◆ primitive()

void primitive ( StrNumber  s,
QuarterWord  c,
HalfWord  o 
)

[p105#264]

◆ print_cs()

void print_cs ( long  p)

[#262] prints a purported control sequence.

◆ set_fontidtext()

void set_fontidtext ( InternalFontNumber  x,
StrNumber  s 
)

◆ set_text()

void set_text ( size_t  x,
StrNumber  s 
)

◆ sprint_cs()

void sprint_cs ( Pointer  p)

[#263]: prints a control sequence.

变量说明

◆ cs_count

Integer cs_count

◆ hash

◆ hash_used

Pointer hash_used