X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=include%2Fdfa.h;h=eceb0a6bf3bde0dfd72672cff43ec6e7ebbc80a3;hp=11cba992a25c7dd703b40a9c2186fddae675ee74;hb=e1be1f5267e2be257664ded166b6890e4f24db83;hpb=6c9fcd3b5d3108702fa1ffc92dab4ab6060f9a19 diff --git a/include/dfa.h b/include/dfa.h index 11cba99..eceb0a6 100644 --- a/include/dfa.h +++ b/include/dfa.h @@ -1,5 +1,5 @@ -/* $Id: dfa.h,v 1.11 2005-01-15 19:38:24 adam Exp $ - Copyright (C) 1995-2005 +/* $Id: dfa.h,v 1.16 2007-01-15 20:08:24 adam Exp $ + Copyright (C) 1995-2007 Index Data ApS This file is part of the Zebra server. @@ -15,22 +15,20 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with Zebra; see the file LICENSE.zebra. If not, write to the -Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. -*/ - +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ #ifndef DFA_H #define DFA_H #include -#include +#include -#ifdef __cplusplus -extern "C" { -#endif +#include + +YAZ_BEGIN_CDECL struct DFA_tran { unsigned char ch[2]; /* transition on ch[0] <= c <= ch[1] to */ @@ -48,7 +46,7 @@ struct DFA_state { struct DFA_state *next; /* next entry in free/unmarked/marked list */ struct DFA_state *link; /* link to next entry in hash chain */ struct DFA_tran *trans; /* transition list */ - Set set; /* set of positions (important nfa states) */ + DFASet set; /* set of positions (important nfa states) */ short no; /* no of this state */ short tran_no; /* no of transitions to other states */ short rule_no; /* if non-zero, this holds accept rule no */ @@ -63,11 +61,13 @@ struct DFA { }; struct DFA *dfa_init (void); +void dfa_anyset_includes_nl(struct DFA *dfa); void dfa_set_cmap (struct DFA *dfa, void *vp, const char **(*cmap)(void *vp, const char **from, int len)); int dfa_parse (struct DFA *, const char **); void dfa_mkstate (struct DFA *); void dfa_delete (struct DFA **); +int dfa_get_last_rule (struct DFA *); void dfa_parse_cmap_clean (struct DFA *d); void dfa_parse_cmap_new (struct DFA *d, const int *cmap); @@ -101,8 +101,14 @@ extern unsigned short #define DFA_ERR_LP 2 #define DFA_ERR_RP 3 -#ifdef __cplusplus -} -#endif +YAZ_END_CDECL #endif +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +