/* 字符串快速搜索 */
#include <linux/types.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ctype.h>
#define MAX_CHAR 256
#define SIZE 256
#define MAX(x, y) (x) > (y) ? (x) : (y)
int BM(char *p, int m, char *text, int n);
#include "bm.h"
static void PBB(char *p, int m, int bB[])
{
int i;
for (i = 0; i < MAX_CHAR; i++)
{
bB[i] = m;
}
for (i = 0; i < m - 1; i++)
{
bB[p[i]] = m - 1 - i;
}
}
static void SUF(char *p, int m, int suf[])
{
int f, g, i;
suf[m - 1] = m;
g = m - 1;
for (i = m - 2; i >= 0; --i) {
if (i &