General OpenScap functions and types. More...
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | xml_metadata |
Defines | |
#define | OSCAP_FOREACH_GENERIC(itype, vtype, val, init_val, code) |
Iterate over an array, given an iterator. | |
#define | OSCAP_FOREACH(type, val, init_val, code) OSCAP_FOREACH_GENERIC(type, struct type *, val, init_val, code) |
Iterate over an array, given an iterator. | |
#define | OSCAP_FOREACH_STR(val, init_val, code) OSCAP_FOREACH_GENERIC(oscap_string, const char *, val, init_val, code) |
Iterate over an array of strings, given an iterator. | |
Enumerations | |
enum | oscap_stream_type_t { OSCAP_STREAM_UNKNOWN = 0, OSCAP_STREAM_FILE = 1, OSCAP_STREAM_URL = 2 } |
Functions | |
struct xml_metadata * | xml_metadata_new (void) |
const char * | xml_metadata_get_namespace (const struct xml_metadata *xml) |
const char * | xml_metadata_get_lang (const struct xml_metadata *xml) |
const char * | xml_metadata_get_URI (const struct xml_metadata *xml) |
bool | xml_metadata_set_namespace (struct xml_metadata *xml, const char *new_namespace) |
bool | xml_metadata_set_lang (struct xml_metadata *xml, const char *new_lang) |
bool | xml_metadata_set_URI (struct xml_metadata *xml, const char *new_uri) |
void | xml_metadata_free (struct xml_metadata *xml) |
void | oscap_cleanup (void) |
Release library internal caches. | |
oscap_stream_type_t | oscap_import_source_get_type (const struct oscap_import_source *item) |
const char * | oscap_import_source_get_name (const struct oscap_import_source *item) |
oscap_stream_type_t | oscap_export_target_get_type (const struct oscap_export_target *item) |
struct oscap_import_source * | oscap_import_source_new_file (const char *filename, const char *encoding) |
TODO. | |
struct oscap_import_source * | oscap_import_source_new_URL (const char *url, const char *encoding) |
TODO. | |
void | oscap_import_source_free (struct oscap_import_source *target) |
TODO. | |
struct oscap_export_target * | oscap_export_target_new_file (const char *filename, const char *encoding) |
TODO. | |
struct oscap_export_target * | oscap_export_target_new_URL (const char *url, const char *encoding) |
TODO. | |
void | oscap_export_target_free (struct oscap_export_target *target) |
TODO. |
General OpenScap functions and types.
#define OSCAP_FOREACH | ( | type, | |||
val, | |||||
init_val, | |||||
code | ) | OSCAP_FOREACH_GENERIC(type, struct type *, val, init_val, code) |
Iterate over an array, given an iterator.
type | type of array elements (w/o the struct keyword) | |
val | name of an variable the member will be sequentially stored in | |
init_val | initial member value (i.e. an iterator pointing to the start element) | |
code | code to be executed for each element the iterator hits |
#define OSCAP_FOREACH_GENERIC | ( | itype, | |||
vtype, | |||||
val, | |||||
init_val, | |||||
code | ) |
{ \ struct itype##_iterator *val##_iter = (init_val); \ vtype val; \ while (itype##_iterator_has_more(val##_iter)) { \ val = itype##_iterator_next(val##_iter); \ code \ } \ itype##_iterator_free(val##_iter); \ }
Iterate over an array, given an iterator.
Execute code for each array member stored in val.
#define OSCAP_FOREACH_STR | ( | val, | |||
init_val, | |||||
code | ) | OSCAP_FOREACH_GENERIC(oscap_string, const char *, val, init_val, code) |
Iterate over an array of strings, given an iterator.
val | name of an variable the string will be sequentially stored in | |
init_val | initial member value (i.e. an iterator pointing to the start element) | |
code | code to be executed for each string the iterator hits |
void oscap_cleanup | ( | void | ) |
Release library internal caches.
This function should be called once you finish working with any of the libraries included in OpenScap framework. It frees internally allocated memory, e.g. cache of the XML parser.