Open SCAP Library
Loading...
Searching...
No Matches
Topics | Macros | Functions
Common
Collaboration diagram for Common:

Topics

 VALID
 XML schema based validation of XML representations of SCAP documents.
 
 ERRORS
 Error checking mechanism.
 
 STRINGS
 Functions to access and manipulate textual data.
 

Macros

#define OSCAP_DEPRECATED(func)   func
 This macro will warn, when a deprecated function is used.
 

Functions

OSCAP_API void oscap_init (void)
 Initialize OpenSCAP library.
 
OSCAP_API void oscap_cleanup (void)
 Release library internal caches.
 
OSCAP_API const char * oscap_get_version (void)
 Get version of the OpenSCAP library.
 
OSCAP_API char * oscap_textlist_get_preferred_plaintext (struct oscap_text_iterator *texts, const char *preferred_lang)
 gets a plaintext string representing given textlist
 
OSCAP_API struct oscap_textoscap_textlist_get_preferred_text (struct oscap_text_iterator *texts, const char *preferred_lang)
 gets oscap_text representing given textlist
 

Detailed Description

Definitions and functions common to all the OpenScap sublibraries.

Function Documentation

◆ oscap_cleanup()

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

◆ oscap_init()

OSCAP_API void oscap_init ( void )

Initialize OpenSCAP library.

This is currently needed only in multithreaded applications (needs to be called before any child threads are spawned) or applications using the XSLT facility w/ EXSLT extensions. However, it is a good practice to call this function always at the beginning of the program execution.

◆ oscap_textlist_get_preferred_plaintext()

OSCAP_API char * oscap_textlist_get_preferred_plaintext ( struct oscap_text_iterator * texts,
const char * preferred_lang )

gets a plaintext string representing given textlist

Iterates through given texts and looks at each to see if the language matches given preferred_lang. If preferred_lang is NULL, OSCAP_DEFAULT_LANG is matched.

If a match is found it, a copy of plaintext representation of that text is returned. If nothing is found, plaintext representation of the first text in the list is returned. If the textlist is empty, NULL is returned.

◆ oscap_textlist_get_preferred_text()

OSCAP_API struct oscap_text * oscap_textlist_get_preferred_text ( struct oscap_text_iterator * texts,
const char * preferred_lang )

gets oscap_text representing given textlist

Similar to oscap_textlist_get_preferred_plaintext but returns oscap_text instead of just the plaintext.