- struct gdb_xml_parser *parser;
- struct cleanup *before_deleting_result, *back_to;
- struct osdata_parsing_data data = { NULL };
-
- back_to = make_cleanup (null_cleanup, NULL);
- parser = gdb_xml_create_parser_and_cleanup (_("osdata"),
- osdata_elements, &data);
- gdb_xml_use_dtd (parser, "osdata.dtd");
-
- before_deleting_result = make_cleanup (clear_parsing_data, &data);
-
- if (gdb_xml_parse (parser, xml) == 0)
- /* Parsed successfully, don't need to delete the result. */
- discard_cleanups (before_deleting_result);
-
- do_cleanups (back_to);
- return data.osdata;
-}
-#endif
-
-static void
-osdata_item_clear (struct osdata_item *item)
-{
- if (item->columns != NULL)
- {
- struct osdata_column *col;
- int ix;
-
- for (ix = 0;
- VEC_iterate (osdata_column_s, item->columns,
- ix, col);
- ix++)
- {
- xfree (col->name);
- xfree (col->value);
- }
- VEC_free (osdata_column_s, item->columns);
- item->columns = NULL;
- }
-}
-
-void
-osdata_free (struct osdata *osdata)
-{
- if (osdata == NULL)
- return;