-/* $Id: regxread.c,v 1.57 2005-01-16 23:14:57 adam Exp $
+/* $Id: regxread.c,v 1.62 2006-06-13 19:45:14 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
#include <ctype.h>
#include <yaz/tpath.h>
-#include <zebrautl.h>
+#include <idzebra/util.h>
#include <dfa.h>
#include <idzebra/recgrs.h>
r = dfa_parse ((*ap)->u.pattern.dfa, &s);
if (r || *s != '/')
{
+ int pos = s - s0;
xfree (*ap);
*ap = NULL;
- yaz_log (YLOG_WARN, "regular expression error '%.*s'", s-s0, s0);
+ yaz_log(YLOG_WARN, "regular expression error '%.*s'", pos, s0);
return -1;
}
- if (debug_dfa_tran)
- printf ("pattern: %.*s\n", s-s0, s0);
- dfa_mkstate ((*ap)->u.pattern.dfa);
- s++;
+ else
+ {
+ int pos = s - s0;
+ if (debug_dfa_tran)
+ printf("pattern: %.*s\n", pos, s0);
+ dfa_mkstate((*ap)->u.pattern.dfa);
+ s++;
+ }
break;
case REGX_BEGIN:
yaz_log (YLOG_WARN, "cannot use BEGIN here");
}
-void grs_config(void *clientData, Res res, const char *args)
+ZEBRA_RES grs_config(void *clientData, Res res, const char *args)
{
struct lexSpecs *specs = (struct lexSpecs *) clientData;
if (strlen(args) < sizeof(specs->type))
strcpy(specs->type, args);
+ return ZEBRA_OK;
}
data1_node *grs_read_regx (struct grs_read_info *p)
}
static struct recType regx_type = {
+ 0,
"grs.regx",
grs_init,
grs_config,
}
static struct recType tcl_type = {
+ 0,
"grs.tcl",
grs_init,
grs_config,
#endif
0,
};
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+