/* See LICENSE file for copyright and license details. */ #ifndef LIBAUTOMATA_H #define LIBAUTOMATA_H #include /* Knuth–Morris–Pratt substring search (finds end of substring) */ typedef struct libautomata_kmp_automaton LIBAUTOMATA_KMP_AUTOMATON; void libautomata_reset_kmp_automaton(LIBAUTOMATA_KMP_AUTOMATON *automaton); LIBAUTOMATA_KMP_AUTOMATON *libautomata_clone_kmp_automaton(const LIBAUTOMATA_KMP_AUTOMATON *automaton); LIBAUTOMATA_KMP_AUTOMATON *libautomata_compile_kmp_automaton(const void *pattern, size_t length, size_t elemsize); void *libautomata_execute_kmp_automaton(const void *haystack, size_t length, LIBAUTOMATA_KMP_AUTOMATON *automaton); /* Morris–Pratt substring search (finds end of substring) */ typedef struct libautomata_mp_automaton LIBAUTOMATA_MP_AUTOMATON; void libautomata_reset_mp_automaton(LIBAUTOMATA_MP_AUTOMATON *automaton); LIBAUTOMATA_MP_AUTOMATON *libautomata_clone_mp_automaton(const LIBAUTOMATA_MP_AUTOMATON *automaton); LIBAUTOMATA_MP_AUTOMATON *libautomata_compile_mp_automaton(const void *pattern, size_t length, size_t elemsize); void *libautomata_execute_mp_automaton(const void *haystack, size_t length, LIBAUTOMATA_MP_AUTOMATON *automaton); #endif