-/* $Id: grepper.c,v 1.17 2007-01-15 15:10:15 adam Exp $
- Copyright (C) 1995-2007
- Index Data ApS
-
-This file is part of the Zebra server.
+/* This file is part of the Zebra server.
+ Copyright (C) 2004-2013 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
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#define INFBUF_SIZE 16384
-#define INLINE
+#define INLINE
static INLINE void set_bit (MatchContext *mc, MatchWord *m, int ch, int state)
{
mc->n = (dfa->no_states+WORD_BITS) / WORD_BITS;
mc->range = range;
mc->Sc = icalloc (sizeof(*mc->Sc) * 256 * mc->n);
-
+
for (i=0; i<dfa->no_states; i++)
{
int j;
int ch0 = state->trans[j].ch[0];
int ch1 = state->trans[j].ch[1];
assert (ch0 >= 0 && ch1 >= 0);
-
+
for (ch = ch0; ch <= ch1; ch++)
set_bit (mc, mc->Sc, ch, i);
}
while ((ch = getc (inf)) != EOF)
{
MatchWord *Rj_t;
-
+
infbuf[inf_ptr] = ch;
if (ch == '\n')
{
}
else
inf = stdin;
-
+
mc = mk_MatchContext (dfa, range);
go (mc, dfa, inf);
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab