Renamed include/set.h to include/dfaset.h.
Using YAZ_BEGIN_CDECL for public headers.
Removed str.h . It is not used anywhere.
-## $Id: Makefile.am,v 1.19 2004-09-30 06:59:44 adam Exp $
+## $Id: Makefile.am,v 1.20 2005-01-15 21:45:42 adam Exp $
AUTOMAKE_OPTIONS=foreign
SPEC_FILE=$(PACKAGE).spec
EXTRA_DIST= README NEWS $(SPEC_FILE) idzebra.spec.in \
- idzebra-config.in idzebra.m4
+ idzebra-config.in idzebra.m4 Doxyfile.in
dist-hook:
cp $(srcdir)/LICENSE* $(distdir)
-/* $Id: dfa.c,v 1.32 2005-01-15 19:38:18 adam Exp $
+/* $Id: dfa.c,v 1.33 2005-01-15 21:45:42 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
} u;
unsigned pos : 15; /* CAT/OR/STAR/EPSILON or non-neg. position */
unsigned nullable : 1;
- Set firstpos; /* first positions */
- Set lastpos; /* last positions */
+ DFASet firstpos; /* first positions */
+ DFASet lastpos; /* last positions */
};
struct Tblock { /* Tnode bucket (block) */
init_pos (struct DFA_parse *parse_info),
del_pos (struct DFA_parse *parse_info),
mk_dfa_tran (struct DFA_parse *parse_info, struct DFA_states *dfas),
- add_follow (struct DFA_parse *parse_info, Set lastpos, Set firstpos),
+ add_follow (struct DFA_parse *parse_info, DFASet lastpos, DFASet firstpos),
dfa_trav (struct DFA_parse *parse_info, struct Tnode *n),
init_followpos (struct DFA_parse *parse_info),
pr_tran (struct DFA_parse *parse_info, struct DFA_states *dfas),
}
static void add_follow (struct DFA_parse *parse_info,
- Set lastpos, Set firstpos)
+ DFASet lastpos, DFASet firstpos)
{
while (lastpos)
{
parse_info->followpos[lastpos->value] =
- union_Set (parse_info->poset,
+ union_DFASet (parse_info->poset,
parse_info->followpos[lastpos->value], firstpos);
lastpos = lastpos->next;
}
static void dfa_trav (struct DFA_parse *parse_info, struct Tnode *n)
{
struct Tnode **posar = parse_info->posar;
- SetType poset = parse_info->poset;
+ DFASetType poset = parse_info->poset;
switch (n->pos)
{
dfa_trav (parse_info, n->u.p[0]);
dfa_trav (parse_info, n->u.p[1]);
n->nullable = n->u.p[0]->nullable & n->u.p[1]->nullable;
- n->firstpos = mk_Set (poset);
- n->firstpos = union_Set (poset, n->firstpos, n->u.p[0]->firstpos);
+ n->firstpos = mk_DFASet (poset);
+ n->firstpos = union_DFASet (poset, n->firstpos, n->u.p[0]->firstpos);
if (n->u.p[0]->nullable)
- n->firstpos = union_Set (poset, n->firstpos, n->u.p[1]->firstpos);
- n->lastpos = mk_Set (poset);
- n->lastpos = union_Set (poset, n->lastpos, n->u.p[1]->lastpos);
+ n->firstpos = union_DFASet (poset, n->firstpos, n->u.p[1]->firstpos);
+ n->lastpos = mk_DFASet (poset);
+ n->lastpos = union_DFASet (poset, n->lastpos, n->u.p[1]->lastpos);
if (n->u.p[1]->nullable)
- n->lastpos = union_Set (poset, n->lastpos, n->u.p[0]->lastpos);
+ n->lastpos = union_DFASet (poset, n->lastpos, n->u.p[0]->lastpos);
add_follow (parse_info, n->u.p[0]->lastpos, n->u.p[1]->firstpos);
- n->u.p[0]->firstpos = rm_Set (poset, n->u.p[0]->firstpos);
- n->u.p[0]->lastpos = rm_Set (poset, n->u.p[0]->lastpos);
- n->u.p[1]->firstpos = rm_Set (poset, n->u.p[1]->firstpos);
- n->u.p[1]->lastpos = rm_Set (poset, n->u.p[1]->lastpos);
+ n->u.p[0]->firstpos = rm_DFASet (poset, n->u.p[0]->firstpos);
+ n->u.p[0]->lastpos = rm_DFASet (poset, n->u.p[0]->lastpos);
+ n->u.p[1]->firstpos = rm_DFASet (poset, n->u.p[1]->firstpos);
+ n->u.p[1]->lastpos = rm_DFASet (poset, n->u.p[1]->lastpos);
if (debug_dfa_trav)
printf ("CAT");
break;
dfa_trav (parse_info, n->u.p[1]);
n->nullable = n->u.p[0]->nullable | n->u.p[1]->nullable;
- n->firstpos = merge_Set (poset, n->u.p[0]->firstpos,
+ n->firstpos = merge_DFASet (poset, n->u.p[0]->firstpos,
n->u.p[1]->firstpos);
- n->lastpos = merge_Set (poset, n->u.p[0]->lastpos,
+ n->lastpos = merge_DFASet (poset, n->u.p[0]->lastpos,
n->u.p[1]->lastpos);
- n->u.p[0]->firstpos = rm_Set (poset, n->u.p[0]->firstpos);
- n->u.p[0]->lastpos = rm_Set (poset, n->u.p[0]->lastpos);
- n->u.p[1]->firstpos = rm_Set (poset, n->u.p[1]->firstpos);
- n->u.p[1]->lastpos = rm_Set (poset, n->u.p[1]->lastpos);
+ n->u.p[0]->firstpos = rm_DFASet (poset, n->u.p[0]->firstpos);
+ n->u.p[0]->lastpos = rm_DFASet (poset, n->u.p[0]->lastpos);
+ n->u.p[1]->firstpos = rm_DFASet (poset, n->u.p[1]->firstpos);
+ n->u.p[1]->lastpos = rm_DFASet (poset, n->u.p[1]->lastpos);
if (debug_dfa_trav)
printf ("OR");
break;
break;
case EPSILON:
n->nullable = 1;
- n->lastpos = mk_Set (poset);
- n->firstpos = mk_Set (poset);
+ n->lastpos = mk_DFASet (poset);
+ n->firstpos = mk_DFASet (poset);
if (debug_dfa_trav)
printf ("EPSILON");
break;
default:
posar[n->pos] = n;
n->nullable = 0;
- n->firstpos = mk_Set (poset);
- n->firstpos = add_Set (poset, n->firstpos, n->pos);
- n->lastpos = mk_Set (poset);
- n->lastpos = add_Set (poset, n->lastpos, n->pos);
+ n->firstpos = mk_DFASet (poset);
+ n->firstpos = add_DFASet (poset, n->firstpos, n->pos);
+ n->lastpos = mk_DFASet (poset);
+ n->lastpos = add_DFASet (poset, n->lastpos, n->pos);
if (debug_dfa_trav)
{
if (n->u.ch[0] < 0)
{
printf ("\n nullable : %c\n", n->nullable ? '1' : '0');
printf (" firstpos :");
- pr_Set (poset, n->firstpos);
+ pr_DFASet (poset, n->firstpos);
printf (" lastpos :");
- pr_Set (poset, n->lastpos);
+ pr_DFASet (poset, n->lastpos);
}
}
static void init_followpos (struct DFA_parse *parse_info)
{
- Set *fa;
+ DFASet *fa;
int i;
parse_info->followpos = fa =
- (Set *) imalloc (sizeof(Set) * (1+parse_info->position));
+ (DFASet *) imalloc (sizeof(DFASet) * (1+parse_info->position));
for (i = parse_info->position+1; --i >= 0; fa++)
- *fa = mk_Set (parse_info->poset);
+ *fa = mk_DFASet (parse_info->poset);
}
static void mk_dfa_tran (struct DFA_parse *parse_info, struct DFA_states *dfas)
int i, j, c;
int max_char;
short *pos, *pos_i;
- Set tran_set;
+ DFASet tran_set;
int char_0, char_1;
struct DFA_state *dfa_from, *dfa_to;
struct Tnode **posar;
- SetType poset;
- Set *followpos;
+ DFASetType poset;
+ DFASet *followpos;
assert (parse_info);
max_char = parse_info->charset->size;
pos = (short *) imalloc (sizeof(*pos) * (parse_info->position+1));
- tran_set = cp_Set (parse_info->poset, parse_info->root->firstpos);
+ tran_set = cp_DFASet (parse_info->poset, parse_info->root->firstpos);
i = add_DFA_state (dfas, &tran_set, &dfa_from);
assert (i);
dfa_from->rule_no = 0;
char_1 = max_char;
- tran_set = mk_Set (poset);
+ tran_set = mk_DFASet (poset);
for (pos_i = pos; (i = *pos_i) != -1; ++pos_i)
{
if ((c=posar[i]->u.ch[0]) > char_0 && c <= char_1)
else if ((c=posar[i]->u.ch[1]) >= char_0 && c < char_1)
char_1 = c; /* backward chunk */
if (posar[i]->u.ch[1] >= char_0 && posar[i]->u.ch[0] <= char_0)
- tran_set = union_Set (poset, tran_set, followpos[i]);
+ tran_set = union_DFASet (poset, tran_set, followpos[i]);
}
if (tran_set)
{
printf (" #%d", s->rule_nno);
putchar (':');
- pr_Set (parse_info->poset, s->set);
+ pr_DFASet (parse_info->poset, s->set);
prev_no = -1;
for (i=s->tran_no, tran=s->trans; --i >= 0; tran++)
{
k = inf_BSetHandle (parse_info->charset, &i, &j);
printf ("%ld/%ld character sets, %d bytes each\n",
i/k, j/k, k*sizeof(BSetWord));
- k = inf_SetType (parse_info->poset, &i, &j);
+ 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);
}
for (i=1; i <= parse_info->position; i++)
{
printf ("%3d:", i);
- pr_Set (parse_info->poset, parse_info->followpos[i]);
+ pr_DFASet (parse_info->poset, parse_info->followpos[i]);
putchar ('\t');
if (posar[i]->u.ch[0] < 0)
assert (poset_chunk > 10);
assert (dfap);
- parse_info->poset = mk_SetType (poset_chunk);
+ parse_info->poset = mk_DFASetType (poset_chunk);
init_pos(parse_info);
init_followpos(parse_info);
assert (parse_info->root);
pr_verbose (parse_info, dfas);
del_pos(parse_info);
del_followpos(parse_info);
- rm_SetType (parse_info->poset);
+ rm_DFASetType (parse_info->poset);
return dfas;
}
-/* $Id: dfap.h,v 1.11 2005-01-15 19:38:18 adam Exp $
+/* $Id: dfap.h,v 1.12 2005-01-15 21:45:42 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
struct Tnode **posar;
- SetType poset;
- Set *followpos;
+ DFASetType poset;
+ DFASet *followpos;
const char **(*cmap)(void *vp, const char **from, int len);
};
struct DFA_state *marked; /* chain of marked DFA states */
DFA_stateb *statemem; /* state memory */
int no; /* no of states (unmarked+marked) */
- SetType st; /* Position set type */
+ DFASetType st; /* Position set type */
int hash; /* no hash entries in hasharray */
struct DFA_state **hasharray; /* hash pointers */
struct DFA_state **sortarray; /* sorted DFA states */
struct DFA_trans *transmem; /* transition memory */
};
-int init_DFA_states (struct DFA_states **dfasp, SetType st, int hash);
+int init_DFA_states (struct DFA_states **dfasp, DFASetType st, int hash);
int rm_DFA_states (struct DFA_states **dfasp);
-int add_DFA_state (struct DFA_states *dfas, Set *s,
+int add_DFA_state (struct DFA_states *dfas, DFASet *s,
struct DFA_state **sp);
struct DFA_state *get_DFA_state (struct DFA_states *dfas);
void sort_DFA_states (struct DFA_states *dfas);
-/* $Id: set.c,v 1.9 2005-01-15 19:38:19 adam Exp $
+/* $Id: set.c,v 1.10 2005-01-15 21:45:42 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
#include <stdlib.h>
#include <string.h>
-#include <set.h>
+#include <dfaset.h>
#include "imalloc.h"
+static DFASet mk_DFASetElement (DFASetType st, int n);
-static Set mk_SetElement (SetType st, int n);
-
-SetType mk_SetType (int chunk)
+DFASetType mk_DFASetType (int chunk)
{
- SetType st;
+ DFASetType st;
assert (chunk > 8 && chunk < 8000);
- st = (SetType) imalloc (sizeof(*st));
+ st = (DFASetType) imalloc (sizeof(*st));
assert (st);
st->alloclist = st->freelist = NULL;
return st;
}
-int inf_SetType (SetType st, long *used, long *allocated)
+int inf_DFASetType (DFASetType st, long *used, long *allocated)
{
- Set s;
+ DFASet s;
assert (st);
*used = st->used;
*allocated = 0;
for (s = st->alloclist; s; s = s->next)
*allocated += st->chunk;
- return sizeof (SetElement);
+ return sizeof (DFASetElement);
}
-SetType rm_SetType (SetType st)
+DFASetType rm_DFASetType (DFASetType st)
{
- Set s, s1;
+ DFASet s, s1;
for (s = st->alloclist; (s1 = s);)
{
s = s->next;
return NULL;
}
-Set mk_Set (SetType st)
+DFASet mk_DFASet (DFASetType st)
{
assert (st);
return NULL;
}
-static Set mk_SetElement (SetType st, int n)
+static DFASet mk_DFASetElement (DFASetType st, int n)
{
- Set s;
+ DFASet s;
int i;
assert (st);
assert (st->chunk > 8);
if (! st->freelist)
{
- s = (Set) imalloc (sizeof(*s) * (1+st->chunk));
+ s = (DFASet) imalloc (sizeof(*s) * (1+st->chunk));
assert (s);
s->next = st->alloclist;
st->alloclist = s;
}
#if 0
-static void rm_SetElement (SetType st, SetElement *p)
+static void rm_DFASetElement (DFASetType st, DFASetElement *p)
{
assert (st);
assert (st->used > 0);
}
#endif
-Set rm_Set (SetType st, Set s)
+DFASet rm_DFASet (DFASetType st, DFASet s)
{
- Set s1 = s;
+ DFASet s1 = s;
int i = 1;
if (s)
return NULL;
}
-Set add_Set (SetType st, Set s, int n)
+DFASet add_DFASet (DFASetType st, DFASet s, int n)
{
- SetElement dummy;
- Set p = &dummy, snew;
+ DFASetElement dummy;
+ DFASet p = &dummy, snew;
p->next = s;
while (p->next && p->next->value < n)
p = p->next;
assert (p);
if (!(p->next && p->next->value == n))
{
- snew = mk_SetElement (st, n);
+ snew = mk_DFASetElement (st, n);
snew->next = p->next;
p->next = snew;
}
return dummy.next;
}
-Set union_Set (SetType st, Set s1, Set s2)
+DFASet union_DFASet (DFASetType st, DFASet s1, DFASet s2)
{
- SetElement dummy;
- Set p;
+ DFASetElement dummy;
+ DFASet p;
assert (st);
for (p = &dummy; s1 && s2;)
}
else if (s1->value > s2->value)
{
- p = p->next = mk_SetElement (st, s2->value);
+ p = p->next = mk_DFASetElement (st, s2->value);
s2 = s2->next;
}
else
{
while (s2)
{
- p = p->next = mk_SetElement (st, s2->value);
+ p = p->next = mk_DFASetElement (st, s2->value);
s2 = s2->next;
}
p->next = NULL;
return dummy.next;
}
-Set cp_Set (SetType st, Set s)
+DFASet cp_DFASet (DFASetType st, DFASet s)
{
- return merge_Set (st, s, NULL);
+ return merge_DFASet (st, s, NULL);
}
-Set merge_Set (SetType st, Set s1, Set s2)
+DFASet merge_DFASet (DFASetType st, DFASet s1, DFASet s2)
{
- SetElement dummy;
- Set p;
+ DFASetElement dummy;
+ DFASet p;
assert (st);
for (p = &dummy; s1 && s2; p = p->next)
if (s1->value < s2->value)
{
- p->next = mk_SetElement (st, s1->value);
+ p->next = mk_DFASetElement (st, s1->value);
s1 = s1->next;
}
else if (s1->value > s2->value)
{
- p->next = mk_SetElement (st, s2->value);
+ p->next = mk_DFASetElement (st, s2->value);
s2 = s2->next;
}
else
{
- p->next = mk_SetElement (st, s1->value);
+ p->next = mk_DFASetElement (st, s1->value);
s1 = s1->next;
s2 = s2->next;
}
s1 = s2;
while (s1)
{
- p = p->next = mk_SetElement (st, s1->value);
+ p = p->next = mk_DFASetElement (st, s1->value);
s1 = s1->next;
}
p->next = NULL;
return dummy.next;
}
-void pr_Set (SetType st, Set s)
+void pr_DFASet (DFASetType st, DFASet s)
{
assert (st);
while (s)
putchar ('\n');
}
-unsigned hash_Set (SetType st, Set s)
+unsigned hash_DFASet (DFASetType st, DFASet s)
{
unsigned n = 0;
while (s)
return n;
}
-int eq_Set (SetType st, Set s1, Set s2)
+int eq_DFASet (DFASetType st, DFASet s1, DFASet s2)
{
for (; s1 && s2; s1=s1->next, s2=s2->next)
if (s1->value != s2->value)
-/* $Id: states.c,v 1.8 2005-01-15 19:38:19 adam Exp $
+/* $Id: states.c,v 1.9 2005-01-15 21:45:42 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
#define DFA_CHUNK 40
#define TRAN_CHUNK 100
-int init_DFA_states (struct DFA_states **dfasp, SetType st, int hash)
+int init_DFA_states (struct DFA_states **dfasp, DFASetType st, int hash)
{
struct DFA_states *dfas;
struct DFA_trans *tm;
return 0;
}
-int add_DFA_state (struct DFA_states *dfas, Set *s, struct DFA_state **sp)
+int add_DFA_state (struct DFA_states *dfas, DFASet *s, struct DFA_state **sp)
{
int i;
struct DFA_state *si, **sip;
assert (dfas);
assert (*s);
assert (dfas->hasharray);
- sip = dfas->hasharray + (hash_Set (dfas->st, *s) % dfas->hash);
+ sip = dfas->hasharray + (hash_DFASet (dfas->st, *s) % dfas->hash);
for (si = *sip; si; si=si->link)
- if (eq_Set (dfas->st, si->set, *s))
+ if (eq_DFASet (dfas->st, si->set, *s))
{
*sp = si;
- *s = rm_Set (dfas->st, *s);
+ *s = rm_DFASet (dfas->st, *s);
return 0;
}
if (!dfas->freelist)
-# $Id: Makefile.am,v 1.20 2004-12-08 14:02:36 adam Exp $
+# $Id: Makefile.am,v 1.21 2005-01-15 21:45:42 adam Exp $
noinst_HEADERS = bset.h charmap.h \
direntz.h passwddb.h dfa.h zebra_xpath.h d1_absyn.h \
-rset.h set.h sortidx.h str.h zebra-lock.h zebrautl.h
+rset.h dfaset.h sortidx.h zebra-lock.h zebrautl.h
SUBDIRS = idzebra
-/* $Id: bset.h,v 1.5 2005-01-15 19:38:24 adam Exp $
+/* $Id: bset.h,v 1.6 2005-01-15 21:45:42 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
02111-1307, USA.
*/
-
#ifndef BSET_H
#define BSET_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <yaz/yconfig.h>
+
+YAZ_BEGIN_CDECL
typedef unsigned short BSetWord;
typedef BSetWord *BSet;
int eq_BSet (BSetHandle *sh, BSet dst, BSet src);
void pr_charBSet (BSetHandle *sh, BSet src, void (*f)(int));
-#ifdef __cplusplus
-}
-#endif
+YAZ_END_CDECL
#endif
-/* $Id: dfa.h,v 1.11 2005-01-15 19:38:24 adam Exp $
+/* $Id: dfa.h,v 1.12 2005-01-15 21:45:42 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
02111-1307, USA.
*/
-
-
#ifndef DFA_H
#define DFA_H
#include <bset.h>
-#include <set.h>
+#include <dfaset.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <yaz/yconfig.h>
+
+YAZ_BEGIN_CDECL
struct DFA_tran {
unsigned char ch[2]; /* transition on ch[0] <= c <= ch[1] to */
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 */
#define DFA_ERR_LP 2
#define DFA_ERR_RP 3
-#ifdef __cplusplus
-}
-#endif
+YAZ_END_CDECL
#endif
--- /dev/null
+/* $Id: dfaset.h,v 1.1 2005-01-15 21:45:42 adam Exp $
+ Copyright (C) 1995-2005
+ Index Data ApS
+
+This file is part of the Zebra server.
+
+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 Zebra; see the file LICENSE.zebra. If not, write to the
+Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+*/
+
+#ifndef DFASET_H
+#define DFASET_H
+
+#include <yaz/yconfig.h>
+
+YAZ_BEGIN_CDECL
+
+typedef struct DFASetElement_ {
+ struct DFASetElement_ *next;
+ int value;
+} DFASetElement, *DFASet;
+
+typedef struct {
+ DFASet alloclist;
+ DFASet freelist;
+ long used;
+ int chunk;
+} *DFASetType;
+
+DFASetType mk_DFASetType (int chunk);
+int inf_DFASetType(DFASetType st, long *used, long *allocated);
+DFASetType rm_DFASetType (DFASetType st);
+DFASet mk_DFASet (DFASetType st);
+DFASet add_DFASet (DFASetType st, DFASet s, int value);
+DFASet merge_DFASet (DFASetType st, DFASet s1, DFASet s2);
+DFASet union_DFASet (DFASetType st, DFASet s1, DFASet s2);
+DFASet rm_DFASet (DFASetType st, DFASet s);
+DFASet cp_DFASet (DFASetType st, DFASet s);
+void pr_DFASet (DFASetType st, DFASet s);
+unsigned hash_DFASet (DFASetType st, DFASet s);
+int eq_DFASet (DFASetType s, DFASet s1, DFASet s2);
+
+YAZ_END_CDECL
+#endif
+
-/* $Id: direntz.h,v 1.9 2005-01-15 19:38:24 adam Exp $
+/* $Id: direntz.h,v 1.10 2005-01-15 21:45:42 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
02111-1307, USA.
*/
-
-
-
#ifdef WIN32
/* make WIN32 version of dirent */
#include <windows.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <yaz/yconfig.h>
+
+YAZ_BEGIN_CDECL
struct dirent {
char d_name[MAX_PATH];
struct dirent *readdir (DIR *dd);
void closedir (DIR *dd);
-#ifdef __cplusplus
-}
-#endif
+YAZ_ENC_CDECL
#else
/* include UNIX version */
-/* $Id: api.h,v 1.6 2005-01-15 19:38:24 adam Exp $
+/* $Id: api.h,v 1.7 2005-01-15 21:45:43 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
02111-1307, USA.
*/
+/**
+ * \file api.h
+ * \brief Zebra API
+ */
+
/* Return codes:
* Most functions return an int. Unix-like, 0 means OK,
* non-zero means an error. The error info should be available
#include <idzebra/res.h>
#include <idzebra/version.h>
-/* Fixme! Compare string (ignore case) */
-#ifdef WIN32
-#define STRCASECMP stricmp
-#else
-#define STRCASECMP strcasecmp
-#endif
-
YAZ_BEGIN_CDECL
typedef struct {
-/* $Id: passwddb.h,v 1.5 2005-01-15 19:38:24 adam Exp $
+/* $Id: passwddb.h,v 1.6 2005-01-15 21:45:42 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
02111-1307, USA.
*/
-
-
#ifndef PASSWDDB_H
#define PASSWDDB_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <yaz/yconfig.h>
+
+YAZ_BEGIN_CDECL
typedef struct passwd_db *Passwd_db;
void passwd_db_close (Passwd_db db);
void passwd_db_show (Passwd_db db);
-#ifdef __cplusplus
-}
-#endif
+YAZ_END_CDECL
#endif
+++ /dev/null
-/* $Id: set.h,v 1.5 2005-01-15 19:38:24 adam Exp $
- Copyright (C) 1995-2005
- Index Data ApS
-
-This file is part of the Zebra server.
-
-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 Zebra; see the file LICENSE.zebra. If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-*/
-
-
-#ifndef SET_H
-#define SET_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct SetElement_ {
- struct SetElement_ *next;
- int value;
-} SetElement, *Set;
-
-typedef struct {
- Set alloclist;
- Set freelist;
- long used;
- int chunk;
-} *SetType;
-
-SetType mk_SetType (int chunk);
-int inf_SetType (SetType st, long *used, long *allocated);
-SetType rm_SetType (SetType st);
-Set mk_Set (SetType st);
-Set add_Set (SetType st, Set s, int value);
-Set merge_Set (SetType st, Set s1, Set s2);
-Set union_Set (SetType st, Set s1, Set s2);
-Set rm_Set (SetType st, Set s);
-Set cp_Set (SetType st, Set s);
-void pr_Set (SetType st, Set s);
-unsigned hash_Set (SetType st, Set s);
-int eq_Set (SetType s, Set s1, Set s2);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-/* $Id: sortidx.h,v 1.7 2005-01-15 19:38:24 adam Exp $
+/* $Id: sortidx.h,v 1.8 2005-01-15 21:45:42 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
#ifndef SORTIDX_H
#define SORTIDX_H
+#include <yaz/yconfig.h>
#include <idzebra/version.h>
#include <idzebra/bfile.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+YAZ_BEGIN_CDECL
#define SORT_IDX_ENTRYSIZE 64
void sortIdx_add (SortIdx si, const char *buf, int len);
void sortIdx_read (SortIdx si, char *buf);
-#ifdef __cplusplus
-}
-#endif
+YAZ_END_CDECL
#endif
+++ /dev/null
-/* $Id: str.h,v 1.6 2005-01-15 19:38:24 adam Exp $
- Copyright (C) 1995-2005
- Index Data ApS
-
-This file is part of the Zebra server.
-
-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 Zebra; see the file LICENSE.zebra. If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
-*/
-
-
-
-#ifndef STR_H
-#define STR_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct str_index
-{
- int size;
- char *data;
-} str_index;
-
-typedef struct strings_data
-{
- str_index *index;
- int num_index;
- char *bulk;
-} strings_data, *STRINGS;
-
-STRINGS str_open(char *lang, char *name);
-void str_close(STRINGS st);
-char *str(STRINGS st, int num);
-char *strf(STRINGS st, int num, ...);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/* $Id: zinfo.h,v 1.20 2005-01-15 19:38:29 adam Exp $
+/* $Id: zinfo.h,v 1.21 2005-01-15 21:45:43 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
#include <idzebra/api.h>
#include "recindex.h"
+/* Compare string (ignore case) */
+#ifdef WIN32
+#define STRCASECMP stricmp
+#else
+#define STRCASECMP strcasecmp
+#endif
+
YAZ_BEGIN_CDECL
typedef struct zebraExplainInfo *ZebraExplainInfo;