main machine.h
 1#ifndef MACHINE_H
 2#define MACHINE_H
 3
 4struct state {
 5	char s_char;
 6	char s_endstate;
 7	struct state *s_match;
 8	struct state *s_next;
 9	short s_cnt;
10};
11
12#define FSM_OKE 0
13#define FSM_ISPREFIX -1
14#define FSM_HASPREFIX 1
15
16int addstring(char *str, int cnt, struct state **mach);
17int match(char *str, int *p_int, struct state *mach);
18
19#endif