projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Deal with double unlocks (which does happen sometimes)
[idzebra-moved-to-github.git]
/
recctrl
/
safari.c
diff --git
a/recctrl/safari.c
b/recctrl/safari.c
index
c524599
..
432b2dc
100644
(file)
--- a/
recctrl/safari.c
+++ b/
recctrl/safari.c
@@
-1,4
+1,4
@@
-/* $Id: safari.c,v 1.7 2005-03-31 12:42:07 adam Exp $
+/* $Id: safari.c,v 1.12 2006-05-10 08:13:31 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
Copyright (C) 1995-2005
Index Data ApS
@@
-39,9
+39,9
@@
static void *filter_init (Res res, RecType recType)
return tinfo;
}
return tinfo;
}
-static void filter_config(void *clientData, Res res, const char *args)
+static ZEBRA_RES filter_config(void *clientData, Res res, const char *args)
{
{
-
+ return ZEBRA_OK;
}
static void filter_destroy(void *clientData)
}
static void filter_destroy(void *clientData)
@@
-86,13
+86,16
@@
static int fi_getchar(struct fi_info *fi, char *dst)
static int fi_gets(struct fi_info *fi, char *dst, int max)
{
static int fi_gets(struct fi_info *fi, char *dst, int max)
{
- int l;
- for (l = 0; l < max; l++)
+ int l = 0;
+ while(1)
{
{
- if (!fi_getchar(fi, dst+l))
+ char dstbyte;
+ if (!fi_getchar(fi, &dstbyte))
return 0;
return 0;
- if (dst[l] == '\n')
+ if (dstbyte == '\n')
break;
break;
+ if (l < max)
+ dst[l++] = dstbyte;
}
dst[l] = '\0';
return 1;
}
dst[l] = '\0';
return 1;
@@
-123,7
+126,7
@@
static int filter_extract(void *clientData, struct recExtractCtrl *p)
return RECCTRL_EXTRACT_ERROR_GENERIC;
sscanf(line, "%255s", p->match_criteria);
return RECCTRL_EXTRACT_ERROR_GENERIC;
sscanf(line, "%255s", p->match_criteria);
- recWord.reg_type = 'w';
+ recWord.index_type = '0';
while (fi_gets(fi, line, sizeof(line)-1))
{
int nor = 0;
while (fi_gets(fi, line, sizeof(line)-1))
{
int nor = 0;
@@
-141,7
+144,7
@@
static int filter_extract(void *clientData, struct recExtractCtrl *p)
}
for (cp = line + nor; *cp == ' '; cp++)
;
}
for (cp = line + nor; *cp == ' '; cp++)
;
- recWord.attrStr = field;
+ recWord.index_name = field;
recWord.term_buf = cp;
recWord.term_len = strlen(cp);
(*p->tokenAdd)(&recWord);
recWord.term_buf = cp;
recWord.term_len = strlen(cp);
(*p->tokenAdd)(&recWord);
@@
-266,3
+269,11
@@
idzebra_filter
&filter_type,
0,
};
&filter_type,
0,
};
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+