Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

sfksearch.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "sfksearch.h"

Go to the source code of this file.

Functions

static void * KTRIE_MALLOC (int n)
static void init_xlatcase ()
static void ConvertCaseEx (unsigned char *d, unsigned char *s, int m)
KTRIE_STRUCTKTrieNew ()
static KTRIEPATTERNKTrieNewPattern (unsigned char *P, int n)
int KTrieAddPattern (KTRIE_STRUCT *ts, unsigned char *P, int n, int nocase, void *id)
static KTRIENODEKTrieCreateNode (KTRIE_STRUCT *ts)
static int KTrieInsert (KTRIE_STRUCT *ts, KTRIEPATTERN *px)
static void Build_Bad_Character_Shifts (KTRIE_STRUCT *kt)
int KTrieCompile (KTRIE_STRUCT *ts)
static int KTriePrefixMatch (KTRIE_STRUCT *kt, unsigned char *T, unsigned char *Tc, unsigned char *bT, int n, int(*match)(void *id, int index, void *data), void *data)
static int KTrieSearchNoBC (KTRIE_STRUCT *ks, unsigned char *Tx, int n, int(*match)(void *id, int index, void *data), void *data)
static int KTrieSearchBC (KTRIE_STRUCT *ks, unsigned char *Tx, int n, int(*match)(void *id, int index, void *data), void *data)
int KTrieSearch (KTRIE_STRUCT *ks, unsigned char *T, int n, int(*match)(void *id, int index, void *data), void *data)

Variables

static unsigned char Tnocase [65 *1024]
static unsigned char xlatcase [256]


Function Documentation

static void Build_Bad_Character_Shifts KTRIE_STRUCT kt  )  [static]
 

Definition at line 327 of file sfksearch.c.

References KTRIE_STRUCT::bcShift, KTRIE_STRUCT::bcSize, _ktriepattern::n, _ktriepattern::next, NULL, _ktriepattern::P, and KTRIE_STRUCT::patrn.

Referenced by KTrieCompile().

static void ConvertCaseEx unsigned char *  d,
unsigned char *  s,
int  m
[inline, static]
 

Definition at line 95 of file sfksearch.c.

References xlatcase.

static void init_xlatcase  )  [static]
 

Definition at line 77 of file sfksearch.c.

References char(), and xlatcase.

static void* KTRIE_MALLOC int  n  )  [static]
 

Definition at line 43 of file sfksearch.c.

References memset.

Referenced by KTrieCreateNode(), KTrieNew(), and KTrieNewPattern().

int KTrieAddPattern KTRIE_STRUCT ts,
unsigned char *  P,
int  n,
int  nocase,
void *  id
 

Definition at line 156 of file sfksearch.c.

References KTrieNewPattern(), KTRIE_STRUCT::memory, _ktriepattern::nocase, KTRIE_STRUCT::npats, NULL, and KTRIE_STRUCT::patrn.

Referenced by mpseAddPattern().

int KTrieCompile KTRIE_STRUCT ts  ) 
 

Definition at line 377 of file sfksearch.c.

References Build_Bad_Character_Shifts(), KTrieInsert(), _ktriepattern::next, and KTRIE_STRUCT::patrn.

Referenced by mpsePrepPatterns().

static KTRIENODE* KTrieCreateNode KTRIE_STRUCT ts  )  [static]
 

Definition at line 192 of file sfksearch.c.

References KTRIE_MALLOC(), KTRIE_STRUCT::memory, and memset.

Referenced by KTrieInsert().

static int KTrieInsert KTRIE_STRUCT ts,
KTRIEPATTERN px
[static]
 

Definition at line 210 of file sfksearch.c.

References _ktrienode::child, KTRIE_STRUCT::duplicates, _ktrienode::edge, KTrieCreateNode(), _ktriepattern::mnext, _ktriepattern::n, KTRIE_STRUCT::nchars, _ktriepattern::P, _ktrienode::pkeyword, KTRIE_STRUCT::root, and _ktrienode::sibling.

Referenced by KTrieCompile().

KTRIE_STRUCT* KTrieNew  ) 
 

Definition at line 108 of file sfksearch.c.

References init_xlatcase(), KTRIE_MALLOC(), KTRIE_STRUCT::memory, memset, KTRIE_STRUCT::nchars, and KTRIE_STRUCT::npats.

Referenced by mpseNew().

static KTRIEPATTERN* KTrieNewPattern unsigned char *  P,
int  n
[static]
 

Definition at line 128 of file sfksearch.c.

References ConvertCaseEx(), KTRIE_MALLOC(), memcpy, _ktriepattern::n, _ktriepattern::next, _ktriepattern::P, and _ktriepattern::Pcase.

Referenced by KTrieAddPattern().

static int KTriePrefixMatch KTRIE_STRUCT kt,
unsigned char *  T,
unsigned char *  Tc,
unsigned char *  bT,
int  n,
int(*)(void *id, int index, void *data)  match,
void *  data
[inline, static]
 

Definition at line 423 of file sfksearch.c.

References _ktrienode::child, _ktrienode::edge, _ktriepattern::id, int(), memcmp(), _ktriepattern::mnext, _ktriepattern::n, _ktriepattern::nocase, _ktriepattern::Pcase, _ktrienode::pkeyword, KTRIE_STRUCT::root, and _ktrienode::sibling.

Referenced by KTrieSearchBC(), and KTrieSearchNoBC().

int KTrieSearch KTRIE_STRUCT ks,
unsigned char *  T,
int  n,
int(*)(void *id, int index, void *data)  match,
void *  data
 

Definition at line 554 of file sfksearch.c.

References KTRIE_STRUCT::bcSize, KTrieSearchBC(), and KTrieSearchNoBC().

Referenced by mpseSearch().

static int KTrieSearchBC KTRIE_STRUCT ks,
unsigned char *  Tx,
int  n,
int(*)(void *id, int index, void *data)  match,
void *  data
[inline, static]
 

Definition at line 517 of file sfksearch.c.

References KTRIE_STRUCT::bcShift, KTRIE_STRUCT::bcSize, ConvertCaseEx(), KTriePrefixMatch(), and Tnocase.

Referenced by KTrieSearch().

static int KTrieSearchNoBC KTRIE_STRUCT ks,
unsigned char *  Tx,
int  n,
int(*)(void *id, int index, void *data)  match,
void *  data
[inline, static]
 

Definition at line 495 of file sfksearch.c.

References ConvertCaseEx(), KTriePrefixMatch(), and Tnocase.

Referenced by KTrieSearch().


Variable Documentation

unsigned char Tnocase[65 *1024] [static]
 

Definition at line 67 of file sfksearch.c.

Referenced by KTrieSearchBC(), and KTrieSearchNoBC().

unsigned char xlatcase[256] [static]
 

Definition at line 72 of file sfksearch.c.


Generated on Sun May 14 14:51:26 2006 by  doxygen 1.4.2