GNU PROLOG with UTF8 support
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Macros | Typedefs | Functions | Variables
cpt_string.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for cpt_string.c:

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 cptnodeCPTTree
 
typedef struct cptcellCPTList
 
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)
 
CPTMatchCPT_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)
 
CPTStatCPT_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
 

Macro Definition Documentation

#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

Typedef Documentation

typedef CPTTree CPT
typedef struct cptcell CPTCell
typedef struct cptcell* CPTList
typedef struct cptnode CPTNode
typedef struct cptnode* CPTTree

Function Documentation

static int Common_Prefix_Length ( char *  str1,
int  l1,
char *  str2,
int  l2 
)
static

Here is the caller graph for this function:

int CPT_Add_Word ( CPT  cpt,
char *  word,
int  length 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int CPT_Do_Match ( CPTMatch match)

Here is the call graph for this function:

Here is the caller graph for this function:

int CPT_Gensym ( CPTTree  tree,
char *  prefix,
int  prefix_length,
char *  buff 
)

Here is the caller graph for this function:

CPT CPT_Init ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

CPTMatch * CPT_Init_Match ( CPT  tree,
char *  prefix,
int  prefix_length,
char *  buff,
int(*)()  fct 
)

Here is the call graph for this function:

Here is the caller graph for this function:

char * CPT_Match_Info ( CPTMatch match,
int *  prefix_length,
int *  nb_words,
int *  max_length 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int CPT_Remove_Word ( CPTTree  tree,
char *  word,
int  length 
)

Here is the caller graph for this function:

int CPT_Search_Word ( CPT  tree,
char *  word,
int  length 
)

Here is the caller graph for this function:

CPTStat * CPT_Statistics ( CPT  tree)

Here is the call graph for this function:

Here is the caller graph for this function:

static CPTList Create_Cell ( CPTTree  tree,
CPTList  next 
)
static

Here is the caller graph for this function:

static CPTTree Create_Node ( char *  word,
int  length,
int  end,
CPTList  list 
)
static

Here is the caller graph for this function:

int Display_Completion ( char *  str,
int  length,
int  no 
)

Here is the caller graph for this function:

static int Do_Match_Rec ( CPTTree  tree,
char *  buff,
int  length,
int(*)()  fct,
int  no,
int *  cont 
)
static

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

Here is the call graph for this function:

static int Match_Info_Rec ( CPTTree  tree,
int  length,
int *  max_length 
)
static

Here is the caller graph for this function:

int Read_String ( FILE *  f,
char *  str 
)

Here is the caller graph for this function:

void Show_Tree ( CPT  tree,
int  level 
)

Here is the caller graph for this function:

void Show_Words ( CPT  tree)

Here is the call graph for this function:

Here is the caller graph for this function:

void Show_Words_Rec ( CPT  tree,
char *  prefix,
int  length 
)

Here is the caller graph for this function:

static void Statistics_Rec ( CPT  tree,
int  depth,
int  prefix_length 
)
static

Here is the caller graph for this function:

Variable Documentation

CPTMatch match
static
CPTStat stat
static