X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=include%2Fdfa.h;h=77f57e0ca5f77022e9f40452c95000f093435b9b;hp=b609433a7949d48e4b6a7128988d793079382040;hb=11d386bdb7b6b4a9bba10da749a5770b509c1fbd;hpb=65615b66e805376b23f24a51e7d048f4f58e6525 diff --git a/include/dfa.h b/include/dfa.h index b609433..77f57e0 100644 --- a/include/dfa.h +++ b/include/dfa.h @@ -1,32 +1,31 @@ -/* - * Copyright (C) 1994, Index Data I/S - * All rights reserved. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: dfa.h,v $ - * Revision 1.5 1996-01-08 09:09:48 adam - * Function dfa_parse got 'const' string argument. - * - * Revision 1.4 1995/01/25 11:31:04 adam - * Simple error reporting when parsing regular expressions. - * - * Revision 1.3 1995/01/24 16:01:30 adam - * Added -ansi to CFLAGS. - * New functions and change of data structures. - * - * Revision 1.2 1994/09/26 16:31:23 adam - * Minor changes. xmalloc declares xcalloc now. - * - * Revision 1.1 1994/09/26 10:17:43 adam - * Dfa-module header files. - * - */ +/* This file is part of the Zebra server. + Copyright (C) 1994-2011 Index Data + +Zebra is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Zebra is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +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 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 + +#include + +YAZ_BEGIN_CDECL struct DFA_tran { unsigned char ch[2]; /* transition on ch[0] <= c <= ch[1] to */ @@ -44,7 +43,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 */ @@ -59,9 +58,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); @@ -94,4 +97,16 @@ extern unsigned short #define DFA_ERR_SYNTAX 1 #define DFA_ERR_LP 2 #define DFA_ERR_RP 3 + +YAZ_END_CDECL + #endif +/* + * Local variables: + * c-basic-offset: 4 + * c-file-style: "Stroustrup" + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +