/home/pvrabec/openscap/openscap-0.5.5/src/common/public/oscap.h File Reference

General OpenScap functions and types. More...

#include <stdbool.h>

Go to the source code of this file.

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.

Functions

void oscap_cleanup (void)
 Release library internal caches.
const char * oscap_import_source_get_filename (const struct oscap_import_source *item)
struct oscap_import_sourceoscap_import_source_new (const char *filename, const char *encoding)
 TODO.
void oscap_import_source_free (struct oscap_import_source *target)
 TODO.
struct oscap_export_targetoscap_export_target_new (const char *filename, const char *encoding)
 TODO.
void oscap_export_target_free (struct oscap_export_target *target)
 TODO.

Detailed Description

General OpenScap functions and types.

Author:
Lukas Kuklinek <lkuklinek@redhat.com>

Define Documentation

#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.

Parameters:
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
See also:
OSCAP_FOREACH_GENERIC
#define OSCAP_FOREACH_GENERIC ( itype,
vtype,
val,
init_val,
code   ) 
Value:
{                                                            \
        struct itype##_iterator *val##_it_ = (init_val);         \
        vtype val;                                               \
        while (itype##_iterator_has_more(val##_it_)) {           \
            val = itype##_iterator_next(val##_it_);              \
            code                                                 \
        }                                                        \
        itype##_iterator_free(val##_it_);                        \
    }

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.

Parameters:
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
See also:
OSCAP_FOREACH_GENERIC

Function Documentation

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.


Generated on 12 Nov 2009 for Open SCAP Library by  doxygen 1.6.1