Source
1
+
// SPDX-License-Identifier: GPL-2.0-or-later
1
2
/*
2
3
* lib/ts_fsm.c A naive finite state machine text search approach
3
4
*
4
-
* This program is free software; you can redistribute it and/or
5
-
* modify it under the terms of the GNU General Public License
6
-
* as published by the Free Software Foundation; either version
7
-
* 2 of the License, or (at your option) any later version.
8
-
*
9
5
* Authors: Thomas Graf <tgraf@suug.ch>
10
6
*
11
7
* ==========================================================================
12
8
*
13
9
* A finite state machine consists of n states (struct ts_fsm_token)
14
10
* representing the pattern as a finite automaton. The data is read
15
11
* sequentially on an octet basis. Every state token specifies the number
16
12
* of recurrences and the type of value accepted which can be either a
17
13
* specific character or ctype based set of characters. The available
18
14
* type of recurrences include 1, (0|1), [0 n], and [1 n].