X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fwildmatch.c;h=fed2ddb944efd5e9c8e6141cdbeb5fbe3337be52;hb=e34560a76a7af3fb428604e4da3cd14cfd1bf454;hp=5fcef8220f09e1d4ca6570531421bdaa89a33e97;hpb=e9aa499507f33db9fac50f3864609a6b292685e0;p=libucw.git diff --git a/lib/wildmatch.c b/lib/wildmatch.c index 5fcef822..fed2ddb9 100644 --- a/lib/wildmatch.c +++ b/lib/wildmatch.c @@ -1,13 +1,16 @@ /* - * Fast Pattern Matcher for Short Wildcard Patterns (only `?' and `*' supported) + * UCW Library -- Fast Pattern Matcher for Short Wildcard Patterns (only `?' and `*' supported) * * Traditional NFA -> DFA method with on-the-fly DFA construction. * * (c) 1999 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ #include "lib/lib.h" -#include "lib/pools.h" +#include "lib/mempool.h" #include "lib/wildmatch.h" #include @@ -26,7 +29,7 @@ struct nfa_state { }; struct dfa_state { - addr_int_t edge[256]; /* Outgoing DFA edges. Bit 0 is set for incomplete edges which + uintptr_t edge[256]; /* Outgoing DFA edges. Bit 0 is set for incomplete edges which * contain just state set and clear for complete ones which point * to other states. NULL means `no match'. */ @@ -154,12 +157,12 @@ wp_match(struct wildpatt *w, byte *s) d = w->dfa_start; while (*s) { - addr_int_t next = d->edge[*s]; + uintptr_t next = d->edge[*s]; if (next & 1) { /* Need to lookup/create the destination state */ struct dfa_state *new = wp_new_state(w, next & ~1); - d->edge[*s] = (addr_int_t) new; + d->edge[*s] = (uintptr_t) new; d = new; } else if (!next)