oval_defModel.c   oval_defModel.c 
skipping to change at line 437 skipping to change at line 437
*model) *model)
{ {
__attribute__nonnull__(model); __attribute__nonnull__(model);
struct oval_variable_iterator *iterator = struct oval_variable_iterator *iterator =
(struct oval_variable_iterator *)oval_string_map_values(model->v ariable_map); (struct oval_variable_iterator *)oval_string_map_values(model->v ariable_map);
return iterator; return iterator;
} }
struct oval_definition *oval_definition_get_new(struct oval_definition_mode l *model, const char *id) struct oval_definition *oval_definition_model_get_new_definition(struct ova l_definition_model *model, const char *id)
{ {
struct oval_definition *definition = oval_definition_model_get_defin ition(model, id); struct oval_definition *definition = oval_definition_model_get_defin ition(model, id);
if (definition == NULL) { if (definition == NULL) {
definition = oval_definition_new(model, id); definition = oval_definition_new(model, id);
} }
return definition; return definition;
} }
struct oval_variable *oval_variable_get_new(struct oval_definition_model *m odel, const char *id, oval_variable_type_t type) struct oval_variable *oval_definition_model_get_new_variable(struct oval_de finition_model *model, const char *id, oval_variable_type_t type)
{ {
struct oval_variable *variable = oval_definition_model_get_variable( model, id); struct oval_variable *variable = oval_definition_model_get_variable( model, id);
if (variable == NULL) { if (variable == NULL) {
variable = oval_variable_new(model, id, type); variable = oval_variable_new(model, id, type);
} else if (type != OVAL_VARIABLE_UNKNOWN) { } else if (type != OVAL_VARIABLE_UNKNOWN) {
oval_variable_set_type(variable, type); oval_variable_set_type(variable, type);
} }
return variable; return variable;
} }
struct oval_state *oval_state_get_new(struct oval_definition_model *model, const char *id) struct oval_state *oval_definition_model_get_new_state(struct oval_definiti on_model *model, const char *id)
{ {
struct oval_state *state = oval_definition_model_get_state(model, id ); struct oval_state *state = oval_definition_model_get_state(model, id );
if (state == NULL) { if (state == NULL) {
state = oval_state_new(model, id); state = oval_state_new(model, id);
} }
return state; return state;
} }
struct oval_object *oval_object_get_new(struct oval_definition_model *model , const char *id) struct oval_object *oval_definition_model_get_new_object(struct oval_defini tion_model *model, const char *id)
{ {
struct oval_object *object = oval_definition_model_get_object(model, id); struct oval_object *object = oval_definition_model_get_object(model, id);
if (object == NULL) { if (object == NULL) {
object = oval_object_new(model, id); object = oval_object_new(model, id);
} }
return object; return object;
} }
struct oval_test *oval_test_get_new(struct oval_definition_model *model, co nst char *id) struct oval_test *oval_definition_model_get_new_test(struct oval_definition _model *model, const char *id)
{ {
struct oval_test *test = oval_definition_model_get_test(model, id); struct oval_test *test = oval_definition_model_get_test(model, id);
if (test == NULL) { if (test == NULL) {
test = oval_test_new(model, id); test = oval_test_new(model, id);
} }
return test; return test;
} }
xmlDoc *oval_definition_model_get_metadata_doc(struct oval_definition_model *model) xmlDoc *oval_definition_model_get_metadata_doc(struct oval_definition_model *model)
{ {
return model->metadata_doc; return model->metadata_doc;
} }
xmlNode *oval_definitions_to_dom(struct oval_definition_model *definition_m odel, xmlDocPtr doc, xmlNode * parent) xmlNode *oval_definition_model_to_dom(struct oval_definition_model *definit ion_model, xmlDocPtr doc, xmlNode * parent)
{ {
xmlNodePtr root_node = NULL; xmlNodePtr root_node = NULL;
if (parent) { /* result file */ if (parent) { /* result file */
root_node = xmlNewTextChild(parent, NULL, BAD_CAST "oval_def initions", NULL); root_node = xmlNewTextChild(parent, NULL, BAD_CAST "oval_def initions", NULL);
} else { /* definitions file, we are the root */ } else { /* definitions file, we are the root */
root_node = xmlNewNode(NULL, BAD_CAST "oval_definitions"); root_node = xmlNewNode(NULL, BAD_CAST "oval_definitions");
xmlDocSetRootElement(doc, root_node); xmlDocSetRootElement(doc, root_node);
} }
xmlNewProp(root_node, BAD_CAST "xsi:schemaLocation", BAD_CAST defini tion_model->schema); xmlNewProp(root_node, BAD_CAST "xsi:schemaLocation", BAD_CAST defini tion_model->schema);
xmlNs *ns_common = xmlNewNs(root_node, OVAL_COMMON_NAMESPACE, BAD_CA ST "oval"); xmlNs *ns_common = xmlNewNs(root_node, OVAL_COMMON_NAMESPACE, BAD_CA ST "oval");
xmlNs *ns_xsi = xmlNewNs(root_node, OVAL_XMLNS_XSI, BAD_CAST "xsi"); xmlNs *ns_xsi = xmlNewNs(root_node, OVAL_XMLNS_XSI, BAD_CAST "xsi");
xmlNs *ns_unix = xmlNewNs(root_node, OVAL_DEFINITIONS_UNIX_NS, BAD_C
AST "unix-def");
xmlNs *ns_ind = xmlNewNs(root_node, OVAL_DEFINITIONS_IND_NS, BAD_CAS
T "ind-def");
xmlNs *ns_lin = xmlNewNs(root_node, OVAL_DEFINITIONS_LIN_NS, BAD_CAS
T "lin-def");
xmlNs *ns_defntns = xmlNewNs(root_node, OVAL_DEFINITIONS_NAMESPACE, NULL); xmlNs *ns_defntns = xmlNewNs(root_node, OVAL_DEFINITIONS_NAMESPACE, NULL);
xmlSetNs(root_node, ns_common); xmlSetNs(root_node, ns_common);
xmlSetNs(root_node, ns_xsi); xmlSetNs(root_node, ns_xsi);
xmlSetNs(root_node, ns_unix);
xmlSetNs(root_node, ns_ind);
xmlSetNs(root_node, ns_lin);
xmlSetNs(root_node, ns_defntns); xmlSetNs(root_node, ns_defntns);
/* Always report the generator */ /* Always report the generator */
oval_generator_to_dom(definition_model->generator, doc, root_node); oval_generator_to_dom(definition_model->generator, doc, root_node);
/* Report definitions */ /* Report definitions */
struct oval_definition_iterator *definitions = oval_definition_model _get_definitions(definition_model); struct oval_definition_iterator *definitions = oval_definition_model _get_definitions(definition_model);
if (oval_definition_iterator_has_more(definitions)) { if (oval_definition_iterator_has_more(definitions)) {
xmlNode *definitions_node = NULL; xmlNode *definitions_node = NULL;
while(oval_definition_iterator_has_more(definitions)) { while(oval_definition_iterator_has_more(definitions)) {
skipping to change at line 592 skipping to change at line 598
int retcode = 0; int retcode = 0;
LIBXML_TEST_VERSION; LIBXML_TEST_VERSION;
xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0"); xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0");
if (doc == NULL) { if (doc == NULL) {
oscap_setxmlerr(xmlGetLastError()); oscap_setxmlerr(xmlGetLastError());
return -1; return -1;
} }
oval_definitions_to_dom(model, doc, NULL); oval_definition_model_to_dom(model, doc, NULL);
retcode = xmlSaveFormatFileEnc(file, doc, "UTF-8", 1); retcode = xmlSaveFormatFileEnc(file, doc, "UTF-8", 1);
if (retcode < 1) if (retcode < 1)
oscap_setxmlerr(xmlGetLastError()); oscap_setxmlerr(xmlGetLastError());
xmlFreeDoc(doc); xmlFreeDoc(doc);
return retcode; return retcode;
} }
 End of changes. 9 change blocks. 
7 lines changed or deleted 16 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/