X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=dfa%2Fdfa.c;h=60c5e997e96a6ee85f32875869b48a1fb6c8d8ff;hb=e57a1c65b9630e5b93d254519090bd0875c1d3c9;hp=d58b303585c1257ced7548650c5a789ea49edb57;hpb=40e64fc6d452f02389a00e5c8004f895342099c2;p=idzebra-moved-to-github.git diff --git a/dfa/dfa.c b/dfa/dfa.c index d58b303..60c5e99 100644 --- a/dfa/dfa.c +++ b/dfa/dfa.c @@ -1,5 +1,5 @@ -/* $Id: dfa.c,v 1.33 2005-01-15 21:45:42 adam Exp $ - Copyright (C) 1995-2005 +/* $Id: dfa.c,v 1.38 2006-09-28 18:38:45 adam Exp $ + Copyright (C) 1995-2006 Index Data ApS This file is part of the Zebra server. @@ -15,9 +15,9 @@ 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 + */ @@ -28,7 +28,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include -#include +#include #include "dfap.h" #include "imalloc.h" @@ -876,11 +876,11 @@ static void pr_verbose (struct DFA_parse *parse_info, struct DFA_states *dfas) { long i, j; int k; - printf ("%d/%d tree nodes used, %d bytes each\n", - parse_info->use_Tnode, parse_info->max_Tnode, sizeof (struct Tnode)); + printf ("%d/%d tree nodes used, %ld bytes each\n", + parse_info->use_Tnode, parse_info->max_Tnode, (long) sizeof (struct Tnode)); k = inf_BSetHandle (parse_info->charset, &i, &j); - printf ("%ld/%ld character sets, %d bytes each\n", - i/k, j/k, k*sizeof(BSetWord)); + printf ("%ld/%ld character sets, %ld bytes each\n", + i/k, j/k, (long) k*sizeof(BSetWord)); k = inf_DFASetType (parse_info->poset, &i, &j); printf ("%ld/%ld poset items, %d bytes each\n", i, j, k); printf ("%d DFA states\n", dfas->no); @@ -1097,6 +1097,11 @@ void dfa_set_cmap (struct DFA *dfa, void *vp, dfa->parse_info->cmap_data = vp; } +int dfa_get_last_rule (struct DFA *dfa) +{ + return dfa->parse_info->rule; +} + int dfa_parse (struct DFA *dfa, const char **pattern) { struct Tnode *top; @@ -1151,3 +1156,11 @@ void dfa_delete (struct DFA **dfap) ifree (*dfap); *dfap = NULL; } +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +