int oval_definition_model_bind_variable_model(struct oval_definition_model *defmodel, struct oval_variable_model *varmodel) { struct oval_string_iterator *evar_id_itr; if (!defmodel->bound_variable_models) defmodel->bound_variable_models = oval_collection_new(); oval_collection_add(defmodel->bound_variable_models, varmodel); /* todo: keep reference count for each variable model if it can be bound to multiple definition models */ evar_id_itr = oval_variable_model_get_variable_ids(varmodel); while (oval_string_iterator_has_more(evar_id_itr)) { char *evar_id; struct oval_variable *var; evar_id = oval_string_iterator_next(evar_id_itr); var = oval_definition_model_get_variable(defmodel, evar_id); if (!var) continue; oval_variable_bind_ext_var(var, varmodel, evar_id); } oval_string_iterator_free(evar_id_itr); return 0; }
void oval_result_test_add_binding(struct oval_result_test *test, struct oval_variable_binding *binding) { __attribute__nonnull__(test); oval_collection_add(test->bindings, binding); }
void oval_result_test_add_item(struct oval_result_test *test, struct oval_result_item *item) { __attribute__nonnull__(test); oval_collection_add(test->items, item); }
void oval_result_test_add_message(struct oval_result_test *test, struct oval_message *message) { __attribute__nonnull__(test); oval_collection_add(test->messages, message); }
void oval_sysent_add_record_field(struct oval_sysent *sysent, struct oval_record_field *rf) { if (sysent->record_fields == NULL) sysent->record_fields = oval_collection_new(); oval_collection_add(sysent->record_fields, rf); }
void oval_test_add_note(struct oval_test *test, char *note) { __attribute__nonnull__(test); oval_collection_add(test->notes, (void *)oscap_strdup(note)); }
void oval_test_add_state(struct oval_test *test, struct oval_state *state) { __attribute__nonnull__(test); oval_collection_add(test->states, state); }
void oval_state_content_add_record_field(struct oval_state_content *content, struct oval_record_field *rf) { oval_collection_add(content->record_fields, rf); }
void oval_affected_add_product(struct oval_affected *affected, char *product) { __attribute__nonnull__(affected); oval_collection_add(affected->products, (void *)oscap_strdup(product)); }
void oval_affected_add_platform(struct oval_affected *affected, char *platform) { __attribute__nonnull__(affected); oval_collection_add(affected->platforms, (void *)oscap_strdup(platform)); }
void oval_result_definition_add_message(struct oval_result_definition *definition, struct oval_message *message) { __attribute__nonnull__(definition); if (message) oval_collection_add(definition->messages, message); }