alloc.h | alloc.h | |||
---|---|---|---|---|
skipping to change at line 44 | skipping to change at line 44 | |||
* Lukas Kuklinek <lkuklinek@redhat.com> | * Lukas Kuklinek <lkuklinek@redhat.com> | |||
*/ | */ | |||
#pragma once | #pragma once | |||
#ifndef OSCAP_ALLOC_H | #ifndef OSCAP_ALLOC_H | |||
#define OSCAP_ALLOC_H | #define OSCAP_ALLOC_H | |||
#include <stdlib.h> | #include <stdlib.h> | |||
/// @cond | /// @cond | |||
#undef __P | #define __ATTRIB __attribute__ ((unused)) static | |||
#define __P __attribute__ ((unused)) static | ||||
/// @endcond | /// @endcond | |||
#if defined(NDEBUG) | #if defined(NDEBUG) | |||
/// @cond | /// @cond | |||
void *__oscap_alloc(size_t s); | void *__oscap_alloc(size_t s); | |||
__P void *oscap_alloc(size_t s) | __ATTRIB void *oscap_alloc(size_t s) | |||
{ | { | |||
return __oscap_alloc(s); | return __oscap_alloc(s); | |||
} | } | |||
void *__oscap_calloc(size_t n, size_t s); | void *__oscap_calloc(size_t n, size_t s); | |||
__P void *oscap_calloc(size_t n, size_t s) | __ATTRIB void *oscap_calloc(size_t n, size_t s) | |||
{ | { | |||
return __oscap_calloc(n, s); | return __oscap_calloc(n, s); | |||
} | } | |||
void *__oscap_realloc(void *p, size_t s); | void *__oscap_realloc(void *p, size_t s); | |||
__P void *oscap_realloc(void *p, size_t s) | __ATTRIB void *oscap_realloc(void *p, size_t s) | |||
{ | { | |||
return __oscap_realloc(p, s); | return __oscap_realloc(p, s); | |||
} | } | |||
void *__oscap_reallocf(void *p, size_t s); | void *__oscap_reallocf(void *p, size_t s); | |||
__P void *oscap_reallocf(void *p, size_t s) | __ATTRIB void *oscap_reallocf(void *p, size_t s) | |||
{ | { | |||
return __oscap_reallocf(p, s); | return __oscap_reallocf(p, s); | |||
} | } | |||
void __oscap_free(void *p); | void __oscap_free(void *p); | |||
__P void oscap_free(void *p) | __ATTRIB void oscap_free(void *p) | |||
{ | { | |||
__oscap_free(p); | __oscap_free(p); | |||
} | } | |||
/// @endcond | /// @endcond | |||
/** | /** | |||
* void *malloc(size_t size) wrapper | * void *malloc(size_t size) wrapper | |||
*/ | */ | |||
# define oscap_alloc(s) __oscap_alloc (s) | # define oscap_alloc(s) __oscap_alloc (s) | |||
/** | /** | |||
skipping to change at line 104 | skipping to change at line 103 | |||
* void *realloc(void *ptr, size_t size) wrapper freeing old memory on fail ure | * void *realloc(void *ptr, size_t size) wrapper freeing old memory on fail ure | |||
*/ | */ | |||
# define oscap_reallocf(p, s) __oscap_reallocf((void *)(p), s) | # define oscap_reallocf(p, s) __oscap_reallocf((void *)(p), s) | |||
/** | /** | |||
* void free(void *ptr) wrapper | * void free(void *ptr) wrapper | |||
*/ | */ | |||
# define oscap_free(p) __oscap_free ((void *)(p)) | # define oscap_free(p) __oscap_free ((void *)(p)) | |||
#else | #else | |||
void *__oscap_alloc_dbg(size_t s, const char *f, size_t l); | void *__oscap_alloc_dbg(size_t s, const char *f, size_t l); | |||
__P void *oscap_alloc(size_t s) | __ATTRIB void *oscap_alloc(size_t s) | |||
{ | { | |||
return __oscap_alloc_dbg(s, __FUNCTION__, 0); | return __oscap_alloc_dbg(s, __FUNCTION__, 0); | |||
} | } | |||
void *__oscap_calloc_dbg(size_t n, size_t s, const char *f, size_t l); | void *__oscap_calloc_dbg(size_t n, size_t s, const char *f, size_t l); | |||
__P void *oscap_calloc(size_t n, size_t s) | __ATTRIB void *oscap_calloc(size_t n, size_t s) | |||
{ | { | |||
return __oscap_calloc_dbg(n, s, __FUNCTION__, 0); | return __oscap_calloc_dbg(n, s, __FUNCTION__, 0); | |||
} | } | |||
void *__oscap_realloc_dbg(void *p, size_t s, const char *f, size_t l); | void *__oscap_realloc_dbg(void *p, size_t s, const char *f, size_t l); | |||
__P void *oscap_realloc(void *p, size_t s) | __ATTRIB void *oscap_realloc(void *p, size_t s) | |||
{ | { | |||
return __oscap_realloc_dbg(p, s, __FUNCTION__, 0); | return __oscap_realloc_dbg(p, s, __FUNCTION__, 0); | |||
} | } | |||
void *__oscap_reallocf_dbg(void *p, size_t s, const char *f, size_t l); | void *__oscap_reallocf_dbg(void *p, size_t s, const char *f, size_t l); | |||
__P void *oscap_reallocf(void *p, size_t s) | __ATTRIB void *oscap_reallocf(void *p, size_t s) | |||
{ | { | |||
return __oscap_reallocf_dbg(p, s, __FUNCTION__, 0); | return __oscap_reallocf_dbg(p, s, __FUNCTION__, 0); | |||
} | } | |||
void __oscap_free_dbg(void **p, const char *f, size_t l); | void __oscap_free_dbg(void **p, const char *f, size_t l); | |||
__P void oscap_free(void *p) | __ATTRIB void oscap_free(void *p) | |||
{ | { | |||
__oscap_free_dbg(&p, __FUNCTION__, 0); | __oscap_free_dbg(&p, __FUNCTION__, 0); | |||
} | } | |||
/** | /** | |||
* malloc wrapper | * malloc wrapper | |||
*/ | */ | |||
# define oscap_alloc(s) __oscap_alloc_dbg (s, __PRETTY_FUNCTION__, __ LINE__) | # define oscap_alloc(s) __oscap_alloc_dbg (s, __PRETTY_FUNCTION__, __ LINE__) | |||
/** | /** | |||
* calloc wrapper | * calloc wrapper | |||
End of changes. 11 change blocks. | ||||
12 lines changed or deleted | 11 lines changed or added | |||
oval_definitions.h | oval_definitions.h | |||
---|---|---|---|---|
skipping to change at line 195 | skipping to change at line 195 | |||
} oval_setobject_operation_t; | } oval_setobject_operation_t; | |||
/// OVAL variable types | /// OVAL variable types | |||
typedef enum { | typedef enum { | |||
OVAL_VARIABLE_UNKNOWN, | OVAL_VARIABLE_UNKNOWN, | |||
OVAL_VARIABLE_EXTERNAL, | OVAL_VARIABLE_EXTERNAL, | |||
OVAL_VARIABLE_CONSTANT, | OVAL_VARIABLE_CONSTANT, | |||
OVAL_VARIABLE_LOCAL | OVAL_VARIABLE_LOCAL | |||
} oval_variable_type_t; | } oval_variable_type_t; | |||
#define OVAL_FUNCTION 10 | #define OVAL_FUNCTION 4 | |||
/// Component types | /// Component types | |||
typedef enum { | typedef enum { | |||
OVAL_COMPONENT_UNKNOWN = 0, | OVAL_COMPONENT_UNKNOWN = 0, | |||
OVAL_COMPONENT_LITERAL = 1, | OVAL_COMPONENT_LITERAL = 1, | |||
OVAL_COMPONENT_OBJECTREF = 2, | OVAL_COMPONENT_OBJECTREF = 2, | |||
OVAL_COMPONENT_VARREF = 3, | OVAL_COMPONENT_VARREF = 3, | |||
OVAL_COMPONENT_FUNCTION = 4, | OVAL_COMPONENT_FUNCTION = 4, | |||
OVAL_FUNCTION_BEGIN = OVAL_FUNCTION + 1, | OVAL_FUNCTION_BEGIN = OVAL_FUNCTION + 1, | |||
OVAL_FUNCTION_CONCAT = OVAL_FUNCTION + 2, | OVAL_FUNCTION_CONCAT = OVAL_FUNCTION + 2, | |||
OVAL_FUNCTION_END = OVAL_FUNCTION + 3, | OVAL_FUNCTION_END = OVAL_FUNCTION + 3, | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
text.h | text.h | |||
---|---|---|---|---|
skipping to change at line 156 | skipping to change at line 156 | |||
* @name Setters | * @name Setters | |||
* For lists use add functions. Parameters of set functions are duplicated in memory and need to | * For lists use add functions. Parameters of set functions are duplicated in memory and need to | |||
* be freed by caller. | * be freed by caller. | |||
* @{ | * @{ | |||
*/ | */ | |||
/** | /** | |||
* Set whether this text overrides parent content. | * Set whether this text overrides parent content. | |||
* @memberof oscap_text | * @memberof oscap_text | |||
*/ | */ | |||
//bool oscap_text_set_overrides(struct oscap_text *text, bool overrides); | bool oscap_text_set_overrides(struct oscap_text *text, bool overrides); | |||
/// @memberof oscap_text | /// @memberof oscap_text | |||
bool oscap_text_set_text(struct oscap_text *text, const char * string); | bool oscap_text_set_text(struct oscap_text *text, const char * string); | |||
/// @memberof oscap_text | /// @memberof oscap_text | |||
bool oscap_text_set_lang(struct oscap_text *text, const char *string); | bool oscap_text_set_lang(struct oscap_text *text, const char *string); | |||
/// @memberof oscap_stringlist | /// @memberof oscap_stringlist | |||
bool oscap_stringlist_add_string(struct oscap_stringlist* list, const char *str); | bool oscap_stringlist_add_string(struct oscap_stringlist* list, const char *str); | |||
/// @memberof oscap_stringlist | /// @memberof oscap_stringlist | |||
struct oscap_stringlist * oscap_stringlist_new(void); | struct oscap_stringlist * oscap_stringlist_new(void); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
xccdf.h | xccdf.h | |||
---|---|---|---|---|
skipping to change at line 3072 | skipping to change at line 3072 | |||
void xccdf_instance_iterator_reset(struct xccdf_instance_iterator *it); | void xccdf_instance_iterator_reset(struct xccdf_instance_iterator *it); | |||
/// @memberof xccdf_rule_result_iterator | /// @memberof xccdf_rule_result_iterator | |||
void xccdf_rule_result_iterator_reset(struct xccdf_rule_result_iterator *it ); | void xccdf_rule_result_iterator_reset(struct xccdf_rule_result_iterator *it ); | |||
/// @memberof xccdf_identity_iterator | /// @memberof xccdf_identity_iterator | |||
void xccdf_identity_iterator_reset(struct xccdf_identity_iterator *it); | void xccdf_identity_iterator_reset(struct xccdf_identity_iterator *it); | |||
/// @memberof xccdf_score_iterator | /// @memberof xccdf_score_iterator | |||
void xccdf_score_iterator_reset(struct xccdf_score_iterator *it); | void xccdf_score_iterator_reset(struct xccdf_score_iterator *it); | |||
/// @memberof xccdf_target_fact_iterator | /// @memberof xccdf_target_fact_iterator | |||
void xccdf_target_fact_iterator_reset(struct xccdf_target_fact_iterator *it ); | void xccdf_target_fact_iterator_reset(struct xccdf_target_fact_iterator *it ); | |||
// textual substitution interface | ||||
/// Type of textual substitution | ||||
typedef enum xccdf_subst_type { | ||||
XCCDF_SUBST_NONE, | ||||
XCCDF_SUBST_SUB, ///< substitute cdf:sub element | ||||
XCCDF_SUBST_LINK, ///< substitute a hyperlink | ||||
XCCDF_SUBST_INSTANCE ///< substitute cdf:instance element | ||||
} xccdf_subst_type_t; | ||||
/** | ||||
* Textual substitution callback. | ||||
* This function is supposed to return textual representation of the substi | ||||
tution with given ID. | ||||
* @param type Type of the substitution | ||||
* @param id ID of the object to be substituted | ||||
* @param arg arbitrary user-defined argument | ||||
* @return newly allocated substitution string (will be free'd) | ||||
*/ | ||||
typedef char*(*xccdf_substitution_func)(xccdf_subst_type_t type, const char | ||||
*id, void *arg); | ||||
/** | ||||
* Perform a textual substitution. | ||||
* Calls @a cb on each substitution (e.g. a cdf:sub element) of @a text and | ||||
returns a string with substitutions done. | ||||
* @param text source text | ||||
* @param cb substitution callback | ||||
* @param arg arbitrary argument to be passed to he callback | ||||
* @return substituted string (it is up to the caller to free it) | ||||
*/ | ||||
char* oscap_text_xccdf_substitute(const char *text, xccdf_substitution_func | ||||
cb, void *arg); | ||||
/************************************************************ | /************************************************************ | |||
** @} End of XCCDF group */ | ** @} End of XCCDF group */ | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 34 lines changed or added | |||
xccdf_policy.h | xccdf_policy.h | |||
---|---|---|---|---|
skipping to change at line 482 | skipping to change at line 482 | |||
/** | /** | |||
* Get score of the XCCDF Benchmark | * Get score of the XCCDF Benchmark | |||
* @param policy XCCDF Policy | * @param policy XCCDF Policy | |||
* @param test_result Test Result model | * @param test_result Test Result model | |||
* @param system Score system | * @param system Score system | |||
* @return XCCDF Score | * @return XCCDF Score | |||
*/ | */ | |||
struct xccdf_score * xccdf_policy_get_score(struct xccdf_policy * policy, s truct xccdf_result * test_result, const char * system); | struct xccdf_score * xccdf_policy_get_score(struct xccdf_policy * policy, s truct xccdf_result * test_result, const char * system); | |||
/** | ||||
* Perform textual substitution of cdf:sub elements with respect to given X | ||||
CCDF policy. | ||||
* @param text text to be substituted | ||||
* @param policy policy to be used | ||||
*/ | ||||
char* xccdf_policy_substitute(const char *text, struct xccdf_policy *policy | ||||
); | ||||
/************************************************************/ | /************************************************************/ | |||
/** @} End of Iterators group */ | /** @} End of Iterators group */ | |||
/* | /* | |||
* @} | * @} | |||
*/ | */ | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 9 lines changed or added | |||