2 * Copyright (C) 1994-1998, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.9 2000-02-24 12:31:17 adam
8 * Added zebra_string_norm.
10 * Revision 1.8 1999/11/30 13:48:03 adam
11 * Improved installation. Updated for inclusion of YAZ header files.
13 * Revision 1.7 1999/11/04 15:00:45 adam
14 * Implemented delete result set(s).
16 * Revision 1.6 1999/02/17 11:29:57 adam
17 * Fixed in record_fetch. Minor updates to API.
19 * Revision 1.5 1998/09/22 10:48:19 adam
20 * Minor changes in search API.
22 * Revision 1.4 1998/09/02 13:53:18 adam
23 * Extra parameter decode added to search routines to implement
26 * Revision 1.3 1998/06/22 11:36:48 adam
27 * Added authentication check facility to zebra.
29 * Revision 1.2 1998/06/13 00:14:09 adam
32 * Revision 1.1 1998/06/12 12:22:13 adam
39 #include <yaz/proto.h>
45 /* Retrieval Record Descriptor */
47 int errCode; /* non-zero if error when fetching this */
48 char *errString; /* error string */
49 int position; /* position of record in result set (1,2,..) */
50 char *buf; /* record buffer (void pointer really) */
52 oid_value format; /* record syntax */
54 } ZebraRetrievalRecord;
56 /* Scan Term Descriptor */
58 int occurrences; /* scan term occurrences */
59 char *term; /* scan term string */
62 typedef struct zebra_info *ZebraHandle;
64 /* Open Zebra using file 'configName' (usually zebra.cfg) */
65 YAZ_EXPORT ZebraHandle zebra_open (const char *configName);
67 /* Search using RPN-Query */
68 YAZ_EXPORT void zebra_search_rpn (ZebraHandle zh, ODR input, ODR output,
69 Z_RPNQuery *query, int num_bases, char **basenames,
72 /* Retrieve record(s) */
73 YAZ_EXPORT void zebra_records_retrieve (ZebraHandle zh, ODR stream,
74 const char *setname, Z_RecordComposition *comp,
75 oid_value input_format,
76 int num_recs, ZebraRetrievalRecord *recs);
79 YAZ_EXPORT void zebra_scan (ZebraHandle zh, ODR stream,
80 Z_AttributesPlusTerm *zapt,
81 oid_value attributeset,
82 int num_bases, char **basenames,
83 int *position, int *num_entries,
84 ZebraScanEntry **list,
87 /* Delete Result Set(s) */
88 YAZ_EXPORT int zebra_deleleResultSet(ZebraHandle zh, int function,
89 int num_setnames, char **setnames,
92 /* Close zebra and destroy handle */
93 YAZ_EXPORT void zebra_close (ZebraHandle zh);
96 YAZ_EXPORT int zebra_errCode (ZebraHandle zh);
97 /* string representatio of above */
98 YAZ_EXPORT const char *zebra_errString (ZebraHandle zh);
100 /* extra information associated with error */
101 YAZ_EXPORT char *zebra_errAdd (ZebraHandle zh);
103 /* number of hits (after search) */
104 YAZ_EXPORT int zebra_hits (ZebraHandle zh);
106 /* do authentication */
107 YAZ_EXPORT int zebra_auth (ZebraHandle zh, const char *user, const char *pass);
109 /* Character normalisation on specific register .
110 This routine is subject to change - do not use. */
111 YAZ_EXPORT int zebra_string_norm (ZebraHandle zh, unsigned reg_id,
112 const char *input_str, int input_len,
113 char *output_str, int output_len);