2 * Copyright (C) 1994-1998, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.4 1998-09-02 13:53:18 adam
8 * Extra parameter decode added to search routines to implement
11 * Revision 1.3 1998/06/22 11:36:48 adam
12 * Added authentication check facility to zebra.
14 * Revision 1.2 1998/06/13 00:14:09 adam
17 * Revision 1.1 1998/06/12 12:22:13 adam
26 /* Retrieval Record Descriptor */
28 int errCode; /* non-zero if error when fetching this */
29 char *errString; /* error string */
30 int position; /* position of record in result set (1,2,..) */
31 char *buf; /* record buffer (void pointer really) */
33 oid_value format; /* record syntax */
35 } ZebraRetrievalRecord;
37 /* Scan Term Descriptor */
39 int occurrences; /* scan term occurrences */
40 char *term; /* scan term string */
43 typedef struct zebra_info *ZebraHandle;
45 /* Open Zebra using file 'configName' (usually zebra.cfg) */
46 YAZ_EXPORT ZebraHandle zebra_open (const char *configName);
48 /* Search using RPN-Query */
49 YAZ_EXPORT void zebra_search_rpn (ZebraHandle zh, ODR stream, ODR decode,
50 Z_RPNQuery *query, int num_bases, char **basenames,
53 /* Retrieve record(s) */
54 YAZ_EXPORT void zebra_records_retrieve (ZebraHandle zh, ODR stream,
55 const char *setname, Z_RecordComposition *comp,
56 oid_value input_format,
57 int num_recs, ZebraRetrievalRecord *recs);
60 YAZ_EXPORT void zebra_scan (ZebraHandle zh, ODR stream,
61 Z_AttributesPlusTerm *zapt,
62 oid_value attributeset,
63 int num_bases, char **basenames,
64 int *position, int *num_entries,
65 ZebraScanEntry **list,
68 /* Close zebra and destroy handle */
69 YAZ_EXPORT void zebra_close (ZebraHandle zh);
72 YAZ_EXPORT int zebra_errCode (ZebraHandle zh);
73 /* string representatio of above */
74 YAZ_EXPORT const char *zebra_errString (ZebraHandle zh);
76 /* extra information associated with error */
77 YAZ_EXPORT char *zebra_errAdd (ZebraHandle zh);
79 /* number of hits (after search) */
80 YAZ_EXPORT int zebra_hits (ZebraHandle zh);
82 /* do authentication */
83 YAZ_EXPORT int zebra_auth (ZebraHandle zh, const char *user, const char *pass);