2 * Copyright (C) 1994-1998, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.8 1999-11-30 13:48:03 adam
8 * Improved installation. Updated for inclusion of YAZ header files.
10 * Revision 1.7 1999/11/04 15:00:45 adam
11 * Implemented delete result set(s).
13 * Revision 1.6 1999/02/17 11:29:57 adam
14 * Fixed in record_fetch. Minor updates to API.
16 * Revision 1.5 1998/09/22 10:48:19 adam
17 * Minor changes in search API.
19 * Revision 1.4 1998/09/02 13:53:18 adam
20 * Extra parameter decode added to search routines to implement
23 * Revision 1.3 1998/06/22 11:36:48 adam
24 * Added authentication check facility to zebra.
26 * Revision 1.2 1998/06/13 00:14:09 adam
29 * Revision 1.1 1998/06/12 12:22:13 adam
36 #include <yaz/proto.h>
42 /* Retrieval Record Descriptor */
44 int errCode; /* non-zero if error when fetching this */
45 char *errString; /* error string */
46 int position; /* position of record in result set (1,2,..) */
47 char *buf; /* record buffer (void pointer really) */
49 oid_value format; /* record syntax */
51 } ZebraRetrievalRecord;
53 /* Scan Term Descriptor */
55 int occurrences; /* scan term occurrences */
56 char *term; /* scan term string */
59 typedef struct zebra_info *ZebraHandle;
61 /* Open Zebra using file 'configName' (usually zebra.cfg) */
62 YAZ_EXPORT ZebraHandle zebra_open (const char *configName);
64 /* Search using RPN-Query */
65 YAZ_EXPORT void zebra_search_rpn (ZebraHandle zh, ODR input, ODR output,
66 Z_RPNQuery *query, int num_bases, char **basenames,
69 /* Retrieve record(s) */
70 YAZ_EXPORT void zebra_records_retrieve (ZebraHandle zh, ODR stream,
71 const char *setname, Z_RecordComposition *comp,
72 oid_value input_format,
73 int num_recs, ZebraRetrievalRecord *recs);
76 YAZ_EXPORT void zebra_scan (ZebraHandle zh, ODR stream,
77 Z_AttributesPlusTerm *zapt,
78 oid_value attributeset,
79 int num_bases, char **basenames,
80 int *position, int *num_entries,
81 ZebraScanEntry **list,
84 /* Delete Result Set(s) */
85 YAZ_EXPORT int zebra_deleleResultSet(ZebraHandle zh, int function,
86 int num_setnames, char **setnames,
89 /* Close zebra and destroy handle */
90 YAZ_EXPORT void zebra_close (ZebraHandle zh);
93 YAZ_EXPORT int zebra_errCode (ZebraHandle zh);
94 /* string representatio of above */
95 YAZ_EXPORT const char *zebra_errString (ZebraHandle zh);
97 /* extra information associated with error */
98 YAZ_EXPORT char *zebra_errAdd (ZebraHandle zh);
100 /* number of hits (after search) */
101 YAZ_EXPORT int zebra_hits (ZebraHandle zh);
103 /* do authentication */
104 YAZ_EXPORT int zebra_auth (ZebraHandle zh, const char *user, const char *pass);