![]() |
GNU PROLOG with UTF8 support
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Data Structures | |
struct | cptcell |
struct | cptnode |
struct | CPTMatch |
struct | CPTStat |
Macros | |
#define | USE_ALONE |
#define | Malloc(size) malloc(size) |
#define | Calloc(nb, size) calloc(nb, size) |
#define | Realloc(ptr, size) realloc(ptr, size) |
#define | Free(ptr) free(ptr) |
#define | GENSYM_CHARS "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
#define | BUFF_SIZE 1024 |
Typedefs | |
typedef struct cptnode * | CPTTree |
typedef struct cptcell * | CPTList |
typedef struct cptcell | CPTCell |
typedef struct cptnode | CPTNode |
typedef CPTTree | CPT |
Functions | |
CPT | CPT_Init (void) |
int | CPT_Add_Word (CPT cpt, char *word, int length) |
static int | Common_Prefix_Length (char *str1, int l1, char *str2, int l2) |
static CPTTree | Create_Node (char *word, int length, int end, CPTList list) |
static CPTList | Create_Cell (CPTTree tree, CPTList next) |
int | CPT_Search_Word (CPT tree, char *word, int length) |
CPTMatch * | CPT_Init_Match (CPT tree, char *prefix, int prefix_length, char *buff, int(*fct)()) |
int | CPT_Do_Match (CPTMatch *match) |
static int | Do_Match_Rec (CPTTree tree, char *buff, int length, int(*fct)(), int no, int *cont) |
char * | CPT_Match_Info (CPTMatch *match, int *prefix_length, int *nb_words, int *max_length) |
static int | Match_Info_Rec (CPTTree tree, int length, int *max_length) |
CPTStat * | CPT_Statistics (CPT tree) |
static void | Statistics_Rec (CPT tree, int depth, int prefix_length) |
int | CPT_Remove_Word (CPTTree tree, char *word, int length) |
int | CPT_Gensym (CPTTree tree, char *prefix, int prefix_length, char *buff) |
void | Show_Words (CPT tree) |
void | Show_Words_Rec (CPT tree, char *prefix, int length) |
void | Show_Tree (CPT tree, int level) |
int | Display_Completion (char *str, int length, int no) |
int | Read_String (FILE *f, char *str) |
int | main (int argc, char *argv[]) |
Variables | |
static CPTMatch | match |
static CPTStat | stat |
#define BUFF_SIZE 1024 |
#define Calloc | ( | nb, | |
size | |||
) | calloc(nb, size) |
#define Free | ( | ptr | ) | free(ptr) |
#define GENSYM_CHARS "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" |
#define Malloc | ( | size | ) | malloc(size) |
#define Realloc | ( | ptr, | |
size | |||
) | realloc(ptr, size) |
#define USE_ALONE |
|
static |
int CPT_Add_Word | ( | CPT | cpt, |
char * | word, | ||
int | length | ||
) |
int CPT_Do_Match | ( | CPTMatch * | match | ) |
int CPT_Gensym | ( | CPTTree | tree, |
char * | prefix, | ||
int | prefix_length, | ||
char * | buff | ||
) |
CPT CPT_Init | ( | void | ) |
char * CPT_Match_Info | ( | CPTMatch * | match, |
int * | prefix_length, | ||
int * | nb_words, | ||
int * | max_length | ||
) |
int CPT_Remove_Word | ( | CPTTree | tree, |
char * | word, | ||
int | length | ||
) |
int CPT_Search_Word | ( | CPT | tree, |
char * | word, | ||
int | length | ||
) |
int Display_Completion | ( | char * | str, |
int | length, | ||
int | no | ||
) |
|
static |
int main | ( | int | argc, |
char * | argv[] | ||
) |
|
static |
int Read_String | ( | FILE * | f, |
char * | str | ||
) |
void Show_Tree | ( | CPT | tree, |
int | level | ||
) |
void Show_Words | ( | CPT | tree | ) |
void Show_Words_Rec | ( | CPT | tree, |
char * | prefix, | ||
int | length | ||
) |
|
static |
|
static |
|
static |