Definition in file dic.c.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include "dic_internals.h"
#include "dic.h"
Go to the source code of this file.
Functions | |
static int | check_header (FILE *file, Dict_header *header) |
int | Dic_load (Dictionary *dic, const char *path) |
Dictionary creation and loading from a file. | |
int | Dic_destroy (Dictionary dic) |
Destroy a dictionary. | |
dic_elt_t | Dic_next (Dictionary d, dic_elt_t e) |
Returns the next available neighbor (see Dic_last). | |
dic_elt_t | Dic_succ (Dictionary d, dic_elt_t e) |
Returns the first element available at the next depth in the dictionary dic : dictionary elt : current dictionary element. | |
dic_elt_t | Dic_root (Dictionary d) |
Returns the root of the dictionary. | |
char | Dic_chr (Dictionary d, dic_elt_t e) |
Dic_chr returns the character associated with an element (in the range ['A'-'Z']), or the null character (''). | |
int | Dic_last (Dictionary d, dic_elt_t e) |
Returns a boolean to show if there is another available character in the current depth (a neighbor in the tree). | |
int | Dic_word (Dictionary d, dic_elt_t e) |
Returns a boolean to show if we are at the end of a word (see Dic_next). | |
unsigned int | Dic_lookup (Dictionary d, dic_elt_t root, char *s) |
Find the dictionary element matching the pattern starting from the given root node by walking the dictionary tree dic : valid dictionary root : starting dictionary node for the search pattern : string made of uppercase characters in the range ['A'-'Z']. |
|
Definition at line 37 of file dic.c. References _COMPIL_KEYWORD_, and _Dict_header::ident. Referenced by Dic_load(). |
|
Dic_chr returns the character associated with an element (in the range ['A'-'Z']), or the null character ('').
Definition at line 128 of file dic.c. References _Dictionary::dawg. Referenced by Board_checkout_tile(), Dic_lookup(), ExtendRight(), and LeftPart(). |
|
Destroy a dictionary.
Definition at line 84 of file dic.c. References _Dictionary::dawg. Referenced by main(), print_dic_hex(), print_dic_list(), and MainFrame::~MainFrame(). |
|
Returns a boolean to show if there is another available character in the current depth (a neighbor in the tree).
Definition at line 139 of file dic.c. References _Dictionary::dawg. Referenced by Board_checkout_tile(), Dic_lookup(), and Dic_next(). |
|
Dictionary creation and loading from a file.
Definition at line 46 of file dic.c. References check_header(), _Dict_header::edgesused, _Dict_header::nodesused, _Dict_header::nwords, _Dictionary::root, and _Dict_header::root. Referenced by GameFactory::createFromCmdLine(), dic_load(), EVT_TEXT_ENTER(), and main(). |
|
Find the dictionary element matching the pattern starting from the given root node by walking the dictionary tree dic : valid dictionary root : starting dictionary node for the search pattern : string made of uppercase characters in the range ['A'-'Z']. The pattern must be null ('') terminated
Definition at line 153 of file dic.c. References Dic_chr(), Dic_last(), Dic_next(), and Dic_succ(). Referenced by Board_checkout_tile(). |
|
Returns the next available neighbor (see Dic_last).
Definition at line 105 of file dic.c. References Dic_last(). Referenced by Board_checkout_tile(), Dic_lookup(), ExtendRight(), and LeftPart(). |
|
Returns the root of the dictionary.
Definition at line 121 of file dic.c. References _Dictionary::root. Referenced by Board_checkout_tile(), BoardSearchAux(), and Board::searchFirst(). |
|
Returns the first element available at the next depth in the dictionary dic : dictionary elt : current dictionary element.
Definition at line 114 of file dic.c. References _Dictionary::dawg. Referenced by Board_checkout_tile(), Dic_lookup(), ExtendRight(), and LeftPart(). |
|
Returns a boolean to show if we are at the end of a word (see Dic_next).
Definition at line 146 of file dic.c. References _Dictionary::dawg. Referenced by Board_checkout_tile(), and ExtendRight(). |