IDZEBRA 2.2.8
d1_expout.c
Go to the documentation of this file.
1/* This file is part of the Zebra server.
2 Copyright (C) Index Data
3
4Zebra is free software; you can redistribute it and/or modify it under
5the terms of the GNU General Public License as published by the Free
6Software Foundation; either version 2, or (at your option) any later
7version.
8
9Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
10WARRANTY; without even the implied warranty of MERCHANTABILITY or
11FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
18*/
19
20/*
21 * This module converts data1 tree to Z39.50 Explain records
22 */
23
24#if HAVE_CONFIG_H
25#include <config.h>
26#endif
27#include <assert.h>
28#include <string.h>
29#include <stdlib.h>
30
31#include <yaz/log.h>
32#include <yaz/proto.h>
33#include <yaz/oid_db.h>
34#include <yaz/snprintf.h>
35#include <idzebra/data1.h>
36
37typedef struct {
39 ODR o;
40 int select;
41
42 bool_t *false_value;
43 bool_t *true_value;
44} ExpHandle;
45
47{
48 if (!c || c->which != DATA1N_tag)
49 return 0;
50 if (!c->u.tag.element)
51 {
52 yaz_log(YLOG_WARN, "Tag %s is local", c->u.tag.tag);
53 return 0;
54 }
55 if (c->u.tag.element->tag->which != DATA1T_numeric)
56 {
57 yaz_log(YLOG_WARN, "Tag %s is not numeric", c->u.tag.tag);
58 return 0;
59 }
60 if (eh->select && !c->u.tag.node_selected)
61 return 0;
62 return c->u.tag.element->tag->value.numeric;
63}
64
65static int is_data_tag(ExpHandle *eh, data1_node *c)
66{
67 if (!c || c->which != DATA1N_data)
68 return 0;
69 if (eh->select && !c->u.tag.node_selected)
70 return 0;
71 return 1;
72}
73
74static Odr_int *f_integer(ExpHandle *eh, data1_node *c)
75{
76 char intbuf[64];
77
78 c = c->child;
79 if (!is_data_tag(eh, c) || c->u.data.len >= sizeof(intbuf))
80 return 0;
81 memcpy(intbuf, c->u.data.data, c->u.data.len);
82 intbuf[c->u.data.len] = '\0';
83 return odr_intdup(eh->o, atoi(intbuf));
84}
85
86static char *f_string(ExpHandle *eh, data1_node *c)
87{
88 char *r;
89
90 c = c->child;
91 if (!is_data_tag(eh, c))
92 return 0;
93 r = (char *)odr_malloc(eh->o, c->u.data.len + 1);
94 memcpy(r, c->u.data.data, c->u.data.len);
95 r[c->u.data.len] = '\0';
96 return r;
97}
98
99static bool_t *f_bool(ExpHandle *eh, data1_node *c)
100{
101 bool_t *tf;
102 char intbuf[64];
103
104 c = c->child;
105 if (!is_data_tag (eh, c) || c->u.data.len >= sizeof(intbuf))
106 return 0;
107 memcpy(intbuf, c->u.data.data, c->u.data.len);
108 intbuf[c->u.data.len] = '\0';
109 tf = (int *)odr_malloc(eh->o, sizeof(*tf));
110 *tf = atoi(intbuf);
111 return tf;
112}
113
114static Odr_oid *f_oid(ExpHandle *eh, data1_node *c, oid_class oclass)
115{
116 char oidstr[128];
117
118 c = c->child;
119 if (!is_data_tag(eh, c) || c->u.data.len >= sizeof(oidstr))
120 return 0;
121 memcpy(oidstr, c->u.data.data, c->u.data.len);
122 oidstr[c->u.data.len] = '\0';
123
124 return yaz_string_to_oid_odr(yaz_oid_std(),
125 CLASS_GENERAL, oidstr, eh->o);
126}
127
128static Z_IntUnit *f_intunit(ExpHandle *eh, data1_node *c)
129{
130 /* fix */
131 return 0;
132}
133
134static Z_HumanString *f_humstring(ExpHandle *eh, data1_node *c)
135{
136 Z_HumanString *r;
137 Z_HumanStringUnit *u;
138
139 c = c->child;
140 if (!is_data_tag(eh, c))
141 return 0;
142 r = (Z_HumanString *)odr_malloc(eh->o, sizeof(*r));
143 r->num_strings = 1;
144 r->strings = (Z_HumanStringUnit **)odr_malloc(eh->o, sizeof(Z_HumanStringUnit*));
145 r->strings[0] = u = (Z_HumanStringUnit *)odr_malloc(eh->o, sizeof(*u));
146 u->language = 0;
147 u->text = (char *)odr_malloc(eh->o, c->u.data.len+1);
148 memcpy(u->text, c->u.data.data, c->u.data.len);
149 u->text[c->u.data.len] = '\0';
150 return r;
151}
152
153static Z_CommonInfo *f_commonInfo(ExpHandle *eh, data1_node *n)
154{
155 Z_CommonInfo *res = (Z_CommonInfo *)odr_malloc(eh->o, sizeof(*res));
156 data1_node *c;
157
158 res->dateAdded = 0;
159 res->dateChanged = 0;
160 res->expiry = 0;
161 res->humanStringLanguage = 0;
162 res->otherInfo = 0;
163
164 for (c = n->child; c; c = c->next)
165 {
166 switch (is_numeric_tag(eh, c))
167 {
168 case 601: res->dateAdded = f_string(eh, c); break;
169 case 602: res->dateChanged = f_string(eh, c); break;
170 case 603: res->expiry = f_string(eh, c); break;
171 case 604: res->humanStringLanguage = f_string(eh, c); break;
172 }
173 }
174 return res;
175}
176
177Odr_oid **f_oid_seq(ExpHandle *eh, data1_node *n, int *num, oid_class oclass)
178{
179 Odr_oid **res;
180 data1_node *c;
181 int i;
182
183 *num = 0;
184 for (c = n->child ; c; c = c->next)
185 if (is_numeric_tag(eh, c) == 1000)
186 ++(*num);
187 if (!*num)
188 return NULL;
189 res = (Odr_oid **)odr_malloc (eh->o, sizeof(*res) * (*num));
190 for (c = n->child, i = 0 ; c; c = c->next)
191 if (is_numeric_tag(eh, c) == 1000)
192 res[i++] = f_oid (eh, c, oclass);
193 return res;
194}
195
196char **f_string_seq(ExpHandle *eh, data1_node *n, int *num)
197{
198 char **res;
199 data1_node *c;
200 int i;
201
202 *num = 0;
203 for (c = n->child ; c; c = c->next)
204 {
205 if (is_numeric_tag(eh, c) != 1001)
206 continue;
207 ++(*num);
208 }
209 if (!*num)
210 return NULL;
211 res = (char **)odr_malloc(eh->o, sizeof(*res) * (*num));
212 for (c = n->child, i = 0 ; c; c = c->next)
213 {
214 if (is_numeric_tag(eh, c) != 1001)
215 continue;
216 res[i++] = f_string(eh, c);
217 }
218 return res;
219}
220
221Z_ProximitySupport *f_proximitySupport(ExpHandle *eh, data1_node *n)
222{
223 Z_ProximitySupport *res = (Z_ProximitySupport *)
224 odr_malloc(eh->o, sizeof(*res));
225 res->anySupport = eh->false_value;
226 res->num_unitsSupported = 0;
227 res->unitsSupported = 0;
228 return res;
229}
230
231Z_RpnCapabilities *f_rpnCapabilities(ExpHandle *eh, data1_node *n)
232{
233 Z_RpnCapabilities *res = (Z_RpnCapabilities *)
234 odr_malloc(eh->o, sizeof(*res));
235 data1_node *c;
236
237 res->num_operators = 0;
238 res->operators = NULL;
239 res->resultSetAsOperandSupported = eh->false_value;
240 res->restrictionOperandSupported = eh->false_value;
241 res->proximity = NULL;
242
243 for (c = n->child; c; c = c->next)
244 {
245 int i = 0;
246 switch (is_numeric_tag(eh, c))
247 {
248 case 550:
249 for (n = c->child; n; n = n->next)
250 {
251 if (is_numeric_tag(eh, n) != 551)
252 continue;
253 (res->num_operators)++;
254 }
255 if (res->num_operators)
256 res->operators = (Odr_int **)
257 odr_malloc(eh->o, res->num_operators
258 * sizeof(*res->operators));
259 for (n = c->child; n; n = n->next)
260 {
261 if (is_numeric_tag(eh, n) != 551)
262 continue;
263 res->operators[i++] = f_integer(eh, n);
264 }
265 break;
266 case 552:
267 res->resultSetAsOperandSupported = f_bool(eh, c);
268 break;
269 case 553:
270 res->restrictionOperandSupported = f_bool(eh, c);
271 break;
272 case 554:
273 res->proximity = f_proximitySupport(eh, c);
274 break;
275 }
276 }
277 return res;
278}
279
280Z_QueryTypeDetails *f_queryTypeDetails (ExpHandle *eh, data1_node *n)
281{
282 Z_QueryTypeDetails *res = (Z_QueryTypeDetails *)
283 odr_malloc(eh->o, sizeof(*res));
284 data1_node *c;
285
286 res->which = Z_QueryTypeDetails_rpn;
287 res->u.rpn = 0;
288 for (c = n->child; c; c = c->next)
289 {
290 switch (is_numeric_tag(eh, c))
291 {
292 case 519:
293 res->which = Z_QueryTypeDetails_rpn;
294 res->u.rpn = f_rpnCapabilities (eh, c);
295 break;
296 case 520:
297 break;
298 case 521:
299 break;
300 }
301 }
302 return res;
303}
304
305static Z_AccessInfo *f_accessInfo(ExpHandle *eh, data1_node *n)
306{
307 Z_AccessInfo *res = (Z_AccessInfo *)odr_malloc(eh->o, sizeof(*res));
308 data1_node *c;
309
310 res->num_queryTypesSupported = 0;
311 res->queryTypesSupported = 0;
312 res->num_diagnosticsSets = 0;
313 res->diagnosticsSets = 0;
314 res->num_attributeSetIds = 0;
315 res->attributeSetIds = 0;
316 res->num_schemas = 0;
317 res->schemas = 0;
318 res->num_recordSyntaxes = 0;
319 res->recordSyntaxes = 0;
320 res->num_resourceChallenges = 0;
321 res->resourceChallenges = 0;
322 res->restrictedAccess = 0;
323 res->costInfo = 0;
324 res->num_variantSets = 0;
325 res->variantSets = 0;
326 res->num_elementSetNames = 0;
327 res->elementSetNames = 0;
328 res->num_unitSystems = 0;
329 res->unitSystems = 0;
330
331 for (c = n->child; c; c = c->next)
332 {
333 int i = 0;
334 switch (is_numeric_tag(eh, c))
335 {
336 case 501:
337 for (n = c->child; n; n = n->next)
338 {
339 if (is_numeric_tag(eh, n) != 518)
340 continue;
341 (res->num_queryTypesSupported)++;
342 }
343 if (res->num_queryTypesSupported)
344 res->queryTypesSupported =
345 (Z_QueryTypeDetails **)
346 odr_malloc(eh->o, res->num_queryTypesSupported
347 * sizeof(*res->queryTypesSupported));
348 for (n = c->child; n; n = n->next)
349 {
350 if (is_numeric_tag(eh, n) != 518)
351 continue;
352 res->queryTypesSupported[i++] = f_queryTypeDetails(eh, n);
353 }
354 break;
355 case 503:
356 res->diagnosticsSets =
357 f_oid_seq(eh, c, &res->num_diagnosticsSets, CLASS_DIAGSET);
358 break;
359 case 505:
360 res->attributeSetIds =
361 f_oid_seq(eh, c, &res->num_attributeSetIds, CLASS_ATTSET);
362 break;
363 case 507:
364 res->schemas =
365 f_oid_seq(eh, c, &res->num_schemas, CLASS_SCHEMA);
366 break;
367 case 509:
368 res->recordSyntaxes =
369 f_oid_seq(eh, c, &res->num_recordSyntaxes, CLASS_RECSYN);
370 break;
371 case 511:
372 res->resourceChallenges =
373 f_oid_seq(eh, c, &res->num_resourceChallenges, CLASS_RESFORM);
374 break;
375 case 513: res->restrictedAccess = NULL; break; /* fix */
376 case 514: res->costInfo = NULL; break; /* fix */
377 case 515:
378 res->variantSets =
379 f_oid_seq(eh, c, &res->num_variantSets, CLASS_VARSET);
380 break;
381 case 516:
382 res->elementSetNames =
383 f_string_seq(eh, c, &res->num_elementSetNames);
384 break;
385 case 517:
386 res->unitSystems = f_string_seq(eh, c, &res->num_unitSystems);
387 break;
388 }
389 }
390 return res;
391}
392
393static Odr_int *f_recordCount(ExpHandle *eh, data1_node *c, int *which)
394{
395 int *wp = which;
396 char intbuf[64];
397
398 c = c->child;
399 if (!is_numeric_tag(eh, c))
400 return 0;
401 if (c->u.tag.element->tag->value.numeric == 210)
402 *wp = Z_DatabaseInfo_actualNumber;
403 else if (c->u.tag.element->tag->value.numeric == 211)
404 *wp = Z_DatabaseInfo_approxNumber;
405 else
406 return 0;
407 c = c->child;
408 if (!c || c->which != DATA1N_data || c->u.data.len >= sizeof(intbuf))
409 return 0;
410 memcpy(intbuf, c->u.data.data, c->u.data.len);
411 intbuf[c->u.data.len] = '\0';
412 return odr_intdup(eh->o, atoi(intbuf));
413}
414
415static Z_ContactInfo *f_contactInfo(ExpHandle *eh, data1_node *n)
416{
417 Z_ContactInfo *res = (Z_ContactInfo *) odr_malloc(eh->o, sizeof(*res));
418 data1_node *c;
419
420 res->name = 0;
421 res->description = 0;
422 res->address = 0;
423 res->email = 0;
424 res->phone = 0;
425
426 for (c = n->child; c; c = c->next)
427 {
428 switch (is_numeric_tag (eh, c))
429 {
430 case 102: res->name = f_string(eh, c); break;
431 case 113: res->description = f_humstring(eh, c); break;
432 case 127: res->address = f_humstring(eh, c); break;
433 case 128: res->email = f_string(eh, c); break;
434 case 129: res->phone = f_string(eh, c); break;
435 }
436 }
437 return res;
438}
439
440static Z_DatabaseList *f_databaseList(ExpHandle *eh, data1_node *n)
441{
442 data1_node *c;
443 Z_DatabaseList *res;
444 int i = 0;
445
446 for (c = n->child; c; c = c->next)
447 {
448 if (is_numeric_tag (eh, c) != 102)
449 continue;
450 ++i;
451 }
452 if (!i)
453 return NULL;
454
455 res = (Z_DatabaseList *)odr_malloc (eh->o, sizeof(*res));
456
457 res->num_databases = i;
458 res->databases = (char **)odr_malloc (eh->o, sizeof(*res->databases) * i);
459 i = 0;
460 for (c = n->child; c; c = c->next)
461 {
462 if (is_numeric_tag(eh, c) != 102)
463 continue;
464 res->databases[i++] = f_string(eh, c);
465 }
466 return res;
467}
468
469static Z_NetworkAddressIA *f_networkAddressIA(ExpHandle *eh, data1_node *n)
470{
471 Z_NetworkAddressIA *res = (Z_NetworkAddressIA *)
472 odr_malloc(eh->o, sizeof(*res));
473 data1_node *c;
474
475 res->hostAddress = 0;
476 res->port = 0;
477
478 for (c = n->child; c; c = c->next)
479 {
480 switch (is_numeric_tag(eh, c))
481 {
482 case 121: res->hostAddress = f_string(eh, c); break;
483 case 122: res->port = f_integer(eh, c); break;
484 }
485 }
486 return res;
487}
488
489static Z_NetworkAddressOther *f_networkAddressOther(ExpHandle *eh,
490 data1_node *n)
491{
492 Z_NetworkAddressOther *res = (Z_NetworkAddressOther *)
493 odr_malloc(eh->o, sizeof(*res));
494 data1_node *c;
495
496 res->type = 0;
497 res->address = 0;
498
499 for (c = n->child; c; c = c->next)
500 {
501 switch (is_numeric_tag(eh, c))
502 {
503 case 124: res->type = f_string(eh, c); break;
504 case 121: res->address = f_string(eh, c); break;
505 }
506 }
507 return res;
508}
509
510static Z_NetworkAddress **f_networkAddresses(ExpHandle *eh, data1_node *n,
511 int *num)
512{
513 Z_NetworkAddress **res = NULL;
514 data1_node *c;
515 int i = 0;
516
517 *num = 0;
518 for (c = n->child; c; c = c->next)
519 {
520 switch (is_numeric_tag(eh, c))
521 {
522 case 120:
523 case 123:
524 (*num)++;
525 break;
526 }
527 }
528
529 if (*num)
530 res = (Z_NetworkAddress **) odr_malloc(eh->o, sizeof(*res) * (*num));
531
532 for (c = n->child; c; c = c->next)
533 {
534 switch (is_numeric_tag(eh, c))
535 {
536 case 120:
537 res[i] = (Z_NetworkAddress *) odr_malloc(eh->o, sizeof(**res));
538 res[i]->which = Z_NetworkAddress_iA;
539 res[i]->u.internetAddress = f_networkAddressIA(eh, c);
540 i++;
541 break;
542 case 123:
543 res[i] = (Z_NetworkAddress *) odr_malloc(eh->o, sizeof(**res));
544 res[i]->which = Z_NetworkAddress_other;
545 res[i]->u.other = f_networkAddressOther(eh, c);
546 i++;
547 break;
548 }
549 }
550 return res;
551}
552
553static Z_CategoryInfo *f_categoryInfo(ExpHandle *eh, data1_node *n)
554{
555 Z_CategoryInfo *res = (Z_CategoryInfo *)odr_malloc(eh->o, sizeof(*res));
556 data1_node *c;
557
558 res->category = 0;
559 res->originalCategory = 0;
560 res->description = 0;
561 res->asn1Module = 0;
562 for (c = n->child; c; c = c->next)
563 {
564 switch (is_numeric_tag(eh, c))
565 {
566 case 102: res->category = f_string(eh, c); break;
567 case 302: res->originalCategory = f_string(eh, c); break;
568 case 113: res->description = f_humstring(eh, c); break;
569 case 303: res->asn1Module = f_string (eh, c); break;
570 }
571 }
572 return res;
573}
574
575static Z_CategoryList *f_categoryList(ExpHandle *eh, data1_node *n)
576{
577 Z_CategoryList *res = (Z_CategoryList *)odr_malloc(eh->o, sizeof(*res));
578 data1_node *c;
579
580 res->commonInfo = 0;
581 res->num_categories = 0;
582 res->categories = NULL;
583
584 for (c = n->child; c; c = c->next)
585 {
586 int i = 0;
587
588 switch (is_numeric_tag(eh, c))
589 {
590 case 600: res->commonInfo = f_commonInfo(eh, c); break;
591 case 300:
592 for (n = c->child; n; n = n->next)
593 {
594 if (is_numeric_tag(eh, n) != 301)
595 continue;
596 (res->num_categories)++;
597 }
598 if (res->num_categories)
599 res->categories =
600 (Z_CategoryInfo **)odr_malloc(eh->o, res->num_categories
601 * sizeof(*res->categories));
602 for (n = c->child; n; n = n->next)
603 {
604 if (is_numeric_tag(eh, n) != 301)
605 continue;
606 res->categories[i++] = f_categoryInfo(eh, n);
607 }
608 break;
609 }
610 }
611 assert (res->num_categories && res->categories);
612 return res;
613}
614
615static Z_TargetInfo *f_targetInfo(ExpHandle *eh, data1_node *n)
616{
617 Z_TargetInfo *res = (Z_TargetInfo *)odr_malloc(eh->o, sizeof(*res));
618 data1_node *c;
619
620 res->commonInfo = 0;
621 res->name = 0;
622 res->recentNews = 0;
623 res->icon = 0;
624 res->namedResultSets = 0;
625 res->multipleDBsearch = 0;
626 res->maxResultSets = 0;
627 res->maxResultSize = 0;
628 res->maxTerms = 0;
629 res->timeoutInterval = 0;
630 res->welcomeMessage = 0;
631 res->contactInfo = 0;
632 res->description = 0;
633 res->num_nicknames = 0;
634 res->nicknames = 0;
635 res->usageRest = 0;
636 res->paymentAddr = 0;
637 res->hours = 0;
638 res->num_dbCombinations = 0;
639 res->dbCombinations = 0;
640 res->num_addresses = 0;
641 res->addresses = 0;
642 res->num_languages = 0;
643 res->languages = NULL;
644 res->commonAccessInfo = 0;
645
646 for (c = n->child; c; c = c->next)
647 {
648 int i = 0;
649
650 switch (is_numeric_tag(eh, c))
651 {
652 case 600: res->commonInfo = f_commonInfo(eh, c); break;
653 case 102: res->name = f_string(eh, c); break;
654 case 103: res->recentNews = f_humstring(eh, c); break;
655 case 104: res->icon = NULL; break; /* fix */
656 case 105: res->namedResultSets = f_bool(eh, c); break;
657 case 106: res->multipleDBsearch = f_bool(eh, c); break;
658 case 107: res->maxResultSets = f_integer(eh, c); break;
659 case 108: res->maxResultSize = f_integer(eh, c); break;
660 case 109: res->maxTerms = f_integer(eh, c); break;
661 case 110: res->timeoutInterval = f_intunit(eh, c); break;
662 case 111: res->welcomeMessage = f_humstring(eh, c); break;
663 case 112: res->contactInfo = f_contactInfo(eh, c); break;
664 case 113: res->description = f_humstring(eh, c); break;
665 case 114:
666 res->num_nicknames = 0;
667 for (n = c->child; n; n = n->next)
668 {
669 if (is_numeric_tag(eh, n) != 102)
670 continue;
671 (res->num_nicknames)++;
672 }
673 if (res->num_nicknames)
674 res->nicknames =
675 (char **)odr_malloc(eh->o, res->num_nicknames
676 * sizeof(*res->nicknames));
677 for (n = c->child; n; n = n->next)
678 {
679 if (is_numeric_tag(eh, n) != 102)
680 continue;
681 res->nicknames[i++] = f_string(eh, n);
682 }
683 break;
684 case 115: res->usageRest = f_humstring(eh, c); break;
685 case 116: res->paymentAddr = f_humstring(eh, c); break;
686 case 117: res->hours = f_humstring(eh, c); break;
687 case 118:
688 res->num_dbCombinations = 0;
689 for (n = c->child; n; n = n->next)
690 {
691 if (is_numeric_tag(eh, n) != 605)
692 continue;
693 (res->num_dbCombinations)++;
694 }
695 if (res->num_dbCombinations)
696 res->dbCombinations =
697 (Z_DatabaseList **)
698 odr_malloc(eh->o, res->num_dbCombinations
699 * sizeof(*res->dbCombinations));
700 for (n = c->child; n; n = n->next)
701 {
702 if (is_numeric_tag(eh, n) != 605)
703 continue;
704 res->dbCombinations[i++] = f_databaseList(eh, n);
705 }
706 break;
707 case 119:
708 res->addresses =
709 f_networkAddresses(eh, c, &res->num_addresses);
710 break;
711 case 125:
712 res->num_languages = 0;
713 for (n = c->child; n; n = n->next)
714 {
715 if (is_numeric_tag(eh, n) != 126)
716 continue;
717 (res->num_languages)++;
718 }
719 if (res->num_languages)
720 res->languages = (char **)
721 odr_malloc(eh->o, res->num_languages *
722 sizeof(*res->languages));
723 for (n = c->child; n; n = n->next)
724 {
725 if (is_numeric_tag(eh, n) != 126)
726 continue;
727 res->languages[i++] = f_string (eh, n);
728 }
729 break;
730 case 500: res->commonAccessInfo = f_accessInfo(eh, c); break;
731 }
732 }
733 if (!res->namedResultSets)
734 res->namedResultSets = eh->false_value;
735 if (!res->multipleDBsearch)
736 res->multipleDBsearch = eh->false_value;
737 return res;
738}
739
740static Z_DatabaseInfo *f_databaseInfo(ExpHandle *eh, data1_node *n)
741{
742 Z_DatabaseInfo *res = (Z_DatabaseInfo *)odr_malloc(eh->o, sizeof(*res));
743 data1_node *c;
744
745 res->commonInfo = 0;
746 res->name = 0;
747 res->explainDatabase = 0;
748 res->num_nicknames = 0;
749 res->nicknames = 0;
750 res->icon = 0;
751 res->userFee = 0;
752 res->available = 0;
753 res->titleString = 0;
754 res->num_keywords = 0;
755 res->keywords = 0;
756 res->description = 0;
757 res->associatedDbs = 0;
758 res->subDbs = 0;
759 res->disclaimers = 0;
760 res->news = 0;
761 res->u.actualNumber = 0;
762 res->defaultOrder = 0;
763 res->avRecordSize = 0;
764 res->maxRecordSize = 0;
765 res->hours = 0;
766 res->bestTime = 0;
767 res->lastUpdate = 0;
768 res->updateInterval = 0;
769 res->coverage = 0;
770 res->proprietary = 0;
771 res->copyrightText = 0;
772 res->copyrightNotice = 0;
773 res->producerContactInfo = 0;
774 res->supplierContactInfo = 0;
775 res->submissionContactInfo = 0;
776 res->accessInfo = 0;
777
778 for (c = n->child; c; c = c->next)
779 {
780 int i = 0;
781
782 switch (is_numeric_tag(eh, c))
783 {
784 case 600: res->commonInfo = f_commonInfo(eh, c); break;
785 case 102: res->name = f_string(eh, c); break;
786 case 226: res->explainDatabase = odr_nullval(); break;
787 case 114:
788 res->num_nicknames = 0;
789 for (n = c->child; n; n = n->next)
790 {
791 if (!is_numeric_tag(eh, n) ||
792 n->u.tag.element->tag->value.numeric != 102)
793 continue;
794 (res->num_nicknames)++;
795 }
796 if (res->num_nicknames)
797 res->nicknames =
798 (char **)odr_malloc (eh->o, res->num_nicknames
799 * sizeof(*res->nicknames));
800 for (n = c->child; n; n = n->next)
801 {
802 if (!is_numeric_tag(eh, n) ||
803 n->u.tag.element->tag->value.numeric != 102)
804 continue;
805 res->nicknames[i++] = f_string (eh, n);
806 }
807 break;
808 case 104: res->icon = 0; break; /* fix */
809 case 201: res->userFee = f_bool(eh, c); break;
810 case 202: res->available = f_bool(eh, c); break;
811 case 203: res->titleString = f_humstring(eh, c); break;
812 case 227:
813 res->num_keywords = 0;
814 for (n = c->child; n; n = n->next)
815 {
816 if (is_numeric_tag(eh, n) != 1000)
817 continue;
818 (res->num_keywords)++;
819 }
820 if (res->num_keywords)
821 res->keywords =
822 (Z_HumanString **)odr_malloc (eh->o, res->num_keywords
823 * sizeof(*res->keywords));
824 for (n = c->child; n; n = n->next)
825 {
826 if (is_numeric_tag(eh, n) != 1000)
827 continue;
828 res->keywords[i++] = f_humstring (eh, n);
829 }
830 break;
831 case 113: res->description = f_humstring(eh, c); break;
832 case 205:
833 res->associatedDbs = f_databaseList (eh, c);
834 break;
835 case 206:
836 res->subDbs = f_databaseList (eh, c);
837 break;
838 case 207: res->disclaimers = f_humstring(eh, c); break;
839 case 103: res->news = f_humstring(eh, c); break;
840 case 209: res->u.actualNumber =
841 f_recordCount(eh, c, &res->which); break;
842 case 212: res->defaultOrder = f_humstring(eh, c); break;
843 case 213: res->avRecordSize = f_integer(eh, c); break;
844 case 214: res->maxRecordSize = f_integer(eh, c); break;
845 case 215: res->hours = f_humstring(eh, c); break;
846 case 216: res->bestTime = f_humstring(eh, c); break;
847 case 217: res->lastUpdate = f_string(eh, c); break;
848 case 218: res->updateInterval = f_intunit(eh, c); break;
849 case 219: res->coverage = f_humstring(eh, c); break;
850 case 220: res->proprietary = f_bool(eh, c); break;
851 case 221: res->copyrightText = f_humstring(eh, c); break;
852 case 222: res->copyrightNotice = f_humstring(eh, c); break;
853 case 223: res->producerContactInfo = f_contactInfo(eh, c); break;
854 case 224: res->supplierContactInfo = f_contactInfo(eh, c); break;
855 case 225: res->submissionContactInfo = f_contactInfo(eh, c); break;
856 case 500: res->accessInfo = f_accessInfo(eh, c); break;
857 }
858 }
859 if (!res->userFee)
860 res->userFee = eh->false_value;
861 if (!res->available)
862 res->available = eh->true_value;
863 return res;
864}
865
866Z_StringOrNumeric *f_stringOrNumeric(ExpHandle *eh, data1_node *n)
867{
868 Z_StringOrNumeric *res = (Z_StringOrNumeric *)
869 odr_malloc (eh->o, sizeof(*res));
870 data1_node *c;
871 for (c = n->child; c; c = c->next)
872 {
873 switch (is_numeric_tag(eh, c))
874 {
875 case 1001:
876 res->which = Z_StringOrNumeric_string;
877 res->u.string = f_string(eh, c);
878 break;
879 case 1002:
880 res->which = Z_StringOrNumeric_numeric;
881 res->u.numeric = f_integer(eh, c);
882 break;
883 }
884 }
885 return res;
886}
887
888Z_AttributeDescription *f_attributeDescription(
889 ExpHandle *eh, data1_node *n)
890{
891 Z_AttributeDescription *res = (Z_AttributeDescription *)
892 odr_malloc(eh->o, sizeof(*res));
893 data1_node *c;
894 int i = 0;
895
896 res->name = 0;
897 res->description = 0;
898 res->attributeValue = 0;
899 res->num_equivalentAttributes = 0;
900 res->equivalentAttributes = 0;
901
902 for (c = n->child; c; c = c->next)
903 {
904 switch (is_numeric_tag(eh, c))
905 {
906 case 102: res->name = f_string(eh, c); break;
907 case 113: res->description = f_humstring(eh, c); break;
908 case 710: res->attributeValue = f_stringOrNumeric(eh, c); break;
909 case 752: (res->num_equivalentAttributes++); break;
910 }
911 }
912 if (res->num_equivalentAttributes)
913 res->equivalentAttributes = (Z_StringOrNumeric **)
914 odr_malloc(eh->o, sizeof(*res->equivalentAttributes) *
915 res->num_equivalentAttributes);
916 for (c = n->child; c; c = c->next)
917 if (is_numeric_tag(eh, c) == 752)
918 res->equivalentAttributes[i++] = f_stringOrNumeric(eh, c);
919 return res;
920}
921
922Z_AttributeType *f_attributeType(ExpHandle *eh, data1_node *n)
923{
924 Z_AttributeType *res = (Z_AttributeType *)
925 odr_malloc(eh->o, sizeof(*res));
926 data1_node *c;
927
928 res->name = 0;
929 res->description = 0;
930 res->attributeType = 0;
931 res->num_attributeValues = 0;
932 res->attributeValues = 0;
933
934 for (c = n->child; c; c = c->next)
935 {
936 int i = 0;
937 switch (is_numeric_tag(eh, c))
938 {
939 case 102: res->name = f_string(eh, c); break;
940 case 113: res->description = f_humstring(eh, c); break;
941 case 704: res->attributeType = f_integer(eh, c); break;
942 case 708:
943 for (n = c->child; n; n = n->next)
944 {
945 if (is_numeric_tag(eh, n) != 709)
946 continue;
947 (res->num_attributeValues)++;
948 }
949 if (res->num_attributeValues)
950 res->attributeValues = (Z_AttributeDescription **)
951 odr_malloc(eh->o, res->num_attributeValues
952 * sizeof(*res->attributeValues));
953 for (n = c->child; n; n = n->next)
954 {
955 if (is_numeric_tag(eh, n) != 709)
956 continue;
957 res->attributeValues[i++] = f_attributeDescription(eh, n);
958 }
959 break;
960 }
961 }
962 return res;
963}
964
965Z_AttributeSetInfo *f_attributeSetInfo(ExpHandle *eh, data1_node *n)
966{
967 Z_AttributeSetInfo *res = (Z_AttributeSetInfo *)
968 odr_malloc(eh->o, sizeof(*res));
969 data1_node *c;
970
971 res->commonInfo = 0;
972 res->attributeSet = 0;
973 res->name = 0;
974 res->num_attributes = 0;
975 res->attributes = 0;
976 res->description = 0;
977 for (c = n->child; c; c = c->next)
978 {
979 int i = 0;
980 switch (is_numeric_tag(eh, c))
981 {
982 case 600: res->commonInfo = f_commonInfo(eh, c); break;
983 case 1000: res->attributeSet = f_oid(eh, c, CLASS_ATTSET); break;
984 case 102: res->name = f_string(eh, c); break;
985 case 750:
986 for (n = c->child; n; n = n->next)
987 {
988 if (is_numeric_tag(eh, n) != 751)
989 continue;
990 (res->num_attributes)++;
991 }
992 if (res->num_attributes)
993 res->attributes = (Z_AttributeType **)
994 odr_malloc(eh->o, res->num_attributes
995 * sizeof(*res->attributes));
996 for (n = c->child; n; n = n->next)
997 {
998 if (is_numeric_tag(eh, n) != 751)
999 continue;
1000 res->attributes[i++] = f_attributeType(eh, n);
1001 }
1002 break;
1003 case 113: res->description = f_humstring(eh, c); break;
1004 }
1005 }
1006 return res;
1007}
1008
1009Z_OmittedAttributeInterpretation *f_omittedAttributeInterpretation(
1010 ExpHandle *eh, data1_node *n)
1011{
1012 Z_OmittedAttributeInterpretation *res = (Z_OmittedAttributeInterpretation*)
1013 odr_malloc(eh->o, sizeof(*res));
1014 data1_node *c;
1015
1016 res->defaultValue = 0;
1017 res->defaultDescription = 0;
1018 for (c = n->child; c; c = c->next)
1019 {
1020 switch (is_numeric_tag(eh, c))
1021 {
1022 case 706:
1023 res->defaultValue = f_stringOrNumeric(eh, c);
1024 break;
1025 case 113:
1026 res->defaultDescription = f_humstring(eh, c);
1027 break;
1028 }
1029 }
1030 return res;
1031}
1032
1033Z_AttributeValue *f_attributeValue(ExpHandle *eh, data1_node *n)
1034{
1035 Z_AttributeValue *res = (Z_AttributeValue *)
1036 odr_malloc(eh->o, sizeof(*res));
1037 data1_node *c;
1038
1039 res->value = 0;
1040 res->description = 0;
1041 res->num_subAttributes = 0;
1042 res->subAttributes = 0;
1043 res->num_superAttributes = 0;
1044 res->superAttributes = 0;
1045 res->partialSupport = 0;
1046 for (c = n->child; c; c = c->next)
1047 {
1048 int i = 0;
1049 switch (is_numeric_tag (eh, c))
1050 {
1051 case 710:
1052 res->value = f_stringOrNumeric(eh, c); break;
1053 case 113:
1054 res->description = f_humstring(eh, c); break;
1055 case 712:
1056 for (n = c->child; n; n = n->next)
1057 {
1058 if (is_numeric_tag(eh, n) != 713)
1059 continue;
1060 (res->num_subAttributes)++;
1061 }
1062 if (res->num_subAttributes)
1063 res->subAttributes =
1064 (Z_StringOrNumeric **)
1065 odr_malloc(eh->o, res->num_subAttributes
1066 * sizeof(*res->subAttributes));
1067 for (n = c->child; n; n = n->next)
1068 {
1069 if (is_numeric_tag(eh, n) != 713)
1070 continue;
1071 res->subAttributes[i++] = f_stringOrNumeric(eh, n);
1072 }
1073 break;
1074 case 714:
1075 for (n = c->child; n; n = n->next)
1076 {
1077 if (is_numeric_tag(eh, n) != 715)
1078 continue;
1079 (res->num_superAttributes)++;
1080 }
1081 if (res->num_superAttributes)
1082 res->superAttributes =
1083 (Z_StringOrNumeric **)
1084 odr_malloc(eh->o, res->num_superAttributes
1085 * sizeof(*res->superAttributes));
1086 for (n = c->child; n; n = n->next)
1087 {
1088 if (is_numeric_tag(eh, n) != 715)
1089 continue;
1090 res->superAttributes[i++] = f_stringOrNumeric(eh, n);
1091 }
1092 break;
1093 case 711:
1094 res->partialSupport = odr_nullval();
1095 break;
1096 }
1097 }
1098 return res;
1099}
1100
1101Z_AttributeTypeDetails *f_attributeTypeDetails(ExpHandle *eh, data1_node *n)
1102{
1103 Z_AttributeTypeDetails *res = (Z_AttributeTypeDetails *)
1104 odr_malloc(eh->o, sizeof(*res));
1105 data1_node *c;
1106 res->attributeType = 0;
1107 res->defaultIfOmitted = 0;
1108 res->num_attributeValues = 0;
1109 res->attributeValues = 0;
1110 for (c = n->child; c; c = c->next)
1111 {
1112 int i = 0;
1113 switch (is_numeric_tag(eh, c))
1114 {
1115 case 704: res->attributeType = f_integer(eh, c); break;
1116 case 705:
1117 res->defaultIfOmitted = f_omittedAttributeInterpretation(eh, c);
1118 break;
1119 case 708:
1120 for (n = c->child; n; n = n->next)
1121 {
1122 if (is_numeric_tag(eh, n) != 709)
1123 continue;
1124 (res->num_attributeValues)++;
1125 }
1126 if (res->num_attributeValues)
1127 res->attributeValues =
1128 (Z_AttributeValue **)
1129 odr_malloc(eh->o, res->num_attributeValues
1130 * sizeof(*res->attributeValues));
1131 for (n = c->child; n; n = n->next)
1132 {
1133 if (is_numeric_tag(eh, n) != 709)
1134 continue;
1135 res->attributeValues[i++] = f_attributeValue(eh, n);
1136 }
1137 break;
1138 }
1139 }
1140 return res;
1141}
1142
1143Z_AttributeSetDetails *f_attributeSetDetails(ExpHandle *eh, data1_node *n)
1144{
1145 Z_AttributeSetDetails *res = (Z_AttributeSetDetails *)
1146 odr_malloc(eh->o, sizeof(*res));
1147 data1_node *c;
1148
1149 res->attributeSet = 0;
1150 res->num_attributesByType = 0;
1151 res->attributesByType = 0;
1152 for (c = n->child; c; c = c->next)
1153 {
1154 int i = 0;
1155 switch (is_numeric_tag(eh, c))
1156 {
1157 case 1000: res->attributeSet = f_oid(eh, c, CLASS_ATTSET); break;
1158 case 702:
1159 for (n = c->child; n; n = n->next)
1160 {
1161 if (is_numeric_tag(eh, n) != 703)
1162 continue;
1163 (res->num_attributesByType)++;
1164 }
1165 if (res->num_attributesByType)
1166 res->attributesByType =
1167 (Z_AttributeTypeDetails **)
1168 odr_malloc(eh->o, res->num_attributesByType
1169 * sizeof(*res->attributesByType));
1170 for (n = c->child; n; n = n->next)
1171 {
1172 if (is_numeric_tag(eh, n) != 703)
1173 continue;
1174 res->attributesByType[i++] = f_attributeTypeDetails(eh, n);
1175 }
1176 break;
1177 }
1178 }
1179 return res;
1180}
1181
1182Z_AttributeValueList *f_attributeValueList(ExpHandle *eh, data1_node *n)
1183{
1184 Z_AttributeValueList *res = (Z_AttributeValueList *)
1185 odr_malloc(eh->o, sizeof(*res));
1186 data1_node *c;
1187 int i = 0;
1188
1189 res->num_attributes = 0;
1190 res->attributes = 0;
1191 for (c = n->child; c; c = c->next)
1192 if (is_numeric_tag(eh, c) == 710)
1193 (res->num_attributes)++;
1194 if (res->num_attributes)
1195 {
1196 res->attributes = (Z_StringOrNumeric **)
1197 odr_malloc(eh->o, res->num_attributes * sizeof(*res->attributes));
1198 }
1199 for (c = n->child; c; c = c->next)
1200 if (is_numeric_tag(eh, c) == 710)
1201 res->attributes[i++] = f_stringOrNumeric(eh, c);
1202 return res;
1203}
1204
1205Z_AttributeOccurrence *f_attributeOccurrence(ExpHandle *eh, data1_node *n)
1206{
1207 Z_AttributeOccurrence *res = (Z_AttributeOccurrence *)
1208 odr_malloc(eh->o, sizeof(*res));
1209 data1_node *c;
1210
1211 res->attributeSet = 0;
1212 res->attributeType = 0;
1213 res->mustBeSupplied = 0;
1214 res->which = Z_AttributeOcc_any_or_none;
1215 res->attributeValues.any_or_none = odr_nullval();
1216
1217 for (c = n->child; c; c = c->next)
1218 {
1219 switch (is_numeric_tag(eh, c))
1220 {
1221 case 1000:
1222 res->attributeSet = f_oid(eh, c, CLASS_ATTSET); break;
1223 case 704:
1224 res->attributeType = f_integer(eh, c); break;
1225 case 720:
1226 res->mustBeSupplied = odr_nullval(); break;
1227 case 721:
1228 res->which = Z_AttributeOcc_any_or_none;
1229 res->attributeValues.any_or_none = odr_nullval();
1230 break;
1231 case 722:
1232 res->which = Z_AttributeOcc_specific;
1233 res->attributeValues.specific = f_attributeValueList(eh, c);
1234 break;
1235 }
1236 }
1237 return res;
1238}
1239
1240Z_AttributeCombination *f_attributeCombination(ExpHandle *eh, data1_node *n)
1241{
1242 Z_AttributeCombination *res = (Z_AttributeCombination *)
1243 odr_malloc(eh->o, sizeof(*res));
1244 data1_node *c;
1245 int i = 0;
1246
1247 res->num_occurrences = 0;
1248 res->occurrences = 0;
1249 for (c = n->child; c; c = c->next)
1250 if (is_numeric_tag(eh, c) == 719)
1251 (res->num_occurrences)++;
1252 if (res->num_occurrences)
1253 {
1254 res->occurrences = (Z_AttributeOccurrence **)
1255 odr_malloc(eh->o, res->num_occurrences * sizeof(*res->occurrences));
1256 }
1257 for (c = n->child; c; c = c->next)
1258 if (is_numeric_tag(eh, c) == 719)
1259 res->occurrences[i++] = f_attributeOccurrence(eh, c);
1260 assert (res->num_occurrences);
1261 return res;
1262}
1263
1264Z_AttributeCombinations *f_attributeCombinations(ExpHandle *eh, data1_node *n)
1265{
1266 Z_AttributeCombinations *res = (Z_AttributeCombinations *)
1267 odr_malloc(eh->o, sizeof(*res));
1268 data1_node *c;
1269 res->defaultAttributeSet = 0;
1270 res->num_legalCombinations = 0;
1271 res->legalCombinations = 0;
1272
1273 for (c = n->child; c; c = c->next)
1274 {
1275 int i = 0;
1276 switch (is_numeric_tag(eh, c))
1277 {
1278 case 1000:
1279 res->defaultAttributeSet = f_oid(eh, c, CLASS_ATTSET);
1280 break;
1281 case 717:
1282 for (n = c->child; n; n = n->next)
1283 {
1284 if (is_numeric_tag(eh, n) != 718)
1285 continue;
1286 (res->num_legalCombinations)++;
1287 }
1288 if (res->num_legalCombinations)
1289 res->legalCombinations =
1290 (Z_AttributeCombination **)
1291 odr_malloc (eh->o, res->num_legalCombinations
1292 * sizeof(*res->legalCombinations));
1293 for (n = c->child; n; n = n->next)
1294 {
1295 if (is_numeric_tag(eh, n) != 718)
1296 continue;
1297 res->legalCombinations[i++] = f_attributeCombination(eh, n);
1298 }
1299 break;
1300 }
1301 }
1302 assert(res->num_legalCombinations);
1303 return res;
1304}
1305
1306Z_AttributeDetails *f_attributeDetails(ExpHandle *eh, data1_node *n)
1307{
1308 Z_AttributeDetails *res = (Z_AttributeDetails *)
1309 odr_malloc(eh->o, sizeof(*res));
1310 data1_node *c;
1311
1312 res->commonInfo = 0;
1313 res->databaseName = 0;
1314 res->num_attributesBySet = 0;
1315 res->attributesBySet = NULL;
1316 res->attributeCombinations = NULL;
1317
1318 for (c = n->child; c; c = c->next)
1319 {
1320 int i = 0;
1321 switch (is_numeric_tag(eh, c))
1322 {
1323 case 600: res->commonInfo = f_commonInfo(eh, c); break;
1324 case 102: res->databaseName = f_string(eh, c); break;
1325 case 700:
1326 for (n = c->child; n; n = n->next)
1327 {
1328 if (is_numeric_tag(eh, n) != 701)
1329 continue;
1330 (res->num_attributesBySet)++;
1331 }
1332 if (res->num_attributesBySet)
1333 res->attributesBySet =
1334 (Z_AttributeSetDetails **)
1335 odr_malloc(eh->o, res->num_attributesBySet
1336 * sizeof(*res->attributesBySet));
1337 for (n = c->child; n; n = n->next)
1338 {
1339 if (is_numeric_tag(eh, n) != 701)
1340 continue;
1341 res->attributesBySet[i++] = f_attributeSetDetails(eh, n);
1342 }
1343 break;
1344 case 716:
1345 res->attributeCombinations = f_attributeCombinations(eh, c);
1346 break;
1347 }
1348 }
1349 return res;
1350}
1351
1353 int select, ODR o)
1354{
1355 ExpHandle eh;
1356 Z_ExplainRecord *res = (Z_ExplainRecord *)odr_malloc(o, sizeof(*res));
1357
1358 eh.dh = dh;
1359 eh.select = select;
1360 eh.o = o;
1361 eh.false_value = (int *)odr_malloc(eh.o, sizeof(eh.false_value));
1362 *eh.false_value = 0;
1363 eh.true_value = (int *)odr_malloc(eh.o, sizeof(eh.true_value));
1364 *eh.true_value = 1;
1365
1366 assert(n->which == DATA1N_root);
1367 if (strcmp(n->u.root.type, "explain"))
1368 {
1369 yaz_log(YLOG_WARN, "Attempt to convert a non-Explain record");
1370 return 0;
1371 }
1372 for (n = n->child; n; n = n->next)
1373 {
1374 switch (is_numeric_tag(&eh, n))
1375 {
1376 case 1:
1377 res->which = Z_Explain_categoryList;
1378 if (!(res->u.categoryList = f_categoryList(&eh, n)))
1379 return 0;
1380 return res;
1381 case 2:
1382 res->which = Z_Explain_targetInfo;
1383 if (!(res->u.targetInfo = f_targetInfo(&eh, n)))
1384 return 0;
1385 return res;
1386 case 3:
1387 res->which = Z_Explain_databaseInfo;
1388 if (!(res->u.databaseInfo = f_databaseInfo(&eh, n)))
1389 return 0;
1390 return res;
1391 case 7:
1392 res->which = Z_Explain_attributeSetInfo;
1393 if (!(res->u.attributeSetInfo = f_attributeSetInfo(&eh, n)))
1394 return 0;
1395 return res;
1396 case 10:
1397 res->which = Z_Explain_attributeDetails;
1398 if (!(res->u.attributeDetails = f_attributeDetails(&eh, n)))
1399 return 0;
1400 return res;
1401 }
1402 }
1403 yaz_log(YLOG_WARN, "No category in Explain record");
1404 return 0;
1405}
1406/*
1407 * Local variables:
1408 * c-basic-offset: 4
1409 * c-file-style: "Stroustrup"
1410 * indent-tabs-mode: nil
1411 * End:
1412 * vim: shiftwidth=4 tabstop=8 expandtab
1413 */
1414
static Z_AccessInfo * f_accessInfo(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:305
static Z_NetworkAddress ** f_networkAddresses(ExpHandle *eh, data1_node *n, int *num)
Definition d1_expout.c:510
static Z_NetworkAddressOther * f_networkAddressOther(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:489
static Z_CommonInfo * f_commonInfo(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:153
Z_StringOrNumeric * f_stringOrNumeric(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:866
Z_AttributeCombination * f_attributeCombination(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:1240
static Odr_int * f_recordCount(ExpHandle *eh, data1_node *c, int *which)
Definition d1_expout.c:393
static Odr_int * f_integer(ExpHandle *eh, data1_node *c)
Definition d1_expout.c:74
Z_AttributeCombinations * f_attributeCombinations(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:1264
Z_AttributeValue * f_attributeValue(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:1033
static int is_data_tag(ExpHandle *eh, data1_node *c)
Definition d1_expout.c:65
static Z_NetworkAddressIA * f_networkAddressIA(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:469
Z_AttributeValueList * f_attributeValueList(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:1182
char ** f_string_seq(ExpHandle *eh, data1_node *n, int *num)
Definition d1_expout.c:196
static char * f_string(ExpHandle *eh, data1_node *c)
Definition d1_expout.c:86
static Odr_oid * f_oid(ExpHandle *eh, data1_node *c, oid_class oclass)
Definition d1_expout.c:114
static Z_ContactInfo * f_contactInfo(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:415
Z_ProximitySupport * f_proximitySupport(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:221
Z_ExplainRecord * data1_nodetoexplain(data1_handle dh, data1_node *n, int select, ODR o)
Definition d1_expout.c:1352
static Z_CategoryList * f_categoryList(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:575
static Z_DatabaseInfo * f_databaseInfo(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:740
Z_QueryTypeDetails * f_queryTypeDetails(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:280
Z_AttributeDescription * f_attributeDescription(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:888
Z_AttributeTypeDetails * f_attributeTypeDetails(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:1101
Z_RpnCapabilities * f_rpnCapabilities(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:231
Z_AttributeSetDetails * f_attributeSetDetails(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:1143
Z_AttributeSetInfo * f_attributeSetInfo(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:965
Z_AttributeType * f_attributeType(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:922
static Z_HumanString * f_humstring(ExpHandle *eh, data1_node *c)
Definition d1_expout.c:134
Odr_oid ** f_oid_seq(ExpHandle *eh, data1_node *n, int *num, oid_class oclass)
Definition d1_expout.c:177
Z_AttributeOccurrence * f_attributeOccurrence(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:1205
Z_AttributeDetails * f_attributeDetails(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:1306
static Z_CategoryInfo * f_categoryInfo(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:553
static Z_DatabaseList * f_databaseList(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:440
static bool_t * f_bool(ExpHandle *eh, data1_node *c)
Definition d1_expout.c:99
static int is_numeric_tag(ExpHandle *eh, data1_node *c)
Definition d1_expout.c:46
Z_OmittedAttributeInterpretation * f_omittedAttributeInterpretation(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:1009
static Z_TargetInfo * f_targetInfo(ExpHandle *eh, data1_node *n)
Definition d1_expout.c:615
static Z_IntUnit * f_intunit(ExpHandle *eh, data1_node *c)
Definition d1_expout.c:128
#define DATA1N_tag
Definition data1.h:276
#define DATA1N_data
Definition data1.h:278
#define DATA1N_root
Definition data1.h:274
#define DATA1T_numeric
Definition data1.h:204
int select
Definition d1_expout.c:40
bool_t * false_value
Definition d1_expout.c:42
bool_t * true_value
Definition d1_expout.c:43
data1_handle dh
Definition d1_expout.c:38
data1_xattr * attributes
Definition data1.h:302
struct data1_node::@2::@3 root
char * type
Definition data1.h:290
struct data1_node * child
Definition data1.h:341
char * tag
Definition data1.h:296
char * data
Definition data1.h:307
struct data1_node * next
Definition data1.h:340
union data1_node::@2 u
int which
Definition data1.h:285
char * value
Definition data1.h:328