1 | /*
|
---|
2 | * Copyright (c) 1995-2000, Index Data.
|
---|
3 | *
|
---|
4 | * Permission to use, copy, modify, distribute, and sell this software and
|
---|
5 | * its documentation, in whole or in part, for any purpose, is hereby granted,
|
---|
6 | * provided that:
|
---|
7 | *
|
---|
8 | * 1. This copyright and permission notice appear in all copies of the
|
---|
9 | * software and its documentation. Notices of copyright or attribution
|
---|
10 | * which appear at the beginning of any file must remain unchanged.
|
---|
11 | *
|
---|
12 | * 2. The names of Index Data or the individual authors may not be used to
|
---|
13 | * endorse or promote products derived from this software without specific
|
---|
14 | * prior written permission.
|
---|
15 | *
|
---|
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
|
---|
17 | * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
---|
18 | * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
---|
19 | * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
|
---|
20 | * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
|
---|
21 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
|
---|
22 | * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
---|
23 | * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
---|
24 | * OF THIS SOFTWARE.
|
---|
25 | *
|
---|
26 | * $Log$
|
---|
27 | * Revision 1.1 2000/08/03 03:10:35 johnmcp
|
---|
28 | * Added the YAZ toolkit source to the packages directory (for z39.50 stuff)
|
---|
29 | *
|
---|
30 | * Revision 1.4 2000/02/28 11:20:06 adam
|
---|
31 | * Using autoconf. New definitions: YAZ_BEGIN_CDECL/YAZ_END_CDECL.
|
---|
32 | *
|
---|
33 | * Revision 1.3 2000/01/04 17:46:17 ian
|
---|
34 | * Added function to count occurences of a tag spec in a data1 tree.
|
---|
35 | *
|
---|
36 | * Revision 1.2 1999/12/21 14:16:19 ian
|
---|
37 | * Changed retrieval module to allow data1 trees with no associated absyn.
|
---|
38 | * Also added a simple interface for extracting values from data1 trees using
|
---|
39 | * a string based tagpath.
|
---|
40 | *
|
---|
41 | * Revision 1.1 1999/11/30 13:47:11 adam
|
---|
42 | * Improved installation. Moved header files to include/yaz.
|
---|
43 | *
|
---|
44 | * Revision 1.42 1999/10/21 12:06:28 adam
|
---|
45 | * Retrieval module no longer uses ctype.h - functions.
|
---|
46 | *
|
---|
47 | * Revision 1.41 1999/07/13 13:23:47 adam
|
---|
48 | * Non-recursive version of data1_read_node. data1_read_nodex reads
|
---|
49 | * stream of bytes (instead of buffer in memory).
|
---|
50 | *
|
---|
51 | * Revision 1.40 1998/11/03 10:14:12 adam
|
---|
52 | * Changed definition of data1 node so that it uses less space.
|
---|
53 | *
|
---|
54 | * Revision 1.39 1998/10/28 15:10:06 adam
|
---|
55 | * Added --with-yc option to configure. For the data1_node in data1.h:
|
---|
56 | * decreased size of localdata and removed member "line" which wasn't useful.
|
---|
57 | *
|
---|
58 | * Revision 1.38 1998/10/15 08:29:15 adam
|
---|
59 | * Tag set type may be specified in reference to it using "tagset"
|
---|
60 | * directive in .abs-files and "include" directive in .tag-files.
|
---|
61 | *
|
---|
62 | * Revision 1.37 1998/10/13 16:09:46 adam
|
---|
63 | * Added support for arbitrary OID's for tagsets, schemas and attribute sets.
|
---|
64 | * Added support for multiple attribute set references and tagset references
|
---|
65 | * from an abstract syntax file.
|
---|
66 | * Fixed many bad logs-calls in routines that read the various
|
---|
67 | * specifications regarding data1 (*.abs,*.att,...) and made the messages
|
---|
68 | * consistent whenever possible.
|
---|
69 | * Added extra 'lineno' argument to function readconf_line.
|
---|
70 | *
|
---|
71 | * Revision 1.36 1998/05/18 13:06:57 adam
|
---|
72 | * Changed the way attribute sets are handled by the retriaval module.
|
---|
73 | * Extended Explain conversion / schema.
|
---|
74 | * Modified server and client to work with ASN.1 compiled protocol handlers.
|
---|
75 | *
|
---|
76 | * Revision 1.35 1998/03/05 08:15:32 adam
|
---|
77 | * Implemented data1_add_insert_taggeddata utility which is more flexible
|
---|
78 | * than data1_insert_taggeddata.
|
---|
79 | *
|
---|
80 | * Revision 1.34 1998/02/27 14:08:04 adam
|
---|
81 | * Added const to some char pointer arguments.
|
---|
82 | * Reworked data1_read_node so that it doesn't create a tree with
|
---|
83 | * pointers to original "SGML"-buffer.
|
---|
84 | *
|
---|
85 | * Revision 1.33 1997/12/18 10:51:30 adam
|
---|
86 | * Implemented sub-trees feature for schemas - including forward
|
---|
87 | * references.
|
---|
88 | *
|
---|
89 | * Revision 1.32 1997/12/09 16:18:16 adam
|
---|
90 | * Work on EXPLAIN schema. First implementation of sub-schema facility
|
---|
91 | * in the *.abs files.
|
---|
92 | *
|
---|
93 | * Revision 1.31 1997/11/18 09:51:08 adam
|
---|
94 | * Removed element num_children from data1_node. Minor changes in
|
---|
95 | * data1 to Explain.
|
---|
96 | *
|
---|
97 | * Revision 1.30 1997/10/31 12:20:07 adam
|
---|
98 | * Improved memory debugging for xmalloc/nmem.c. References to NMEM
|
---|
99 | * instead of ODR in n ESPEC-1 handling in source d1_espec.c.
|
---|
100 | * Bug fix: missing fclose in data1_read_espec1.
|
---|
101 | *
|
---|
102 | * Revision 1.29 1997/10/27 13:54:18 adam
|
---|
103 | * Changed structure field in data1 node to be simple string which
|
---|
104 | * is "unknown" to the retrieval system itself.
|
---|
105 | *
|
---|
106 | * Revision 1.28 1997/10/06 09:37:53 adam
|
---|
107 | * Added prototype for data1_get_map_buf.
|
---|
108 | *
|
---|
109 | * Revision 1.27 1997/09/24 13:35:44 adam
|
---|
110 | * Added two members to data1_marctab to ease reading of weird MARC records.
|
---|
111 | *
|
---|
112 | * Revision 1.26 1997/09/17 12:10:32 adam
|
---|
113 | * YAZ version 1.4.
|
---|
114 | *
|
---|
115 | * Revision 1.25 1997/09/05 09:50:55 adam
|
---|
116 | * Removed global data1_tabpath - uses data1_get_tabpath() instead.
|
---|
117 | *
|
---|
118 | * Revision 1.24 1997/09/01 09:30:39 adam
|
---|
119 | * Added include of yaz-util.h.
|
---|
120 | *
|
---|
121 | * Revision 1.23 1997/09/01 08:58:04 adam
|
---|
122 | * Removed declaration of data1_matchstr since it's a macro.
|
---|
123 | *
|
---|
124 | * Revision 1.22 1997/09/01 08:49:48 adam
|
---|
125 | * New windows NT/95 port using MSV5.0. To export DLL functions the
|
---|
126 | * YAZ_EXPORT modifier was added. Defined in yconfig.h.
|
---|
127 | *
|
---|
128 | * Revision 1.21 1997/05/14 06:53:38 adam
|
---|
129 | * C++ support.
|
---|
130 | *
|
---|
131 | * Revision 1.20 1996/10/29 13:34:39 adam
|
---|
132 | * New functions to get/set data1_tabpath.
|
---|
133 | *
|
---|
134 | * Revision 1.19 1996/10/11 11:57:16 quinn
|
---|
135 | * Smallish
|
---|
136 | *
|
---|
137 | * Revision 1.18 1996/10/07 15:29:16 quinn
|
---|
138 | * Added SOIF support
|
---|
139 | *
|
---|
140 | * Revision 1.17 1996/07/06 19:58:32 quinn
|
---|
141 | * System headerfiles gathered in yconfig
|
---|
142 | *
|
---|
143 | * Revision 1.16 1996/06/10 08:55:34 quinn
|
---|
144 | * Added Summary. Unfinished work
|
---|
145 | *
|
---|
146 | * Revision 1.15 1996/06/03 09:46:03 quinn
|
---|
147 | * Added OID type.
|
---|
148 | *
|
---|
149 | * Revision 1.14 1996/05/09 07:27:11 quinn
|
---|
150 | * Multiple local values supported.
|
---|
151 | *
|
---|
152 | * Revision 1.13 1996/02/20 16:32:48 quinn
|
---|
153 | * Created util file.
|
---|
154 | *
|
---|
155 | * Revision 1.12 1996/01/18 09:46:34 adam
|
---|
156 | * Changed prototype for reader function parsed to data1_read_record.
|
---|
157 | *
|
---|
158 | * Revision 1.11 1995/12/15 16:19:45 quinn
|
---|
159 | * Added formatted_text.
|
---|
160 | *
|
---|
161 | * Revision 1.10 1995/12/14 11:09:43 quinn
|
---|
162 | * Work on Explain
|
---|
163 | *
|
---|
164 | * Revision 1.9 1995/12/13 15:32:47 quinn
|
---|
165 | * Added sgml-output.
|
---|
166 | *
|
---|
167 | * Revision 1.8 1995/12/13 13:44:23 quinn
|
---|
168 | * Modified Data1-system to use nmem
|
---|
169 | *
|
---|
170 | * Revision 1.7 1995/12/12 16:37:05 quinn
|
---|
171 | * Added destroy element to data1_node.
|
---|
172 | *
|
---|
173 | * Revision 1.6 1995/12/11 15:22:12 quinn
|
---|
174 | * Added last_child field to the node.
|
---|
175 | *
|
---|
176 | * Revision 1.5 1995/12/05 14:26:40 quinn
|
---|
177 | * Added global lbuf to data1_node.
|
---|
178 | *
|
---|
179 | * Revision 1.4 1995/11/13 09:27:29 quinn
|
---|
180 | * Fiddling with the variant stuff.
|
---|
181 | *
|
---|
182 | * Revision 1.3 1995/11/01 16:34:52 quinn
|
---|
183 | * Making data1 look for tables in data1_tabpath
|
---|
184 | *
|
---|
185 | * Revision 1.2 1995/11/01 13:54:35 quinn
|
---|
186 | * Minor adjustments
|
---|
187 | *
|
---|
188 | * Revision 1.1 1995/11/01 13:07:18 quinn
|
---|
189 | * Data1 module now lives in YAZ.
|
---|
190 | *
|
---|
191 | * Revision 1.13 1995/10/25 16:00:49 quinn
|
---|
192 | * USMARC support is now almost operational
|
---|
193 | *
|
---|
194 | * Revision 1.12 1995/10/16 14:02:59 quinn
|
---|
195 | * Changes to support element set names and espec1
|
---|
196 | *
|
---|
197 | * Revision 1.11 1995/10/13 16:05:10 quinn
|
---|
198 | * Adding Espec1-processing
|
---|
199 | *
|
---|
200 | * Revision 1.10 1995/10/11 14:53:46 quinn
|
---|
201 | * Work on variants.
|
---|
202 | *
|
---|
203 | * Revision 1.9 1995/10/10 16:27:59 quinn
|
---|
204 | * *** empty log message ***
|
---|
205 | *
|
---|
206 | * Revision 1.8 1995/10/06 16:44:14 quinn
|
---|
207 | * Work on attribute set mapping, etc.
|
---|
208 | *
|
---|
209 | * Revision 1.7 1995/10/06 12:58:36 quinn
|
---|
210 | * SUTRS support
|
---|
211 | *
|
---|
212 | * Revision 1.6 1995/10/04 09:29:51 quinn
|
---|
213 | * Adjustments to support USGS test data
|
---|
214 | *
|
---|
215 | * Revision 1.5 1995/10/03 17:56:44 quinn
|
---|
216 | * Fixing GRS code.
|
---|
217 | *
|
---|
218 | * Revision 1.4 1995/10/02 14:55:43 quinn
|
---|
219 | * *** empty log message ***
|
---|
220 | *
|
---|
221 | * Revision 1.3 1995/09/15 14:41:43 quinn
|
---|
222 | * GRS1 work
|
---|
223 | *
|
---|
224 | * Revision 1.2 1995/09/14 15:18:14 quinn
|
---|
225 | * Work
|
---|
226 | *
|
---|
227 | * Revision 1.1 1995/09/12 11:24:33 quinn
|
---|
228 | * Beginning to add code for structured records.
|
---|
229 | *
|
---|
230 | *
|
---|
231 | */
|
---|
232 |
|
---|
233 | #ifndef DATA1_H
|
---|
234 | #define DATA1_H
|
---|
235 |
|
---|
236 | #include <stdio.h>
|
---|
237 |
|
---|
238 | #include <yaz/nmem.h>
|
---|
239 | #include <yaz/oid.h>
|
---|
240 | #include <yaz/proto.h>
|
---|
241 |
|
---|
242 | #include <yaz/d1_attset.h>
|
---|
243 | #include <yaz/d1_map.h>
|
---|
244 | #include <yaz/yaz-util.h>
|
---|
245 | #include <yaz/wrbuf.h>
|
---|
246 |
|
---|
247 | #define d1_isspace(c) strchr(" \r\n\t\f", c)
|
---|
248 | #define d1_isdigit(c) ((c) <= '9' && (c) >= '0')
|
---|
249 |
|
---|
250 | YAZ_BEGIN_CDECL
|
---|
251 |
|
---|
252 | #define data1_matchstr(s1, s2) yaz_matchstr(s1, s2)
|
---|
253 |
|
---|
254 | #define DATA1_MAX_SYMBOL 31
|
---|
255 |
|
---|
256 | typedef struct data1_name
|
---|
257 | {
|
---|
258 | char *name;
|
---|
259 | struct data1_name *next;
|
---|
260 | } data1_name;
|
---|
261 |
|
---|
262 | typedef struct data1_absyn_cache_info *data1_absyn_cache;
|
---|
263 | typedef struct data1_attset_cache_info *data1_attset_cache;
|
---|
264 |
|
---|
265 | typedef enum data1_datatype
|
---|
266 | {
|
---|
267 | DATA1K_unknown,
|
---|
268 | DATA1K_structured,
|
---|
269 | DATA1K_string,
|
---|
270 | DATA1K_numeric,
|
---|
271 | DATA1K_bool,
|
---|
272 | DATA1K_oid,
|
---|
273 | DATA1K_generalizedtime,
|
---|
274 | DATA1K_intunit,
|
---|
275 | DATA1K_int,
|
---|
276 | DATA1K_octetstring,
|
---|
277 | DATA1K_null
|
---|
278 | } data1_datatype;
|
---|
279 |
|
---|
280 | typedef struct data1_marctab
|
---|
281 | {
|
---|
282 | char *name;
|
---|
283 | oid_value reference;
|
---|
284 |
|
---|
285 | char record_status[2];
|
---|
286 | char implementation_codes[5];
|
---|
287 | int indicator_length;
|
---|
288 | int identifier_length;
|
---|
289 | char user_systems[4];
|
---|
290 |
|
---|
291 | int length_data_entry;
|
---|
292 | int length_starting;
|
---|
293 | int length_implementation;
|
---|
294 | char future_use[2];
|
---|
295 |
|
---|
296 | int force_indicator_length;
|
---|
297 | int force_identifier_length;
|
---|
298 | struct data1_marctab *next;
|
---|
299 | } data1_marctab;
|
---|
300 |
|
---|
301 | typedef struct data1_esetname
|
---|
302 | {
|
---|
303 | char *name;
|
---|
304 | Z_Espec1 *spec;
|
---|
305 | struct data1_esetname *next;
|
---|
306 | } data1_esetname;
|
---|
307 |
|
---|
308 | /*
|
---|
309 | * Variant set definitions.
|
---|
310 | */
|
---|
311 |
|
---|
312 | typedef struct data1_vartype
|
---|
313 | {
|
---|
314 | char *name;
|
---|
315 | struct data1_varclass *zclass;
|
---|
316 | int type;
|
---|
317 | data1_datatype datatype;
|
---|
318 | struct data1_vartype *next;
|
---|
319 | } data1_vartype;
|
---|
320 |
|
---|
321 | typedef struct data1_varclass
|
---|
322 | {
|
---|
323 | char *name;
|
---|
324 | struct data1_varset *set;
|
---|
325 | int zclass;
|
---|
326 | data1_vartype *types;
|
---|
327 | struct data1_varclass *next;
|
---|
328 | } data1_varclass;
|
---|
329 |
|
---|
330 | typedef struct data1_varset
|
---|
331 | {
|
---|
332 | char *name;
|
---|
333 | oid_value reference;
|
---|
334 | data1_varclass *classes;
|
---|
335 | } data1_varset;
|
---|
336 |
|
---|
337 | /*
|
---|
338 | * Tagset definitions
|
---|
339 | */
|
---|
340 |
|
---|
341 | struct data1_tagset;
|
---|
342 |
|
---|
343 | typedef struct data1_tag
|
---|
344 | {
|
---|
345 | data1_name *names;
|
---|
346 | #define DATA1T_numeric 1
|
---|
347 | #define DATA1T_string 2
|
---|
348 | int which;
|
---|
349 | union
|
---|
350 | {
|
---|
351 | int numeric;
|
---|
352 | char *string;
|
---|
353 | } value;
|
---|
354 | data1_datatype kind;
|
---|
355 |
|
---|
356 | struct data1_tagset *tagset;
|
---|
357 | struct data1_tag *next;
|
---|
358 | } data1_tag;
|
---|
359 |
|
---|
360 | typedef struct data1_tagset data1_tagset;
|
---|
361 |
|
---|
362 | struct data1_tagset
|
---|
363 | {
|
---|
364 | int type; /* type of tagset in current context */
|
---|
365 | char *name; /* symbolic name */
|
---|
366 | oid_value reference;
|
---|
367 | data1_tag *tags; /* tags defined by this set */
|
---|
368 | data1_tagset *children; /* children */
|
---|
369 | data1_tagset *next; /* sibling */
|
---|
370 | };
|
---|
371 |
|
---|
372 | typedef struct data1_termlist
|
---|
373 | {
|
---|
374 | data1_att *att;
|
---|
375 | char *structure;
|
---|
376 | struct data1_termlist *next;
|
---|
377 | } data1_termlist;
|
---|
378 |
|
---|
379 | /*
|
---|
380 | * abstract syntax specification
|
---|
381 | */
|
---|
382 |
|
---|
383 | typedef struct data1_element
|
---|
384 | {
|
---|
385 | char *name;
|
---|
386 | data1_tag *tag;
|
---|
387 | data1_termlist *termlists;
|
---|
388 | char *sub_name;
|
---|
389 | struct data1_element *children;
|
---|
390 | struct data1_element *next;
|
---|
391 | } data1_element;
|
---|
392 |
|
---|
393 | typedef struct data1_sub_elements {
|
---|
394 | char *name;
|
---|
395 | struct data1_sub_elements *next;
|
---|
396 | data1_element *elements;
|
---|
397 | } data1_sub_elements;
|
---|
398 |
|
---|
399 | typedef struct data1_absyn
|
---|
400 | {
|
---|
401 | char *name;
|
---|
402 | oid_value reference;
|
---|
403 | data1_tagset *tagset;
|
---|
404 | data1_attset *attset;
|
---|
405 | data1_varset *varset;
|
---|
406 | data1_esetname *esetnames;
|
---|
407 | data1_maptab *maptabs;
|
---|
408 | data1_marctab *marc;
|
---|
409 | data1_sub_elements *sub_elements;
|
---|
410 | data1_element *main_elements;
|
---|
411 | } data1_absyn;
|
---|
412 |
|
---|
413 | /*
|
---|
414 | * record data node (tag/data/variant)
|
---|
415 | */
|
---|
416 |
|
---|
417 | typedef struct data1_node
|
---|
418 | {
|
---|
419 | /* the root of a record (containing global data) */
|
---|
420 | #define DATA1N_root 1
|
---|
421 | /* a tag */
|
---|
422 | #define DATA1N_tag 2
|
---|
423 | /* some data under a leaf tag or variant */
|
---|
424 | #define DATA1N_data 3
|
---|
425 | /* variant specification (a triple, actually) */
|
---|
426 | #define DATA1N_variant 4
|
---|
427 | int which;
|
---|
428 |
|
---|
429 | union
|
---|
430 | {
|
---|
431 | struct
|
---|
432 | {
|
---|
433 | char *type;
|
---|
434 | data1_absyn *absyn; /* abstract syntax for this type */
|
---|
435 | } root;
|
---|
436 |
|
---|
437 | struct
|
---|
438 | {
|
---|
439 | char *tag;
|
---|
440 | data1_element *element;
|
---|
441 | int no_data_requested;
|
---|
442 | int get_bytes;
|
---|
443 | unsigned node_selected : 1;
|
---|
444 | unsigned make_variantlist : 1;
|
---|
445 | } tag;
|
---|
446 |
|
---|
447 | struct
|
---|
448 | {
|
---|
449 | char *data; /* filename or data */
|
---|
450 | int len;
|
---|
451 | /* text inclusion */
|
---|
452 | #define DATA1I_inctxt 1
|
---|
453 | /* binary data inclusion */
|
---|
454 | #define DATA1I_incbin 2
|
---|
455 | /* text data */
|
---|
456 | #define DATA1I_text 3
|
---|
457 | /* numerical data */
|
---|
458 | #define DATA1I_num 4
|
---|
459 | /* object identifier */
|
---|
460 | #define DATA1I_oid 5
|
---|
461 | unsigned what:7;
|
---|
462 | unsigned formatted_text : 1; /* newlines are significant */
|
---|
463 | } data;
|
---|
464 |
|
---|
465 | struct
|
---|
466 | {
|
---|
467 | data1_vartype *type;
|
---|
468 | char *value;
|
---|
469 | } variant;
|
---|
470 | } u;
|
---|
471 |
|
---|
472 | void (*destroy)(struct data1_node *n);
|
---|
473 | #define DATA1_LOCALDATA 12
|
---|
474 | char lbuf[DATA1_LOCALDATA]; /* small buffer for local data */
|
---|
475 | struct data1_node *next;
|
---|
476 | struct data1_node *child;
|
---|
477 | struct data1_node *last_child;
|
---|
478 | struct data1_node *parent;
|
---|
479 | struct data1_node *root;
|
---|
480 | } data1_node;
|
---|
481 |
|
---|
482 | YAZ_EXPORT data1_handle data1_create (void);
|
---|
483 | YAZ_EXPORT void data1_destroy(data1_handle dh);
|
---|
484 | YAZ_EXPORT data1_node *get_parent_tag(data1_handle dh, data1_node *n);
|
---|
485 | YAZ_EXPORT data1_node *data1_read_node(data1_handle dh, const char **buf,
|
---|
486 | NMEM m);
|
---|
487 | YAZ_EXPORT data1_node *data1_read_nodex (data1_handle dh, NMEM m,
|
---|
488 | int (*get_byte)(void *fh), void *fh,
|
---|
489 | WRBUF wrbuf);
|
---|
490 | YAZ_EXPORT data1_node *data1_read_record(data1_handle dh,
|
---|
491 | int (*rf)(void *, char *, size_t),
|
---|
492 | void *fh, NMEM m);
|
---|
493 | YAZ_EXPORT data1_absyn *data1_read_absyn(data1_handle dh, const char *file);
|
---|
494 | YAZ_EXPORT data1_tag *data1_gettagbynum(data1_handle dh,
|
---|
495 | data1_tagset *s,
|
---|
496 | int type, int value);
|
---|
497 | YAZ_EXPORT data1_tagset *data1_empty_tagset (data1_handle dh);
|
---|
498 | YAZ_EXPORT data1_tagset *data1_read_tagset(data1_handle dh,
|
---|
499 | const char *file,
|
---|
500 | int type);
|
---|
501 | YAZ_EXPORT data1_element *data1_getelementbytagname(data1_handle dh,
|
---|
502 | data1_absyn *abs,
|
---|
503 | data1_element *parent,
|
---|
504 | const char *tagname);
|
---|
505 | YAZ_EXPORT Z_GenericRecord *data1_nodetogr(data1_handle dh, data1_node *n,
|
---|
506 | int select, ODR o,
|
---|
507 | int *len);
|
---|
508 | YAZ_EXPORT data1_tag *data1_gettagbyname(data1_handle dh, data1_tagset *s,
|
---|
509 | const char *name);
|
---|
510 | YAZ_EXPORT void data1_free_tree(data1_handle dh, data1_node *t);
|
---|
511 | YAZ_EXPORT char *data1_nodetobuf(data1_handle dh, data1_node *n,
|
---|
512 | int select, int *len);
|
---|
513 | YAZ_EXPORT data1_node *data1_insert_taggeddata(data1_handle dh,
|
---|
514 | data1_node *root,
|
---|
515 | data1_node *at,
|
---|
516 | const char *tagname, NMEM m);
|
---|
517 | YAZ_EXPORT data1_node *data1_add_taggeddata(data1_handle dh, data1_node *root,
|
---|
518 | data1_node *at,
|
---|
519 | const char *tagname, NMEM m);
|
---|
520 | YAZ_EXPORT data1_datatype data1_maptype(data1_handle dh, char *t);
|
---|
521 | YAZ_EXPORT data1_varset *data1_read_varset(data1_handle dh, const char *file);
|
---|
522 | YAZ_EXPORT data1_vartype *data1_getvartypebyct(data1_handle dh,
|
---|
523 | data1_varset *set,
|
---|
524 | char *zclass, char *type);
|
---|
525 | YAZ_EXPORT Z_Espec1 *data1_read_espec1(data1_handle dh, const char *file);
|
---|
526 | YAZ_EXPORT int data1_doespec1(data1_handle dh, data1_node *n, Z_Espec1 *e);
|
---|
527 | YAZ_EXPORT data1_esetname *data1_getesetbyname(data1_handle dh,
|
---|
528 | data1_absyn *a,
|
---|
529 | const char *name);
|
---|
530 | YAZ_EXPORT data1_element *data1_getelementbyname(data1_handle dh,
|
---|
531 | data1_absyn *absyn,
|
---|
532 | const char *name);
|
---|
533 | YAZ_EXPORT data1_node *data1_mk_node(data1_handle dh, NMEM m);
|
---|
534 | YAZ_EXPORT data1_absyn *data1_get_absyn(data1_handle dh, const char *name);
|
---|
535 | YAZ_EXPORT data1_attset *data1_get_attset (data1_handle dh, const char *name);
|
---|
536 | YAZ_EXPORT data1_maptab *data1_read_maptab(data1_handle dh, const char *file);
|
---|
537 | YAZ_EXPORT data1_node *data1_map_record(data1_handle dh, data1_node *n,
|
---|
538 | data1_maptab *map, NMEM m);
|
---|
539 | YAZ_EXPORT data1_marctab *data1_read_marctab (data1_handle dh,
|
---|
540 | const char *file);
|
---|
541 | YAZ_EXPORT char *data1_nodetomarc(data1_handle dh, data1_marctab *p,
|
---|
542 | data1_node *n, int selected, int *len);
|
---|
543 | YAZ_EXPORT char *data1_nodetoidsgml(data1_handle dh, data1_node *n,
|
---|
544 | int select, int *len);
|
---|
545 | YAZ_EXPORT Z_ExplainRecord *data1_nodetoexplain(data1_handle dh,
|
---|
546 | data1_node *n, int select,
|
---|
547 | ODR o);
|
---|
548 | YAZ_EXPORT Z_BriefBib *data1_nodetosummary(data1_handle dh,
|
---|
549 | data1_node *n, int select,
|
---|
550 | ODR o);
|
---|
551 | YAZ_EXPORT char *data1_nodetosoif(data1_handle dh, data1_node *n, int select,
|
---|
552 | int *len);
|
---|
553 | YAZ_EXPORT void data1_set_tabpath(data1_handle dh, const char *path);
|
---|
554 | YAZ_EXPORT const char *data1_get_tabpath(data1_handle dh);
|
---|
555 |
|
---|
556 | YAZ_EXPORT WRBUF data1_get_wrbuf (data1_handle dp);
|
---|
557 | YAZ_EXPORT char **data1_get_read_buf (data1_handle dp, int **lenp);
|
---|
558 | YAZ_EXPORT char **data1_get_map_buf (data1_handle dp, int **lenp);
|
---|
559 | YAZ_EXPORT data1_absyn_cache *data1_absyn_cache_get (data1_handle dh);
|
---|
560 | YAZ_EXPORT data1_attset_cache *data1_attset_cache_get (data1_handle dh);
|
---|
561 | YAZ_EXPORT NMEM data1_nmem_get (data1_handle dh);
|
---|
562 | YAZ_EXPORT void data1_pr_tree (data1_handle dh, data1_node *n, FILE *out);
|
---|
563 | YAZ_EXPORT char *data1_insert_string (data1_handle dh, data1_node *res,
|
---|
564 | NMEM m, const char *str);
|
---|
565 | YAZ_EXPORT data1_node *data1_read_sgml (data1_handle dh, NMEM m,
|
---|
566 | const char *buf);
|
---|
567 | YAZ_EXPORT void data1_absyn_trav (data1_handle dh, void *handle,
|
---|
568 | void (*fh)(data1_handle dh,
|
---|
569 | void *h, data1_absyn *a));
|
---|
570 |
|
---|
571 | YAZ_EXPORT data1_attset *data1_attset_search_id (data1_handle dh, int id);
|
---|
572 |
|
---|
573 | YAZ_EXPORT data1_node
|
---|
574 | *data1_add_insert_taggeddata(data1_handle dh, data1_node *root,
|
---|
575 | data1_node *at, const char *tagname, NMEM m,
|
---|
576 | int first_flag, int local_allowed);
|
---|
577 |
|
---|
578 | YAZ_EXPORT char *data1_getNodeValue(data1_node* node, char* pTagPath);
|
---|
579 | YAZ_EXPORT data1_node *data1_LookupNode(data1_node* node, char* pTagPath);
|
---|
580 | YAZ_EXPORT int data1_CountOccurences(data1_node* node, char* pTagPath);
|
---|
581 |
|
---|
582 | YAZ_END_CDECL
|
---|
583 |
|
---|
584 | #endif
|
---|