+ Z_DatabaseInfo *res = odr_malloc(o, sizeof(*res));
+ data1_node *c;
+ bool_t *fl = odr_malloc(o,sizeof(*fl));
+ bool_t *tr = odr_malloc(o,sizeof(*tr));
+
+ *fl = 0;
+ *tr = 1;
+ res->commonInfo = 0;
+ res->name = 0;
+ res->explainDatabase = 0;
+ res->num_nicknames = 0;
+ res->nicknames = 0;
+ res->icon = 0;
+ res->userFee = 0;
+ res->available = 0;
+ res->titleString = 0;
+ res->num_keywords = 0;
+ res->keywords = 0;
+ res->description = 0;
+ res->associatedDbs = 0;
+ res->subDbs = 0;
+ res->disclaimers = 0;
+ res->news = 0;
+ res->recordCount = 0;
+ res->defaultOrder = 0;
+ res->avRecordSize = 0;
+ res->maxRecordSize = 0;
+ res->hours = 0;
+ res->bestTime = 0;
+ res->lastUpdate = 0;
+ res->updateInterval = 0;
+ res->coverage = 0;
+ res->proprietary = 0;
+ res->copyrightText = 0;
+ res->copyrightNotice = 0;
+ res->producerContactInfo = 0;
+ res->supplierContactInfo = 0;
+ res->submissionContactInfo = 0;
+ res->accessInfo = 0;
+
+ for (c = n->child; c; c = c->next)
+ {
+ if (!numeric_tag (dh, c, o, select))
+ continue;
+ switch (c->u.tag.element->tag->value.numeric)
+ {
+ case 600: res->commonInfo = f_commonInfo(dh, c, select, o); break;
+ case 102: res->name = f_string(dh, c, o); break;
+ case 226: res->explainDatabase = ODR_NULLVAL; break;
+ case 114: res->num_nicknames = 0; res->nicknames = 0; break; /* fix */
+ case 104: res->icon = 0; break; /* fix */
+ case 201: res->userFee = f_bool(dh, c, o); break;
+ case 202: res->available = f_bool(dh, c, o); break;
+ case 203: res->titleString = f_humstring(dh, c, o); break;
+ case 227: res->num_keywords = 0; res->keywords = 0; break; /* fix */
+ case 113: res->description = f_humstring(dh, c, o); break;
+ case 205: res->associatedDbs = 0; break; /* fix */
+ case 206: res->subDbs = 0; break; /* fix */
+ case 207: res->disclaimers = f_humstring(dh, c, o); break;
+ case 103: res->news = f_humstring(dh, c, o); break;
+ case 209: res->recordCount =
+ f_recordCount(dh, c, o, &res->recordCount_which); break;
+ case 212: res->defaultOrder = f_humstring(dh, c, o); break;
+ case 213: res->avRecordSize = f_integer(dh, c, o); break;
+ case 214: res->maxRecordSize = f_integer(dh, c, o); break;
+ case 215: res->hours = f_humstring(dh, c, o); break;
+ case 216: res->bestTime = f_humstring(dh, c, o); break;
+ case 217: res->lastUpdate = f_string(dh, c, o); break;
+ case 218: res->updateInterval = f_intunit(dh, c, o); break;
+ case 219: res->coverage = f_humstring(dh, c, o); break;
+ case 220: res->proprietary = f_bool(dh, c, o); break;
+ case 221: res->copyrightText = f_humstring(dh, c, o); break;
+ case 222: res->copyrightNotice = f_humstring(dh, c, o); break;
+ case 223: res->producerContactInfo = f_contactInfo(dh, c, o); break;
+ case 224: res->supplierContactInfo = f_contactInfo(dh, c, o); break;
+ case 225: res->submissionContactInfo = f_contactInfo(dh, c, o); break;
+ case 500: res->accessInfo = f_accessInfo(dh, c, select, o); break;
+ default:
+ logf(LOG_WARN, "Unknown element in databaseInfo");
+ }
+ }
+ if (!res->userFee)
+ res->userFee = fl;
+ if (!res->available)
+ res->available = tr;
+ return res;