/home/pvrabec/project/openscap/openscap-0.6.0/src/OVAL/probes/encache.h File Reference

element name cache API header file More...

#include <pthread.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  encache_t
 Element name cache structure. More...

Defines

#define ENCACHE_INIT_SIZE   24
#define ENCACHE_ADD_SIZE   8

Functions

encache_tencache_new (void)
 Create new element name cache.
void encache_free (encache_t *cache)
 Free memory used by the element name cache.
SEXP_tencache_add (encache_t *cache, const char *name)
 Add a name to the cache.
SEXP_tencache_get (encache_t *cache, const char *name)
 Get a reference to an already cached S-exp object.
SEXP_tencache_ref (encache_t *cache, const char *name)
 Get a reference to a cached S-exp object.

Detailed Description

element name cache API header file

Author:
"Daniel Kopecek" <dkopecek@redhat.com>

Function Documentation

SEXP_t* encache_add ( encache_t cache,
const char *  name 
)

Add a name to the cache.

This will create a new S-exp object and return a reference to it. Reference count of such object will be 2 because the cache hold it's own reference to the object.

Parameters:
cache element name cache
name name string
Returns:
S-exp reference to the name string
void encache_free ( encache_t cache  ) 

Free memory used by the element name cache.

The S-exp objects stored in the cache are also freed. However, if they are referenced somewhere else, the memory won't be freed, just the reference count will be decremented.

Parameters:
cache the cache to be freed
SEXP_t* encache_get ( encache_t cache,
const char *  name 
)

Get a reference to an already cached S-exp object.

If the object is not found in the cache, it won't be created and NULL will be returned to the caller.

Parameters:
cache element name cache
name name string
Returns:
S-exp reference to the name string or NULL if not found
encache_t* encache_new ( void   ) 

Create new element name cache.

Returns:
an empty element name cache
SEXP_t* encache_ref ( encache_t cache,
const char *  name 
)

Get a reference to a cached S-exp object.

If the object is not found in the cache, it will be created and the reference this newly created object will be returned to the caller.

Parameters:
cache element name cache
name name string
Returns:
S-exp reference to the name string

Generated on 14 Jul 2010 for Open SCAP Library by  doxygen 1.6.1