2 * Copyright (C) 1994-1998, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.6 1999-02-17 11:29:57 adam
8 * Fixed in record_fetch. Minor updates to API.
10 * Revision 1.5 1998/09/22 10:48:19 adam
11 * Minor changes in search API.
13 * Revision 1.4 1998/09/02 13:53:18 adam
14 * Extra parameter decode added to search routines to implement
17 * Revision 1.3 1998/06/22 11:36:48 adam
18 * Added authentication check facility to zebra.
20 * Revision 1.2 1998/06/13 00:14:09 adam
23 * Revision 1.1 1998/06/12 12:22:13 adam
36 /* Retrieval Record Descriptor */
38 int errCode; /* non-zero if error when fetching this */
39 char *errString; /* error string */
40 int position; /* position of record in result set (1,2,..) */
41 char *buf; /* record buffer (void pointer really) */
43 oid_value format; /* record syntax */
45 } ZebraRetrievalRecord;
47 /* Scan Term Descriptor */
49 int occurrences; /* scan term occurrences */
50 char *term; /* scan term string */
53 typedef struct zebra_info *ZebraHandle;
55 /* Open Zebra using file 'configName' (usually zebra.cfg) */
56 YAZ_EXPORT ZebraHandle zebra_open (const char *configName);
58 /* Search using RPN-Query */
59 YAZ_EXPORT void zebra_search_rpn (ZebraHandle zh, ODR input, ODR output,
60 Z_RPNQuery *query, int num_bases, char **basenames,
63 /* Retrieve record(s) */
64 YAZ_EXPORT void zebra_records_retrieve (ZebraHandle zh, ODR stream,
65 const char *setname, Z_RecordComposition *comp,
66 oid_value input_format,
67 int num_recs, ZebraRetrievalRecord *recs);
70 YAZ_EXPORT void zebra_scan (ZebraHandle zh, ODR stream,
71 Z_AttributesPlusTerm *zapt,
72 oid_value attributeset,
73 int num_bases, char **basenames,
74 int *position, int *num_entries,
75 ZebraScanEntry **list,
78 /* Close zebra and destroy handle */
79 YAZ_EXPORT void zebra_close (ZebraHandle zh);
82 YAZ_EXPORT int zebra_errCode (ZebraHandle zh);
83 /* string representatio of above */
84 YAZ_EXPORT const char *zebra_errString (ZebraHandle zh);
86 /* extra information associated with error */
87 YAZ_EXPORT char *zebra_errAdd (ZebraHandle zh);
89 /* number of hits (after search) */
90 YAZ_EXPORT int zebra_hits (ZebraHandle zh);
92 /* do authentication */
93 YAZ_EXPORT int zebra_auth (ZebraHandle zh, const char *user, const char *pass);