Files | |
file | probe-entcmp.h |
Interface to comparison operations on entities in probes. | |
file | findfile.h |
Auxiliary find_files() function for use in different probes. | |
file | probe-api.h |
Interface to most of the operations that need to be done in a probe; processing input object, manipulating entities, creating output items. | |
file | sexp-manip.h |
S-expression manipulation functions. | |
Defines | |
#define | MTAB_PATH "/etc/mtab" |
#define | LOCAL_FILESYSTEMS {"ext2", "ext3", "reiserfs", "xfs", NULL} |
#define | probe_item_creat(name, attrs,...) probe_obj_creat (name, attrs, __VA_ARGS__) |
Create a new item consisting of a name, optional attributes argument and an arbitrary number of entities. | |
#define | PROBE_EINVAL 1 |
#define | PROBE_ENOELM 2 |
#define | PROBE_ENOVAL 3 |
#define | PROBE_ENOATTR 4 |
#define | PROBE_EINIT 5 |
#define | PROBE_ENOMEM 6 |
#define | PROBE_EOPNOTSUPP 7 |
#define | PROBE_ERANGE 8 |
#define | PROBE_EDOM 9 |
#define | PROBE_EFAULT 10 |
#define | PROBE_EACCES 11 |
#define | PROBE_ESETEVAL 12 |
#define | PROBE_EFATAL 254 |
#define | PROBE_EUNKNOWN 255 |
#define | OVAL_STATUS_ERROR 1 |
#define | OVAL_STATUS_EXISTS 2 |
#define | OVAL_STATUS_DOESNOTEXIST 3 |
#define | OVAL_STATUS_NOTCOLLECTED 4 |
#define | PROBECMD_STE_FETCH 1 |
#define | PROBECMD_OBJ_EVAL 2 |
#define | SEXP_number_newi SEXP_number_newi_32 |
Create a new sexp object from an integer. | |
#define | SEXP_number_geti SEXP_number_geti_32 |
Get integer value from a sexp object. | |
#define | SEXP_number_newu SEXP_number_newu_32 |
Create a new sexp object from an unsigned integer. | |
#define | SEXP_number_getu SEXP_number_getu_32 |
Get unsigned integer value from a sexp object. | |
#define | SEXP_IT_RECURSIVE 0x01 |
#define | SEXP_IT_HARDREF 0x02 |
#define | SEXP_free(ptr) __SEXP_free (ptr, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | SEXP_vfree(...) __SEXP_vfree (__FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__) |
#define | SEXP_VALIDATE(s) __SEXP_VALIDATE(s, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Typedefs | |
typedef struct SEXP_it | SEXP_it_t |
Functions | |
oval_result_t | probe_ent_result_bychk (SEXP_t *res_lst, oval_check_t check) |
Compute the overall result. | |
oval_result_t | probe_ent_result_byopr (SEXP_t *res_lst, oval_operator_t operator) |
Compute the overall result. | |
oval_result_t | probe_entobj_cmp (SEXP_t *ent_obj, SEXP_t *val) |
Compare object entity's content with a value. | |
oval_result_t | probe_entste_cmp (SEXP_t *ent_ste, SEXP_t *ent_itm) |
Compare state entity's content with a item entity's value. | |
oval_result_t | probe_ent_cmp_binary (SEXP_t *val1, SEXP_t *val2, oval_operation_t op) |
Compare two binary values. | |
oval_result_t | probe_ent_cmp_bool (SEXP_t *val1, SEXP_t *val2, oval_operation_t op) |
Compare two boolean values. | |
oval_result_t | probe_ent_cmp_evr (SEXP_t *val1, SEXP_t *val2, oval_operation_t op) |
Compare two epoch-version-release values. | |
oval_result_t | probe_ent_cmp_filesetrev (SEXP_t *val1, SEXP_t *val2, oval_operation_t op) |
Compare two values. | |
oval_result_t | probe_ent_cmp_float (SEXP_t *val1, SEXP_t *val2, oval_operation_t op) |
Compare two floating point values. | |
oval_result_t | probe_ent_cmp_int (SEXP_t *val1, SEXP_t *val2, oval_operation_t op) |
Compare two integer values. | |
oval_result_t | probe_ent_cmp_ios (SEXP_t *val1, SEXP_t *val2, oval_operation_t op) |
Compare two ios values. | |
oval_result_t | probe_ent_cmp_version (SEXP_t *val1, SEXP_t *val2, oval_operation_t op) |
Compare two version values. | |
oval_result_t | probe_ent_cmp_string (SEXP_t *val1, SEXP_t *val2, oval_operation_t op) |
Compare two string values. | |
int | find_files (SEXP_t *path, SEXP_t *filename, SEXP_t *behaviors, int(*cb)(const char *, const char *, void *arg), void *arg) |
Search the filesystem according to the specified path, filename and behaviors. | |
SEXP_t * | probe_item_build (const char *fmt,...) |
Build a new item according to the scpecified format. | |
SEXP_t * | probe_item_new (const char *name, SEXP_t *attrs) |
Create a new item with just a name and optional attributes argument. | |
SEXP_t * | probe_item_attr_add (SEXP_t *item, const char *name, SEXP_t *val) |
Add a new attribute to an item. | |
SEXP_t * | probe_item_ent_add (SEXP_t *item, const char *name, SEXP_t *attrs, SEXP_t *val) |
Add a new entity to an item. | |
int | probe_item_setstatus (SEXP_t *obj, oval_syschar_status_t status) |
Set item's status. | |
int | probe_itement_setstatus (SEXP_t *obj, const char *name, uint32_t n, oval_syschar_status_t status) |
Set status of an item's entity. | |
SEXP_t * | probe_item_newid (struct id_desc_t *id_desc) |
Get a new unique id (within a probe) for an item. | |
void | probe_item_resetid (struct id_desc_t *id_desc) |
Reset the item id generator. | |
SEXP_t * | probe_attr_creat (const char *name, const SEXP_t *val,...) |
Create a new list of attributes. | |
SEXP_t * | probe_obj_build (const char *fmt,...) |
Build a new object according to the scpecified format. | |
SEXP_t * | probe_obj_creat (const char *name, SEXP_t *attrs,...) |
Create a new object consisting of a name, optional attributes argument and an arbitrary number of entities. | |
SEXP_t * | probe_obj_new (const char *name, SEXP_t *attrs) |
Create a new object with just a name and optional attributes argument. | |
SEXP_t * | probe_obj_getent (const SEXP_t *obj, const char *name, uint32_t n) |
Get an entity from an object. | |
SEXP_t * | probe_obj_getentval (const SEXP_t *obj, const char *name, uint32_t n) |
Get the value of an object's entity. | |
int | probe_obj_getentvals (const SEXP_t *obj, const char *name, uint32_t n, SEXP_t **res) |
Get the list of values of an object's entity. | |
SEXP_t * | probe_obj_getattrval (const SEXP_t *obj, const char *name) |
Get the value of an object's attribute. | |
bool | probe_obj_attrexists (const SEXP_t *obj, const char *name) |
Check whether the specified attribute exists. | |
int | probe_obj_setstatus (SEXP_t *obj, oval_syschar_status_t status) |
Set objects's status. | |
int | probe_objent_setstatus (SEXP_t *obj, const char *name, uint32_t n, oval_syschar_status_t status) |
Set status of an object's entity. | |
char * | probe_obj_getname (const SEXP_t *obj) |
Get the name of an object. | |
size_t | probe_obj_getname_r (const SEXP_t *obj, char *buffer, size_t buflen) |
Get the name of an object. | |
SEXP_t * | probe_ent_creat (const char *name, SEXP_t *attrs, SEXP_t *val,...) |
Create a new list of entities. | |
SEXP_t * | probe_ent_creat1 (const char *name, SEXP_t *attrs, SEXP_t *val) |
Create a new entity. | |
SEXP_t * | probe_ent_attr_add (SEXP_t *ent, const char *name, SEXP_t *val) |
Add a new attribute to an entity. | |
SEXP_t * | probe_ent_getval (const SEXP_t *ent) |
Get the value of an entity. | |
int | probe_ent_getvals (const SEXP_t *ent, SEXP_t **res) |
Get the list of values of an entity. | |
SEXP_t * | probe_ent_getattrval (const SEXP_t *ent, const char *name) |
Get the value of an entity's attribute. | |
bool | probe_ent_attrexists (const SEXP_t *ent, const char *name) |
Check whether the specified attribute exists. | |
int | probe_ent_setdatatype (SEXP_t *ent, oval_datatype_t type) |
Set the OVAL data type of an entity. | |
oval_datatype_t | probe_ent_getdatatype (const SEXP_t *ent) |
Get the OVAL data type of an entity. | |
int | probe_ent_setmask (SEXP_t *ent, bool mask) |
Set entity's mask. | |
bool | probe_ent_getmask (const SEXP_t *ent) |
Get entity's mask. | |
int | probe_ent_setstatus (SEXP_t *ent, oval_syschar_status_t status) |
Set entity's status. | |
oval_syschar_status_t | probe_ent_getstatus (const SEXP_t *ent) |
Get entity status. | |
char * | probe_ent_getname (const SEXP_t *ent) |
Get the name of an entity. | |
size_t | probe_ent_getname_r (const SEXP_t *ent, char *buffer, size_t buflen) |
Get the name of an entity. | |
void | probe_free (SEXP_t *obj) |
Free the memory allocated by the probe_* functions. | |
void * | probe_init (void) __attribute__((unused)) |
void | probe_fini (void *) __attribute__((unused)) |
SEXP_t * | probe_main (SEXP_t *, int *, void *) __attribute__((nonnull(1 |
SEXP_t * | SEXP_number_new (SEXP_numtype_t t, const void *n) __attribute__((nonnull(2))) |
Create a new sexp object from a value and a number type. | |
SEXP_t * | SEXP_number_newb (bool n) |
Create a new sexp object from a boolean value. | |
SEXP_t * | SEXP_number_newi_8 (int8_t n) |
Create a new sexp object from an integer. | |
SEXP_t * | SEXP_number_newu_8 (uint8_t n) |
Create a new sexp object from an unsigned integer. | |
uint8_t | SEXP_number_getu_8 (const SEXP_t *s_exp) |
Get unsigned integer value from a sexp object. | |
SEXP_t * | SEXP_number_newi_16 (int16_t n) |
Create a new sexp object from an integer. | |
SEXP_t * | SEXP_number_newu_16 (uint16_t n) |
Create a new sexp object from an unsigned integer. | |
SEXP_t * | SEXP_number_newi_32 (int32_t n) |
Create a new sexp object from an integer. | |
int32_t | SEXP_number_geti_32 (const SEXP_t *s_exp) |
Get integer value from a sexp object. | |
bool | SEXP_number_getb (const SEXP_t *s_exp) |
Get boolean value from a sexp object. | |
SEXP_t * | SEXP_number_newu_32 (uint32_t n) |
Create a new sexp object from an unsigned integer. | |
uint32_t | SEXP_number_getu_32 (const SEXP_t *s_exp) |
Get unsigned integer value from a sexp object. | |
SEXP_t * | SEXP_number_newi_64 (int64_t n) |
Create a new sexp object from an integer. | |
int64_t | SEXP_number_geti_64 (const SEXP_t *s_exp) |
Get integer value from a sexp object. | |
SEXP_t * | SEXP_number_newu_64 (uint64_t n) |
Create a new sexp object from an unsigned integer. | |
uint64_t | SEXP_number_getu_64 (const SEXP_t *s_exp) |
Get unsigned integer value from a sexp object. | |
SEXP_t * | SEXP_number_newf (double n) |
Create a new sexp object from an floating point value. | |
double | SEXP_number_getf (const SEXP_t *s_exp) |
Get floating point value from a sexp object. | |
int | SEXP_number_get (const SEXP_t *s_exp, void *dst, SEXP_numtype_t type) |
Get a value from a sexp object according to a specified type. | |
uint16_t | SEXP_number_getu_16 (const SEXP_t *s_exp) |
Get unsigned integer value from a sexp object. | |
void | SEXP_number_free (SEXP_t *s_exp) |
Free the specified sexp object. | |
bool | SEXP_numberp (const SEXP_t *s_exp) |
Check whether the provided sexp object is a number. | |
SEXP_numtype_t | SEXP_number_type (const SEXP_t *sexp) |
Get the number type of an object. | |
SEXP_t * | SEXP_string_new (const void *string, size_t strlen) __attribute__((nonnull(1))) |
Create a new sexp object from a string. | |
SEXP_t * | SEXP_string_newf (const char *format,...) __attribute__((format(printf |
Create a new sexp object from a format string. | |
SEXP_t | nonnull (1))) |
void | SEXP_string_free (SEXP_t *s_exp) |
Free the specified sexp object. | |
bool | SEXP_stringp (const SEXP_t *s_exp) |
Check whether the provided sexp object is a string. | |
size_t | SEXP_string_length (const SEXP_t *s_exp) |
Get the length of a string in a sexp object. | |
int | SEXP_strcmp (const SEXP_t *s_exp, const char *str) __attribute__((nonnull(2))) |
Compare a string in a sexp object with a C string. | |
int | SEXP_strncmp (const SEXP_t *s_exp, const char *str, size_t n) __attribute__((nonnull(2))) |
Compare a string in a sexp object with a C string. | |
int | SEXP_string_nth (const SEXP_t *s_exp, size_t n) |
Get the n-th byte of a string. | |
char * | SEXP_string_cstr (const SEXP_t *s_exp) |
Get a C string from a sexp object. | |
size_t | SEXP_string_cstr_r (const SEXP_t *s_exp, char *buf, size_t len) __attribute__((nonnull(2))) |
Get a C string from a sexp object. | |
char * | SEXP_string_cstrp (const SEXP_t *s_exp) |
Obsolete function. | |
char * | SEXP_string_subcstr (const SEXP_t *s_exp, size_t beg, size_t len) |
Get a C substring from a sexp object. | |
int | SEXP_string_cmp (const SEXP_t *str_a, const SEXP_t *str_b) |
Compare two sexp strings. | |
SEXP_t * | SEXP_list_new (SEXP_t *memb,...) |
Create a new sexp list, optionally initialized with the provided sexp arguments. | |
void | SEXP_list_free (SEXP_t *s_exp) |
Free the specified sexp object. | |
bool | SEXP_listp (const SEXP_t *s_exp) |
Check whether the provided sexp object is a list. | |
size_t | SEXP_list_length (const SEXP_t *s_exp) |
Get the length of the sexp list. | |
SEXP_t * | SEXP_list_first (const SEXP_t *list) |
Get the first element of a list. | |
SEXP_t * | SEXP_list_rest (const SEXP_t *list) |
Get the rest of a list. | |
SEXP_t * | SEXP_list_last (const SEXP_t *list) |
Get the last element of a list. | |
SEXP_t * | SEXP_list_nth (const SEXP_t *list, uint32_t n) |
Get the n-th element of a list. | |
SEXP_t * | SEXP_list_add (SEXP_t *list, const SEXP_t *s_exp) |
Add an element to a list. | |
SEXP_t * | SEXP_list_join (const SEXP_t *list_a, const SEXP_t *list_b) |
Create a new list containing the concatenated contents of two lists. | |
SEXP_t * | SEXP_list_push (SEXP_t *list, const SEXP_t *s_exp) |
Push an element to the head of a list. | |
SEXP_t * | SEXP_list_pop (SEXP_t *list) |
Extract the first element of a list. | |
SEXP_t * | SEXP_list_replace (SEXP_t *list, uint32_t n, const SEXP_t *s_exp) |
Replace the n-th element of a list. | |
SEXP_t * | SEXP_listref_first (SEXP_t *list) |
Get the first element of a list. | |
SEXP_t * | SEXP_listref_rest (SEXP_t *list) |
Get the rest of a list. | |
SEXP_t * | SEXP_listref_last (SEXP_t *list) |
Get the last element of a list. | |
SEXP_t * | SEXP_listref_nth (SEXP_t *list, uint32_t n) |
Get the n-th element of a list. | |
SEXP_it_t * | SEXP_listit_new (const SEXP_t *list, int flags) |
SEXP_t * | SEXP_listit_next (SEXP_it_t *it) |
SEXP_t * | SEXP_listit_prev (SEXP_it_t *it) |
SEXP_t * | SEXP_listit_length (SEXP_it_t *it) |
SEXP_t * | SEXP_listit_seek (SEXP_it_t *it, uint32_t n) |
void | SEXP_listit_free (SEXP_it_t *it) |
SEXP_t * | SEXP_new (void) |
SEXP_t * | SEXP_ref (const SEXP_t *s_exp) |
Create a new reference to a sexp object. | |
SEXP_t * | SEXP_softref (SEXP_t *s_exp) |
Create a new soft reference to a sexp object. | |
void | __SEXP_free (SEXP_t *s_exp, const char *file, uint32_t line, const char *func) |
void | __SEXP_vfree (const char *file, uint32_t line, const char *func, SEXP_t *s_exp,...) |
const char * | SEXP_datatype (const SEXP_t *s_exp) |
Get the user data type of a sexp object. | |
int | SEXP_datatype_set (SEXP_t *s_exp, const char *name) __attribute__((nonnull(2))) |
Set the user data type of a sexp object. | |
int | SEXP_datatype_set_nth (SEXP_t *list, uint32_t n, const char *name) __attribute__((nonnull(3))) |
Set the user data type of the nth sexp object in a list. | |
SEXP_type_t | SEXP_typeof (const SEXP_t *s_exp) |
Get the type of a sexp object. | |
const char * | SEXP_strtype (const SEXP_t *s_exp) |
Get a text description of the sexp object's type. | |
SEXP_t * | SEXP_build (const char *s_str,...) |
size_t | SEXP_sizeof (const SEXP_t *s_exp) |
void | __SEXP_VALIDATE (const SEXP_t *s_exp, const char *file, uint32_t line, const char *func) |
#define probe_item_creat | ( | name, | |||
attrs, | |||||
... | ) | probe_obj_creat (name, attrs, __VA_ARGS__) |
Create a new item consisting of a name, optional attributes argument and an arbitrary number of entities.
Every entity is a triple: const char *name - name of the new entity SEXP_t attrs - optional list of entity attributes in a sexp, can be NULL SEXP_t val - value of the new entity in a sexp This function increments its SEXP_t arguments' reference count.
name | mandatory name argument | |
attrs | optional item's attributes argument | |
... | arbitrary number of entity arguments |
#define SEXP_number_geti SEXP_number_geti_32 |
Get integer value from a sexp object.
The size of the integer may be architecture dependent.
#define SEXP_number_getu SEXP_number_getu_32 |
Get unsigned integer value from a sexp object.
The size of the integer may be architecture dependent.
#define SEXP_number_newi SEXP_number_newi_32 |
Create a new sexp object from an integer.
The size of the integer may be architecture dependent.
#define SEXP_number_newu SEXP_number_newu_32 |
Create a new sexp object from an unsigned integer.
The size of the integer may be architecture dependent.
int find_files | ( | SEXP_t * | path, | |
SEXP_t * | filename, | |||
SEXP_t * | behaviors, | |||
int(*)(const char *, const char *, void *arg) | cb, | |||
void * | arg | |||
) |
Search the filesystem according to the specified path, filename and behaviors.
For all files that satisfy these requirements call the provided callback function.
path | the requested path in a sexp form, which may specify the matching operation or a var_ref | |
filenam | the requested filename in a sexp form, which may specify the matching operation or a var_ref | |
behaviors | the behaviors may specify the recursion depth or direction | |
cb | for each match, the callback function cb is called with first argument being the matched path and the second being the matched filename | |
arg | an optional argument to the callback function |
Create a new list of attributes.
This function increments its val argument's reference count.
name | the name of the attribute | |
val | the value of the attribute | |
... | there can be an arbitrary number of name - value pairs |
Add a new attribute to an entity.
This function increments its val argument's reference count.
ent | the entity to be modified | |
name | name of the new attribute | |
val | value of the new attribute |
bool probe_ent_attrexists | ( | const SEXP_t * | ent, | |
const char * | name | |||
) |
Check whether the specified attribute exists.
ent | the queried entity | |
name | the name of the attribute |
oval_result_t probe_ent_cmp_binary | ( | SEXP_t * | val1, | |
SEXP_t * | val2, | |||
oval_operation_t | op | |||
) |
Compare two binary values.
The operation to use is specified by the operation enumeration value.
val1 | the first value | |
val2 | the second value | |
op | the desired operation |
oval_result_t probe_ent_cmp_bool | ( | SEXP_t * | val1, | |
SEXP_t * | val2, | |||
oval_operation_t | op | |||
) |
Compare two boolean values.
The operation to use is specified by the operation enumeration value.
val1 | the first value | |
val2 | the second value | |
op | the desired operation |
oval_result_t probe_ent_cmp_evr | ( | SEXP_t * | val1, | |
SEXP_t * | val2, | |||
oval_operation_t | op | |||
) |
Compare two epoch-version-release values.
The operation to use is specified by the operation enumeration value.
val1 | the first value | |
val2 | the second value | |
op | the desired operation |
oval_result_t probe_ent_cmp_filesetrev | ( | SEXP_t * | val1, | |
SEXP_t * | val2, | |||
oval_operation_t | op | |||
) |
Compare two values.
The operation to use is specified by the operation enumeration value.
val1 | the first value | |
val2 | the second value | |
op | the desired operation |
oval_result_t probe_ent_cmp_float | ( | SEXP_t * | val1, | |
SEXP_t * | val2, | |||
oval_operation_t | op | |||
) |
Compare two floating point values.
The operation to use is specified by the operation enumeration value.
val1 | the first value | |
val2 | the second value | |
op | the desired operation |
oval_result_t probe_ent_cmp_int | ( | SEXP_t * | val1, | |
SEXP_t * | val2, | |||
oval_operation_t | op | |||
) |
Compare two integer values.
The operation to use is specified by the operation enumeration value.
val1 | the first value | |
val2 | the second value | |
op | the desired operation |
oval_result_t probe_ent_cmp_ios | ( | SEXP_t * | val1, | |
SEXP_t * | val2, | |||
oval_operation_t | op | |||
) |
Compare two ios values.
The operation to use is specified by the operation enumeration value.
val1 | the first value | |
val2 | the second value | |
op | the desired operation |
oval_result_t probe_ent_cmp_string | ( | SEXP_t * | val1, | |
SEXP_t * | val2, | |||
oval_operation_t | op | |||
) |
Compare two string values.
The operation to use is specified by the operation enumeration value.
val1 | the first value | |
val2 | the second value | |
op | the desired operation |
oval_result_t probe_ent_cmp_version | ( | SEXP_t * | val1, | |
SEXP_t * | val2, | |||
oval_operation_t | op | |||
) |
Compare two version values.
The operation to use is specified by the operation enumeration value.
val1 | the first value | |
val2 | the second value | |
op | the desired operation |
Create a new list of entities.
This function increments its SEXP_t arguments' reference count.
name | the name of the entity | |
attrs | optional entity's attributes argument | |
val | the value of the entity | |
... | there can be an arbitrary number of name - attributes - value triples |
Create a new entity.
This function increments its SEXP_t arguments' reference count.
name | the name of the entity | |
attrs | optional entity's attributes argument | |
val | the value of the entity |
Get the value of an entity's attribute.
ent | the queried entity | |
name | the name of the attribute |
oval_datatype_t probe_ent_getdatatype | ( | const SEXP_t * | ent | ) |
Get the OVAL data type of an entity.
ent | the queried entity |
bool probe_ent_getmask | ( | const SEXP_t * | ent | ) |
Get entity's mask.
ent | the queried entity |
char* probe_ent_getname | ( | const SEXP_t * | ent | ) |
Get the name of an entity.
ent | the queried entity |
size_t probe_ent_getname_r | ( | const SEXP_t * | ent, | |
char * | buffer, | |||
size_t | buflen | |||
) |
Get the name of an entity.
The name is stored in the provided buffer.
ent | the queried entity | |
buffer | the buffer to store the name in | |
buflen | the length of the buffer |
oval_syschar_status_t probe_ent_getstatus | ( | const SEXP_t * | ent | ) |
Get entity status.
ent | the queried entity |
Get the value of an entity.
The function respects the var_ref attribute and returns the currently selected value.
ent | the queried entity |
Get the list of values of an entity.
If the entity uses var_ref, there can be more than one value.
ent | the queried entity | |
res | the resulting value list is stored in this argument |
oval_result_t probe_ent_result_bychk | ( | SEXP_t * | res_lst, | |
oval_check_t | check | |||
) |
Compute the overall result.
Compute the overall result from a results vector and a check enumeration parameter.
res_lst | the results vector | |
check | the check enumeration value |
oval_result_t probe_ent_result_byopr | ( | SEXP_t * | res_lst, | |
oval_operator_t | operator | |||
) |
Compute the overall result.
Compute the overall result from a results vector and a operator enumeration parameter.
res_lst | the results vector | |
check | the operator enumeration value |
int probe_ent_setdatatype | ( | SEXP_t * | ent, | |
oval_datatype_t | type | |||
) |
Set the OVAL data type of an entity.
ent | the queried entity | |
type | the new data type |
int probe_ent_setmask | ( | SEXP_t * | ent, | |
bool | mask | |||
) |
Set entity's mask.
ent | the queried entity the new mask |
int probe_ent_setstatus | ( | SEXP_t * | ent, | |
oval_syschar_status_t | status | |||
) |
Set entity's status.
ent | the entity to be modified | |
status | the new status |
Compare object entity's content with a value.
The result depends on the operation attribute and a possible var_check attribute.
ent_obj | object entity | |
val | raw value |
Compare state entity's content with a item entity's value.
The result depends on the operation attribute, a possible var_check attribute and item entity's status.
ent_ste | state entity | |
ent_itm | item entity |
void probe_free | ( | SEXP_t * | obj | ) |
Free the memory allocated by the probe_* functions.
obj | the object to be freed |
Add a new attribute to an item.
This function increments its val argument's reference count.
item | the item to be modified | |
name | name of the new attribute | |
val | value of the new attribute |
SEXP_t* probe_item_build | ( | const char * | fmt, | |
... | ||||
) |
Build a new item according to the scpecified format.
fmt | the desired format |
Add a new entity to an item.
This function increments its attrs and val arguments' reference count.
item | the item to be modified | |
name | name of the new entity | |
attrs | optional attributes of the new entity | |
val | value of the new entity |
Create a new item with just a name and optional attributes argument.
name | item's name | |
attrs | optional attributes argument |
Get a new unique id (within a probe) for an item.
id_desc | pointer to a structure holding the global id context |
void probe_item_resetid | ( | struct id_desc_t * | id_desc | ) |
Reset the item id generator.
id_desc | pointer to a structure holding the global id context |
int probe_item_setstatus | ( | SEXP_t * | obj, | |
oval_syschar_status_t | status | |||
) |
Set item's status.
obj | the item to be modified | |
status | the new status |
int probe_itement_setstatus | ( | SEXP_t * | obj, | |
const char * | name, | |||
uint32_t | n, | |||
oval_syschar_status_t | status | |||
) |
Set status of an item's entity.
obj | the item to be modified | |
name | the name of the entity | |
n | select the n-th occurence of an entity with the specified name | |
status | the new status |
bool probe_obj_attrexists | ( | const SEXP_t * | obj, | |
const char * | name | |||
) |
Check whether the specified attribute exists.
obj | the queried object | |
name | the name of the attribute |
SEXP_t* probe_obj_build | ( | const char * | fmt, | |
... | ||||
) |
Build a new object according to the scpecified format.
fmt | the desired format |
Create a new object consisting of a name, optional attributes argument and an arbitrary number of entities.
Every entity is a triple: const char *name - name of the new entity SEXP_t attrs - optional list of entity attributes in a sexp, can be NULL SEXP_t val - value of the new entity in a sexp This function increments its SEXP_t arguments' reference count.
name | mandatory name argument | |
attrs | optional object's attributes argument | |
... | arbitrary number of entity arguments |
Get the value of an object's attribute.
obj | the queried object | |
name | the name of the attribute |
Get an entity from an object.
obj | the queried object | |
name | the name of the entity | |
n | select the n-th occurence of an entity with the specified name |
Get the value of an object's entity.
The function respects the var_ref attribute and returns the currently selected value.
obj | the queried object | |
name | the name of the entity | |
n | select the n-th occurence of an entity with the specified name |
Get the list of values of an object's entity.
If the entity uses var_ref, there can be more than one value.
obj | the queried object | |
name | the name of the entity | |
n | select the n-th occurence of an entity with the specified name | |
res | the resulting value list is stored in this argument |
char* probe_obj_getname | ( | const SEXP_t * | obj | ) |
Get the name of an object.
obj | the queried object |
size_t probe_obj_getname_r | ( | const SEXP_t * | obj, | |
char * | buffer, | |||
size_t | buflen | |||
) |
Get the name of an object.
The name is stored in the provided buffer.
obj | the queried object | |
buffer | the buffer to store the name in | |
buflen | the length of the buffer |
Create a new object with just a name and optional attributes argument.
This function increments its SEXP_t argument's reference count.
name | object's name | |
attrs | optional attributes argument |
int probe_obj_setstatus | ( | SEXP_t * | obj, | |
oval_syschar_status_t | status | |||
) |
Set objects's status.
obj | the object to be modified | |
status | the new status |
int probe_objent_setstatus | ( | SEXP_t * | obj, | |
const char * | name, | |||
uint32_t | n, | |||
oval_syschar_status_t | status | |||
) |
Set status of an object's entity.
obj | the object to be modified | |
name | the name of the entity | |
n | select the n-th occurence of an entity with the specified name | |
status | the new status |
const char* SEXP_datatype | ( | const SEXP_t * | s_exp | ) |
Get the user data type of a sexp object.
s_exp | the object to be queried |
int SEXP_datatype_set | ( | SEXP_t * | s_exp, | |
const char * | name | |||
) |
Set the user data type of a sexp object.
s_exp | the object to be modified |
int SEXP_datatype_set_nth | ( | SEXP_t * | list, | |
uint32_t | n, | |||
const char * | name | |||
) |
Set the user data type of the nth sexp object in a list.
list | list containing the object to be modified | |
n | the position of the object | |
name | name of the user data type |
Add an element to a list.
This function increments element's reference count.
list | the modified sexp object | |
s_exp | the element to be added |
Get the first element of a list.
This function increments element's reference count
list | the queried sexp object |
void SEXP_list_free | ( | SEXP_t * | s_exp | ) |
Free the specified sexp object.
s_exp | the object to be freed |
Create a new list containing the concatenated contents of two lists.
This function increments element's reference count.
list_a | the first list to be contatenated | |
list_b | the list to be attached to the first one |
Get the last element of a list.
This function increments element's reference count.
list | the queried sexp object |
size_t SEXP_list_length | ( | const SEXP_t * | s_exp | ) |
Get the length of the sexp list.
s_sexp | the queried sexp object |
Create a new sexp list, optionally initialized with the provided sexp arguments.
The argument list needs to be terminated with NULL.
memb | the first sexp object to be inserted into the new list. can be NULL. | |
... | arbitrary number of elements to be inserted |
Get the n-th element of a list.
This function increments element's reference count.
list | the queried sexp object | |
n | the position of the element in the list |
Extract the first element of a list.
This function increments element's reference count.
list | the modified sexp object |
Push an element to the head of a list.
This function increments element's reference count.
list | the modified sexp object | |
s_exp | the element to be added |
Replace the n-th element of a list.
This function increments element's reference count.
list | the modified sexp object | |
n | the index of the element to be replaced | |
s_exp | the element to be added |
Get the rest of a list.
This function increments elements' reference count.
list | the queried sexp object |
bool SEXP_listp | ( | const SEXP_t * | s_exp | ) |
Check whether the provided sexp object is a list.
s_exp | the sexp object to be tested |
Get the first element of a list.
This function creates a soft reference to the element.
list | the queried sexp object |
Get the last element of a list.
This function creates a soft reference to the element.
list | the queried sexp object |
Get the n-th element of a list.
This function creates a soft reference to the element.
list | the queried sexp object | |
n | the position of the element in the list |
Get the rest of a list.
This function creates a soft reference to the list.
list | the queried sexp object |
void SEXP_number_free | ( | SEXP_t * | s_exp | ) |
Free the specified sexp object.
s_exp | the object to be freed |
int SEXP_number_get | ( | const SEXP_t * | s_exp, | |
void * | dst, | |||
SEXP_numtype_t | type | |||
) |
Get a value from a sexp object according to a specified type.
s_exp | the queried sexp object | |
dst | buffer for the value | |
type | the desired number type |
bool SEXP_number_getb | ( | const SEXP_t * | s_exp | ) |
Get boolean value from a sexp object.
s_exp | the queried sexp object |
double SEXP_number_getf | ( | const SEXP_t * | s_exp | ) |
Get floating point value from a sexp object.
s_exp | the queried sexp object |
int32_t SEXP_number_geti_32 | ( | const SEXP_t * | s_exp | ) |
Get integer value from a sexp object.
s_exp | the queried sexp object |
int64_t SEXP_number_geti_64 | ( | const SEXP_t * | s_exp | ) |
Get integer value from a sexp object.
s_exp | the queried sexp object |
uint16_t SEXP_number_getu_16 | ( | const SEXP_t * | s_exp | ) |
Get unsigned integer value from a sexp object.
s_exp | the queried sexp object |
uint32_t SEXP_number_getu_32 | ( | const SEXP_t * | s_exp | ) |
Get unsigned integer value from a sexp object.
s_exp | the queried sexp object |
uint64_t SEXP_number_getu_64 | ( | const SEXP_t * | s_exp | ) |
Get unsigned integer value from a sexp object.
s_exp | the queried sexp object |
uint8_t SEXP_number_getu_8 | ( | const SEXP_t * | s_exp | ) |
Get unsigned integer value from a sexp object.
s_exp | the queried sexp object |
SEXP_t* SEXP_number_new | ( | SEXP_numtype_t | t, | |
const void * | n | |||
) |
Create a new sexp object from a value and a number type.
t | the desired number type | |
n | pointer to the number value |
SEXP_t* SEXP_number_newb | ( | bool | n | ) |
Create a new sexp object from a boolean value.
n | the boolean value to store |
SEXP_t* SEXP_number_newf | ( | double | n | ) |
Create a new sexp object from an floating point value.
n | the floating point value to store |
SEXP_t* SEXP_number_newi_16 | ( | int16_t | n | ) |
Create a new sexp object from an integer.
n | the integer value to store |
SEXP_t* SEXP_number_newi_32 | ( | int32_t | n | ) |
Create a new sexp object from an integer.
n | the integer value to store |
SEXP_t* SEXP_number_newi_64 | ( | int64_t | n | ) |
Create a new sexp object from an integer.
n | the integer value to store |
SEXP_t* SEXP_number_newi_8 | ( | int8_t | n | ) |
Create a new sexp object from an integer.
n | the integer value to store |
SEXP_t* SEXP_number_newu_16 | ( | uint16_t | n | ) |
Create a new sexp object from an unsigned integer.
n | the unsigned integer value to store |
SEXP_t* SEXP_number_newu_32 | ( | uint32_t | n | ) |
Create a new sexp object from an unsigned integer.
n | the integer value to store |
SEXP_t* SEXP_number_newu_64 | ( | uint64_t | n | ) |
Create a new sexp object from an unsigned integer.
n | the integer value to store |
SEXP_t* SEXP_number_newu_8 | ( | uint8_t | n | ) |
Create a new sexp object from an unsigned integer.
n | the unsigned integer value to store |
SEXP_numtype_t SEXP_number_type | ( | const SEXP_t * | sexp | ) |
Get the number type of an object.
sexp | the queried sexp object |
bool SEXP_numberp | ( | const SEXP_t * | s_exp | ) |
Check whether the provided sexp object is a number.
s_exp | the sexp object to be tested |
Create a new reference to a sexp object.
s_exp | the object of which to increment the reference count |
Create a new soft reference to a sexp object.
s_exp | the object to which create the soft reference |
int SEXP_strcmp | ( | const SEXP_t * | s_exp, | |
const char * | str | |||
) |
Compare a string in a sexp object with a C string.
s_exp | the sexp object to be compared | |
str | the C string to be compared |
Compare two sexp strings.
str_a | the first string to compare | |
str_b | the second string to compare |
size_t SEXP_string_cstr_r | ( | const SEXP_t * | s_exp, | |
char * | buf, | |||
size_t | len | |||
) |
Get a C string from a sexp object.
The name is stored in the provided buffer.
s_exp | the queried object | |
buf | the buffer to store the name in | |
len | the length of the buffer |
void SEXP_string_free | ( | SEXP_t * | s_exp | ) |
Free the specified sexp object.
s_exp | the object to be freed |
size_t SEXP_string_length | ( | const SEXP_t * | s_exp | ) |
Get the length of a string in a sexp object.
s_exp | the queried sexp object |
SEXP_t* SEXP_string_new | ( | const void * | string, | |
size_t | strlen | |||
) |
Create a new sexp object from a string.
string | the string to be stored | |
strlen | the length of the string in bytes |
SEXP_t* SEXP_string_newf | ( | const char * | format, | |
... | ||||
) |
Create a new sexp object from a format string.
format | the format of the new string | |
... | arguments for the format |
int SEXP_string_nth | ( | const SEXP_t * | s_exp, | |
size_t | n | |||
) |
Get the n-th byte of a string.
s_exp | the sexp object holding the string | |
n | the index of the desired character |
char* SEXP_string_subcstr | ( | const SEXP_t * | s_exp, | |
size_t | beg, | |||
size_t | len | |||
) |
Get a C substring from a sexp object.
s_sexp | the queried sexp object | |
beg | the position of the fisrt character of the substring | |
len | the length of the substring |
bool SEXP_stringp | ( | const SEXP_t * | s_exp | ) |
Check whether the provided sexp object is a string.
s_exp | the sexp object to be tested |
int SEXP_strncmp | ( | const SEXP_t * | s_exp, | |
const char * | str, | |||
size_t | n | |||
) |
Compare a string in a sexp object with a C string.
s_exp | the sexp object to be compared | |
str | the C string to be compared | |
n | compare at most n bytes |
const char* SEXP_strtype | ( | const SEXP_t * | s_exp | ) |
Get a text description of the sexp object's type.
s_exp | the object to be queried |
SEXP_type_t SEXP_typeof | ( | const SEXP_t * | s_exp | ) |
Get the type of a sexp object.
s_exp | the object to be queried |