ACSM_STRUCT * acsmNew () { ACSM_STRUCT * p; init_xlatcase (); p = (ACSM_STRUCT *) AC_MALLOC (sizeof (ACSM_STRUCT)); MEMASSERT (p, "acsmNew"); if (p) memset (p, 0, sizeof (ACSM_STRUCT)); return p; }
/* ** mwmAlloc:: Allocate and Init Big hash Table Verions ** ** maxpats - max number of patterns to support ** */ void * mwmNew() { MWM_STRUCT * p = (MWM_STRUCT * )calloc( sizeof(MWM_STRUCT),1 ); if( !p ) { return 0; } init_xlatcase(); p->msSmallest = 32000; return (void*)p; }
ACSM_STRUCT * acsmNew (void (*userfree)(void *p), void (*optiontreefree)(void **p), void (*neg_list_free)(void **p)) { ACSM_STRUCT * p; init_xlatcase (); p = (ACSM_STRUCT *) AC_MALLOC (sizeof (ACSM_STRUCT)); MEMASSERT (p, "acsmNew"); if (p) { memset (p, 0, sizeof (ACSM_STRUCT)); p->userfree = userfree; p->optiontreefree = optiontreefree; p->neg_list_free = neg_list_free; } return p; }
KTRIE_STRUCT * KTrieNew(int method, void (*userfree)(void *p), void (*optiontreefree)(void **p), void (*neg_list_free)(void **p)) { KTRIE_STRUCT * ts = (KTRIE_STRUCT*) KTRIE_MALLOC( sizeof(KTRIE_STRUCT) ); if( !ts ) return 0; memset(ts, 0, sizeof(KTRIE_STRUCT)); init_xlatcase(); ts->memory = sizeof(KTRIE_STRUCT); ts->nchars = 0; ts->npats = 0; ts->end_states = 0; ts->method = method; /* - old method, 1 = queue */ ts->userfree = userfree; ts->optiontreefree = optiontreefree; ts->neg_list_free = neg_list_free; return ts; }