X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fkmp-search.h;h=b702acc3effb786af8aa174c3e36e4e28e814fd5;hb=1f71ba3ef3df61706d7aee1ffa981cf6fdee7c4e;hp=a399030b6334ad1d3085cdd700b71f7c26657239;hpb=cea5b11fa465e902552c06a54e1b1255f8b71fd5;p=libucw.git diff --git a/lib/kmp-search.h b/lib/kmp-search.h index a399030b..b702acc3 100644 --- a/lib/kmp-search.h +++ b/lib/kmp-search.h @@ -13,18 +13,18 @@ * Each time you include it with parameters set in the corresponding * preprocessor macros, it generates KMP structures and functions * with the parameters given. See lib/kmp.h before reading this description. - * + * * This file defines: * * struct search structure with both the internal and the user-defined variables * used during the search and accessible from all macros * * void search(kmp,search,src) executes the search; search structure is allocated by the caller (possible input/output) - * + * * void run(kmp,src) the same, but automatically allocates search structre from the stack * * - * Macros marked with [*] are mandatory. + * Parameters to the generator (these marked with [*] are mandatory): * * [*] KMPS_PREFIX(x) macro to add a name prefix (used on all global names * defined by the KMP search generator) @@ -41,15 +41,15 @@ * * KMPS_INIT(kmp,src,search) statement executed at the beginning of search() * KMPS_EXIT(kmp,src,search) ... at the end - * KMPS_STEP(kmp,src,search) ... after each step (read of next character + current state update) + * KMPS_STEP(kmp,src,search) ... after each step (read of next character + current state update) * of the algorithm, but before KMPS_FOUND[_CHAIN] - * KMPS_FOUND_CHAIN(kmp,src,search) ... for each state representing locally longest match - * (stored in search->out - NOT necessary search.s!); - * all matches forms a NULL-terminated link list (search->out, search->out->next, ...) + * KMPS_FOUND_CHAIN(kmp,src,search) ... for each state representing locally longest match + * (stored in search->out - NOT necessary search->s!); + * all matches form a NULL-terminated link list (search->out, search->out->next, ...) * in order of decreasing length * KMPS_FOUND(kmp,src,search) ... called for every match (in search->out) * KMPS_WANT_BEST algorithm computes globally longest match, which is available - * in search.best in KMPS_EXIT; if there is no match, it points to the null state + * in search->best in KMPS_EXIT; if there is no match, it points to the null state */ #define P(x) KMPS_PREFIX(x)