/home/pvrabec/project/openscap/openscap-0.6.0/src/OVAL/probes/probe-cache.c File Reference

probe cache API implementation More...

#include <seap.h>
#include <string.h>
#include <assume.h>
#include <alloc.h>
#include "SEAP/generic/rbt/rbt.h"
#include "probe-cache.h"

Functions

pcache_tpcache_new (void)
 Create a new probe cache.
void pcache_free (pcache_t *cache)
 Free the probe cache.
int pcache_sexp_add (pcache_t *cache, const SEXP_t *id, SEXP_t *item)
 Add a new S-exp to the cache identified by an S-exp string.
int pcache_cstr_add (pcache_t *cache, const char *id, SEXP_t *item)
 Add a new S-exp to the cache identified by a C string.
int pcache_sexp_del (pcache_t *cache, const SEXP_t *id)
 Delete an S-exp from the cache identified by an S-exp string.
int pcache_cstr_del (pcache_t *cache, const char *id)
 Delete an S-exp from the cache identified by a C string.
SEXP_tpcache_sexp_get (pcache_t *cache, const SEXP_t *id)
 Get a reference to an cached S-exp identified by an S-exp string.
SEXP_tpcache_cstr_get (pcache_t *cache, const char *k)
 Get a reference to an cached S-exp identified by a C string.

Detailed Description

probe cache API implementation

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

Function Documentation

int pcache_cstr_add ( pcache_t cache,
const char *  id,
SEXP_t item 
)

Add a new S-exp to the cache identified by a C string.

Parameters:
cache probe cache
id C string containing the id
item the S-exp (item) to be stored in the cache
Return values:
0 on success
-1 on failure
int pcache_cstr_del ( pcache_t cache,
const char *  id 
)

Delete an S-exp from the cache identified by a C string.

Parameters:
cache probe cache
id C string containing the id
item the S-exp (item) to be stored in the cache
Return values:
0 on success
-1 on failure
SEXP_t* pcache_cstr_get ( pcache_t cache,
const char *  id 
)

Get a reference to an cached S-exp identified by a C string.

Parameters:
cache probe cache
id C string containing the id
item the S-exp (item) to be stored in the cache
Return values:
S-exp reference to the requested item
void pcache_free ( pcache_t cache  ) 

Free the probe cache.

This function frees the memory used to store the probe cache items and also the items themselves.

Parameters:
cache the cache to be freed
pcache_t* pcache_new ( void   ) 

Create a new probe cache.

Returns:
probe cache pointer or NULL on failure
int pcache_sexp_add ( pcache_t cache,
const SEXP_t id,
SEXP_t item 
)

Add a new S-exp to the cache identified by an S-exp string.

Parameters:
cache probe cache
id S-exp string object containing the id
item the S-exp (item) to be stored in the cache
Return values:
0 on success
-1 on failure
int pcache_sexp_del ( pcache_t cache,
const SEXP_t id 
)

Delete an S-exp from the cache identified by an S-exp string.

Parameters:
cache probe cache
id S-exp string object containing the id
item the S-exp (item) to be stored in the cache
Return values:
0 on success
-1 on failure
SEXP_t* pcache_sexp_get ( pcache_t cache,
const SEXP_t id 
)

Get a reference to an cached S-exp identified by an S-exp string.

Parameters:
cache probe cache
id S-exp string object containing the id
item the S-exp (item) to be stored in the cache
Return values:
S-exp reference to the requested item

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