Defines | |
| #define | da_is_walkable(d, s, c) (da_get_check ((d), da_get_base ((d), (s)) + (c)) == (s)) |
| Test walkability in double-array structure. | |
Typedefs | |
| typedef _DArray | DArray |
| Double-array structure type. | |
| typedef Bool(*) | DAEnumFunc (const TrieChar *key, TrieIndex sep_node, void *user_data) |
| Double-array entry enumeration function. | |
Functions | |
| DArray * | da_open (const char *path, const char *name, TrieIOMode mode) |
| Open double-array from file. | |
| int | da_close (DArray *d) |
| Close double-array data. | |
| int | da_save (DArray *d) |
| Save double-array data. | |
| TrieIndex | da_get_root (const DArray *d) |
| Get root state. | |
| TrieIndex | da_get_base (const DArray *d, TrieIndex s) |
| Get BASE cell. | |
| TrieIndex | da_get_check (const DArray *d, TrieIndex s) |
| Get CHECK cell. | |
| void | da_set_base (DArray *d, TrieIndex s, TrieIndex val) |
| Set BASE cell. | |
| void | da_set_check (DArray *d, TrieIndex s, TrieIndex val) |
| Set CHECK cell. | |
| Bool | da_walk (DArray *d, TrieIndex *s, TrieChar c) |
| Walk in double-array structure. | |
| TrieIndex | da_insert_branch (DArray *d, TrieIndex s, TrieChar c) |
| Insert a branch from trie node. | |
| void | da_prune (DArray *d, TrieIndex s) |
| Prune the single branch. | |
| Bool | da_enumerate (DArray *d, DAEnumFunc enum_func, void *user_data) |
| Enumerate entries stored in double-array structure. | |
| #define da_is_walkable | ( | d, | |||
| s, | |||||
| c | ) | (da_get_check ((d), da_get_base ((d), (s)) + (c)) == (s)) |
Test walkability in double-array structure.
| d | : the double-array structure | |
| s | : current state | |
| c | : the input character |
| typedef Bool(*) DAEnumFunc(const TrieChar *key, TrieIndex sep_node, void *user_data) |
Double-array entry enumeration function.
| key | : the key of the entry, up to sep_node | |
| sep_node | : the separate node of the entry | |
| user_data | : user-supplied data |
| int da_close | ( | DArray * | d | ) |
Close double-array data.
| d | : the double-array data |
| Bool da_enumerate | ( | DArray * | d, | |
| DAEnumFunc | enum_func, | |||
| void * | user_data | |||
| ) |
Enumerate entries stored in double-array structure.
| d | : the double-array structure | |
| enum_func | : the callback function to be called on each separate node | |
| user_data | : user-supplied data to send as an argument to enum_func |
Get BASE cell.
| d | : the double-array data | |
| s | : the double-array state to get data |
Get CHECK cell.
| d | : the double-array data | |
| s | : the double-array state to get data |
Get root state.
| d | : the double-array data |
Insert a branch from trie node.
| d | : the double-array structure | |
| s | : the state to add branch to | |
| c | : the character for the branch label |
| DArray* da_open | ( | const char * | path, | |
| const char * | name, | |||
| TrieIOMode | mode | |||
| ) |
Open double-array from file.
| path | : the path that stores the double-array files | |
| name | : the name of the double-array (not actual file name) | |
| mode | : openning mode, read or write |
Prune the single branch.
| d | : the double-array structure | |
| s | : the dangling state to prune off |
| int da_save | ( | DArray * | d | ) |
Save double-array data.
| d | : the double-array data |
Set BASE cell.
| d | : the double-array data | |
| s | : the double-array state to get data | |
| val | : the value to set |
Set CHECK cell.
| d | : the double-array data | |
| s | : the double-array state to get data | |
| val | : the value to set |
Walk in double-array structure.
| d | : the double-array structure | |
| s | : current state | |
| c | : the input character |
1.4.7