28 #include <yaz/proto.h>
39 intbuf[c->
u.
data.len] =
'\0';
40 return odr_intdup(o, atoi(intbuf));
49 r = (
char *)odr_malloc(o, c->
child->
u.
data.len + 1);
58 Z_BriefBib *res = (Z_BriefBib *)odr_malloc(o,
sizeof(*res));
62 if (strcmp(n->
u.
root.type,
"summary"))
64 yaz_log(YLOG_WARN,
"Attempt to convert a non-summary record");
68 res->title =
"[UNKNOWN]";
72 res->bibliographicLevel = 0;
75 res->publicationPlace = 0;
76 res->publicationDate = 0;
77 res->targetSystemKey = 0;
78 res->satisfyingElement = 0;
88 yaz_log(YLOG_WARN,
"Malformed element in Summary record");
91 if (select && !c->
u.
tag.node_selected)
93 switch (c->
u.
tag.element->tag->value.numeric)
95 case 0: res->title =
f_string(c, o);
break;
96 case 1: res->author =
f_string(c, o);
break;
97 case 2: res->callNumber =
f_string(c, o);
break;
98 case 3: res->recordType =
f_string(c, o);
break;
99 case 4: res->bibliographicLevel =
f_string(c, o);
break;
101 case 10: res->publicationPlace =
f_string(c, o);
break;
102 case 11: res->publicationDate =
f_string(c, o);
break;
103 case 12: res->targetSystemKey =
f_string(c, o);
break;
104 case 13: res->satisfyingElement =
f_string(c, o);
break;
105 case 14: res->rank =
f_integer(c, o);
break;
106 case 15: res->documentId =
f_string(c, o);
break;
107 case 16: res->abstract =
f_string(c, o);
break;
110 yaz_log(YLOG_WARN,
"Unknown element in Summary record.");
static char * f_string(data1_node *c, ODR o)
static Odr_int * f_integer(data1_node *c, ODR o)
Z_BriefBib * data1_nodetosummary(data1_handle dh, data1_node *n, int select, ODR o)
struct data1_node::@2::@3 root
struct data1_node * child