2 * Copyright (C) 1994-1998, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.12 2000-04-05 09:49:35 adam
8 * On Unix, zebra/z'mbol uses automake.
10 * Revision 1.11 2000/03/20 19:08:36 adam
11 * Added remote record import using Z39.50 extended services and Segment
14 * Revision 1.10 2000/03/15 15:00:31 adam
15 * First work on threaded version.
17 * Revision 1.9 2000/02/24 12:31:17 adam
18 * Added zebra_string_norm.
20 * Revision 1.8 1999/11/30 13:48:03 adam
21 * Improved installation. Updated for inclusion of YAZ header files.
23 * Revision 1.7 1999/11/04 15:00:45 adam
24 * Implemented delete result set(s).
26 * Revision 1.6 1999/02/17 11:29:57 adam
27 * Fixed in record_fetch. Minor updates to API.
29 * Revision 1.5 1998/09/22 10:48:19 adam
30 * Minor changes in search API.
32 * Revision 1.4 1998/09/02 13:53:18 adam
33 * Extra parameter decode added to search routines to implement
36 * Revision 1.3 1998/06/22 11:36:48 adam
37 * Added authentication check facility to zebra.
39 * Revision 1.2 1998/06/13 00:14:09 adam
42 * Revision 1.1 1998/06/12 12:22:13 adam
49 #include <yaz/proto.h>
53 /* Retrieval Record Descriptor */
55 int errCode; /* non-zero if error when fetching this */
56 char *errString; /* error string */
57 int position; /* position of record in result set (1,2,..) */
58 char *buf; /* record buffer (void pointer really) */
60 oid_value format; /* record syntax */
62 } ZebraRetrievalRecord;
64 /* Scan Term Descriptor */
66 int occurrences; /* scan term occurrences */
67 char *term; /* scan term string */
70 typedef struct zebra_session *ZebraHandle;
71 typedef struct zebra_service *ZebraService;
73 /* Open Zebra using file 'configName' (usually zebra.cfg) */
74 YAZ_EXPORT ZebraHandle zebra_open (ZebraService zs);
76 /* Search using RPN-Query */
77 YAZ_EXPORT void zebra_search_rpn (ZebraHandle zh, ODR input, ODR output,
78 Z_RPNQuery *query, int num_bases, char **basenames,
81 /* Retrieve record(s) */
82 YAZ_EXPORT void zebra_records_retrieve (ZebraHandle zh, ODR stream,
83 const char *setname, Z_RecordComposition *comp,
84 oid_value input_format,
85 int num_recs, ZebraRetrievalRecord *recs);
88 YAZ_EXPORT void zebra_scan (ZebraHandle zh, ODR stream,
89 Z_AttributesPlusTerm *zapt,
90 oid_value attributeset,
91 int num_bases, char **basenames,
92 int *position, int *num_entries,
93 ZebraScanEntry **list,
96 /* Delete Result Set(s) */
97 YAZ_EXPORT int zebra_deleleResultSet(ZebraHandle zh, int function,
98 int num_setnames, char **setnames,
101 /* Close zebra and destroy handle */
102 YAZ_EXPORT void zebra_close (ZebraHandle zh);
104 /* last error code */
105 YAZ_EXPORT int zebra_errCode (ZebraHandle zh);
106 /* string representatio of above */
107 YAZ_EXPORT const char *zebra_errString (ZebraHandle zh);
109 /* extra information associated with error */
110 YAZ_EXPORT char *zebra_errAdd (ZebraHandle zh);
112 /* number of hits (after search) */
113 YAZ_EXPORT int zebra_hits (ZebraHandle zh);
115 /* do authentication */
116 YAZ_EXPORT int zebra_auth (ZebraService zh, const char *user, const char *pass);
118 /* Character normalisation on specific register .
119 This routine is subject to change - do not use. */
120 YAZ_EXPORT int zebra_string_norm (ZebraHandle zh, unsigned reg_id,
121 const char *input_str, int input_len,
122 char *output_str, int output_len);
124 YAZ_EXPORT void zebra_admin_create (ZebraHandle zh, const char *db);
126 YAZ_EXPORT ZebraService zebra_start (const char *configName);
127 YAZ_EXPORT void zebra_stop (ZebraService zs);
129 YAZ_EXPORT void zebra_admin_shutdown (ZebraHandle zh);
130 YAZ_EXPORT void zebra_admin_start (ZebraHandle zh);
132 YAZ_EXPORT void zebra_shutdown (ZebraService zs);
134 YAZ_EXPORT void zebra_admin_import_begin (ZebraHandle zh, const char *database);
136 YAZ_EXPORT void zebra_admin_import_segment (ZebraHandle zh,
139 void zebra_admin_import_end (ZebraHandle zh);