2 * Copyright (C) 1994-1998, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.10 2000-03-15 15:00:31 adam
8 * First work on threaded version.
10 * Revision 1.9 2000/02/24 12:31:17 adam
11 * Added zebra_string_norm.
13 * Revision 1.8 1999/11/30 13:48:03 adam
14 * Improved installation. Updated for inclusion of YAZ header files.
16 * Revision 1.7 1999/11/04 15:00:45 adam
17 * Implemented delete result set(s).
19 * Revision 1.6 1999/02/17 11:29:57 adam
20 * Fixed in record_fetch. Minor updates to API.
22 * Revision 1.5 1998/09/22 10:48:19 adam
23 * Minor changes in search API.
25 * Revision 1.4 1998/09/02 13:53:18 adam
26 * Extra parameter decode added to search routines to implement
29 * Revision 1.3 1998/06/22 11:36:48 adam
30 * Added authentication check facility to zebra.
32 * Revision 1.2 1998/06/13 00:14:09 adam
35 * Revision 1.1 1998/06/12 12:22:13 adam
42 #include <yaz/proto.h>
46 /* Retrieval Record Descriptor */
48 int errCode; /* non-zero if error when fetching this */
49 char *errString; /* error string */
50 int position; /* position of record in result set (1,2,..) */
51 char *buf; /* record buffer (void pointer really) */
53 oid_value format; /* record syntax */
55 } ZebraRetrievalRecord;
57 /* Scan Term Descriptor */
59 int occurrences; /* scan term occurrences */
60 char *term; /* scan term string */
63 typedef struct zebra_session *ZebraHandle;
64 typedef struct zebra_service *ZebraService;
66 /* Open Zebra using file 'configName' (usually zebra.cfg) */
67 YAZ_EXPORT ZebraHandle zebra_open (ZebraService zs);
69 /* Search using RPN-Query */
70 YAZ_EXPORT void zebra_search_rpn (ZebraHandle zh, ODR input, ODR output,
71 Z_RPNQuery *query, int num_bases, char **basenames,
74 /* Retrieve record(s) */
75 YAZ_EXPORT void zebra_records_retrieve (ZebraHandle zh, ODR stream,
76 const char *setname, Z_RecordComposition *comp,
77 oid_value input_format,
78 int num_recs, ZebraRetrievalRecord *recs);
81 YAZ_EXPORT void zebra_scan (ZebraHandle zh, ODR stream,
82 Z_AttributesPlusTerm *zapt,
83 oid_value attributeset,
84 int num_bases, char **basenames,
85 int *position, int *num_entries,
86 ZebraScanEntry **list,
89 /* Delete Result Set(s) */
90 YAZ_EXPORT int zebra_deleleResultSet(ZebraHandle zh, int function,
91 int num_setnames, char **setnames,
94 /* Close zebra and destroy handle */
95 YAZ_EXPORT void zebra_close (ZebraHandle zh);
98 YAZ_EXPORT int zebra_errCode (ZebraHandle zh);
99 /* string representatio of above */
100 YAZ_EXPORT const char *zebra_errString (ZebraHandle zh);
102 /* extra information associated with error */
103 YAZ_EXPORT char *zebra_errAdd (ZebraHandle zh);
105 /* number of hits (after search) */
106 YAZ_EXPORT int zebra_hits (ZebraHandle zh);
108 /* do authentication */
109 YAZ_EXPORT int zebra_auth (ZebraService zh, const char *user, const char *pass);
111 /* Character normalisation on specific register .
112 This routine is subject to change - do not use. */
113 YAZ_EXPORT int zebra_string_norm (ZebraHandle zh, unsigned reg_id,
114 const char *input_str, int input_len,
115 char *output_str, int output_len);
117 YAZ_EXPORT void zebra_admin_create (ZebraHandle zh, const char *db);
119 YAZ_EXPORT ZebraService zebra_start (const char *configName);
120 YAZ_EXPORT void zebra_stop (ZebraService zs);