+ Z_DatabaseInfo *res = odr_malloc(o, sizeof(*res));
+ data1_node *c;
+ static bool_t 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 = &fl;
+ res->available = &tr;
+ 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 (c->which != DATA1N_tag || !c->u.tag.element)
+ {
+ logf(LOG_WARN, "Malformed explain record");
+ return 0;
+ }
+ if (select && !c->u.tag.node_selected)
+ continue;
+ switch (c->u.tag.element->tag->value.numeric)
+ {
+ case 600: res->commonInfo = f_commonInfo(c, select, o); break;
+ case 102: res->name = f_string(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(c, o); break;
+ case 202: res->available = f_bool(c, o); break;
+ case 203: res->titleString = f_humstring(c, o); break;
+ case 227: res->num_keywords = 0; res->keywords = 0; break; /* fix */
+ case 113: res->description = f_humstring(c, o); break;
+ case 205: res->associatedDbs = 0; break; /* fix */
+ case 206: res->subDbs = 0; break; /* fix */
+ case 207: res->disclaimers = f_humstring(c, o); break;
+ case 103: res->news = f_humstring(c, o); break;
+ case 209: res->recordCount =
+ f_recordCount(c, o, &res->recordCount_which); break;
+ case 212: res->defaultOrder = f_humstring(c, o); break;
+ case 213: res->avRecordSize = f_integer(c, o); break;
+ case 214: res->maxRecordSize = f_integer(c, o); break;
+ case 215: res->hours = f_humstring(c, o); break;
+ case 216: res->bestTime = f_humstring(c, o); break;
+ case 217: res->lastUpdate = f_string(c, o); break;
+ case 218: res->updateInterval = f_intunit(c, o); break;
+ case 219: res->coverage = f_humstring(c, o); break;
+ case 220: res->proprietary = f_bool(c, o); break;
+ case 221: res->copyrightText = f_humstring(c, o); break;
+ case 222: res->copyrightNotice = f_humstring(c, o); break;
+ case 223: res->producerContactInfo = f_contactInfo(c, o); break;
+ case 224: res->supplierContactInfo = f_contactInfo(c, o); break;
+ case 225: res->submissionContactInfo = f_contactInfo(c, o); break;
+ case 500: res->accessInfo = f_accessInfo(c, select, o); break;
+ default:
+ logf(LOG_WARN, "Unknown element in databaseInfo");
+ }
+ }
+ return res;