int64_t aos_buf_list_len(aos_list_t *l) { aos_buf_t *b; int64_t len = 0; aos_list_for_each_entry(aos_buf_t, b, l, node) { len += aos_buf_size(b); }
int aos_parse_xml_body(aos_list_t *bc, xmlDoc **doc_, xmlNode **root) { int res; aos_buf_t *b; xmlDoc *doc; xmlParserCtxt *ctxt; *root = NULL; ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL); if (ctxt == NULL) { aos_error_log("Failed to create parser context."); return AOSE_INTERNAL_ERROR; } aos_list_for_each_entry(b, bc, node) { xmlParseChunk(ctxt, (char *)b->pos, aos_buf_size(b), 0); }