Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3163
b: refs/heads/master
c: 6408f79
h: refs/heads/master
i:
  3161: f5e177d
  3159: b3e8061
v: v3
  • Loading branch information
Thomas Graf authored and David S. Miller committed Jun 24, 2005
1 parent 7b4c89b commit acffebc
Show file tree
Hide file tree
Showing 5 changed files with 399 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: df3fb93ad9ec0b20c785c0ad82d42d159a1af272
refs/heads/master: 6408f79cce401e1bfecf923e7156f84f96e021e3
48 changes: 48 additions & 0 deletions trunk/include/linux/textsearch_fsm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#ifndef __LINUX_TEXTSEARCH_FSM_H
#define __LINUX_TEXTSEARCH_FSM_H

#include <linux/types.h>

enum {
TS_FSM_SPECIFIC, /* specific character */
TS_FSM_WILDCARD, /* any character */
TS_FSM_DIGIT, /* isdigit() */
TS_FSM_XDIGIT, /* isxdigit() */
TS_FSM_PRINT, /* isprint() */
TS_FSM_ALPHA, /* isalpha() */
TS_FSM_ALNUM, /* isalnum() */
TS_FSM_ASCII, /* isascii() */
TS_FSM_CNTRL, /* iscntrl() */
TS_FSM_GRAPH, /* isgraph() */
TS_FSM_LOWER, /* islower() */
TS_FSM_UPPER, /* isupper() */
TS_FSM_PUNCT, /* ispunct() */
TS_FSM_SPACE, /* isspace() */
__TS_FSM_TYPE_MAX,
};
#define TS_FSM_TYPE_MAX (__TS_FSM_TYPE_MAX - 1)

enum {
TS_FSM_SINGLE, /* 1 occurrence */
TS_FSM_PERHAPS, /* 1 or 0 occurrence */
TS_FSM_ANY, /* 0..n occurrences */
TS_FSM_MULTI, /* 1..n occurrences */
TS_FSM_HEAD_IGNORE, /* 0..n ignored occurrences at head */
__TS_FSM_RECUR_MAX,
};
#define TS_FSM_RECUR_MAX (__TS_FSM_RECUR_MAX - 1)

/**
* struct ts_fsm_token - state machine token (state)
* @type: type of token
* @recur: number of recurrences
* @value: character value for TS_FSM_SPECIFIC
*/
struct ts_fsm_token
{
__u16 type;
__u8 recur;
__u8 value;
};

#endif
11 changes: 11 additions & 0 deletions trunk/lib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,15 @@ config TEXTSEARCH_KMP
To compile this code as a module, choose M here: the
module will be called ts_kmp.

config TEXTSEARCH_FSM
depends on TEXTSEARCH
tristate "Finite state machine"
help
Say Y here if you want to be able to search text using a
naive finite state machine approach implementing a subset
of regular expressions.

To compile this code as a module, choose M here: the
module will be called ts_fsm.

endmenu
1 change: 1 addition & 0 deletions trunk/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ obj-$(CONFIG_REED_SOLOMON) += reed_solomon/

lib-$(CONFIG_TEXTSEARCH) += textsearch.o
obj-$(CONFIG_TEXTSEARCH_KMP) += ts_kmp.o
obj-$(CONFIG_TEXTSEARCH_FSM) += ts_fsm.o

hostprogs-y := gen_crc32table
clean-files := crc32table.h
Expand Down
Loading

0 comments on commit acffebc

Please sign in to comment.