struct nfa_state nfa[MAX_STATES];
struct dfa_state *hash[HASH_SIZE];
struct dfa_state *dfa_start;
- int nfa_states;
- int dfa_cache_counter;
+ uns nfa_states;
+ uns dfa_cache_counter;
struct mempool *pool;
struct dfa_state *free_states;
};
if (strlen(p) >= MAX_STATES) /* Too long */
return NULL;
w = pool_alloc(pool, sizeof(*w));
- bzero(w, sizeof(w));
+ bzero(w, sizeof(*w));
w->pool = pool;
for(i=1; *p; p++)
{
return d->final;
}
+int
+wp_min_size(byte *p)
+{
+ int s = 0;
+
+ while (*p)
+ if (*p++ != '*')
+ s++;
+ return s;
+}
+
#ifdef TEST
void
struct wildpatt *wp_compile(byte *, struct mempool *);
int wp_match(struct wildpatt *, byte *);
+int wp_min_size(byte *);