/* This file was generated by the following command: cfunctions kmp.c */ #ifndef CFH_KMP_H #define CFH_KMP_H #line 4 "kmp.c" typedef struct kmp_result kmp_result_t; struct kmp_result{ unsigned int offset; unsigned int line; kmp_result_t * next; } #line 17 "kmp.c" ; typedef struct kmp { /* The thing we are matching. */ const unsigned char * needle; /* The number of bytes in "needle". */ int length; /* A table of length "length" containing a decomposition of "needle" according to the Knuth-Morris-Pratt algorithm. */ int * table; } kmp_t; typedef struct fc { /* File name for error messages. */ const char * name; /* File contents. */ unsigned char * contents; /* Length of file. */ size_t len; } fc_t; typedef enum { kmp_status_ok, kmp_status_memory_failure, kmp_status_too_short, kmp_status_overflow, kmp_status_empty_input, } kmp_status_t; #line 47 "kmp.c" kmp_status_t kmp_search (const fc_t* fc, const kmp_t* k, kmp_result_t** result_ptr); #line 135 "kmp.c" kmp_status_t kmp_make_table (kmp_t* k); #line 189 "kmp.c" kmp_status_t kmp_free (kmp_t* kmp); #line 198 "kmp.c" kmp_status_t kmp_result_free (kmp_result_t* r); #endif /* CFH_KMP_H */