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

General OpenScap functions and types. More...

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.

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 *it_ = (init_val); \
                vtype val; \
                while (itype##_iterator_has_more(it_)) { \
                        val = itype##_iterator_next(it_); \
                        code \
                } \
                itype##_iterator_free(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 29 Sep 2009 for Open SCAP Library by  doxygen 1.6.1