static int fast_field_init(xmlNodePtr node, struct fast_field *field) { int ret; field->state = FAST_STATE_UNDEFINED; ret = fast_type_init(node, field); if (ret) goto exit; ret = fast_presence_init(node, field); if (ret) goto exit; ret = fast_misc_init(node, field); if (ret) goto exit; switch (field->type) { case FAST_TYPE_INT: case FAST_TYPE_UINT: case FAST_TYPE_STRING: case FAST_TYPE_DECIMAL: node = node->xmlChildrenNode; while (node && node->type != XML_ELEMENT_NODE) node = node->next; ret = fast_op_init(node, field); if (ret) goto exit; ret = fast_reset_init(node, field); if (ret) goto exit; break; case FAST_TYPE_SEQUENCE: ret = fast_sequence_init(node, field); break; default: ret = 1; goto exit; } exit: return ret; }
static int fast_decimal_init_atomic(xmlNodePtr node, struct fast_field *field) { int ret = 0; node = node->xmlChildrenNode; while (node && node->type != XML_ELEMENT_NODE) node = node->next; ret = fast_op_init(node, field); if (ret) goto exit; ret = fast_reset_init(node, field); if (ret) goto exit; exit: return ret; }