Open SCAP Library
|
Files | |
file | cpe_name.h |
Interface to Common Platform Enumeration (CPE) URI. | |
Data Structures | |
struct | cpe_name |
Structure holding Common Platform Enumeration URI data. More... | |
Enumerations | |
enum | cpe_part_t { CPE_PART_NONE , CPE_PART_HW , CPE_PART_OS , CPE_PART_APP } |
enumeration of possible CPE parts More... | |
enum | cpe_format_t { CPE_FORMAT_UNKNOWN , CPE_FORMAT_URI , CPE_FORMAT_STRING , CPE_FORMAT_WFN } |
Functions | |
OSCAP_API struct cpe_name * | cpe_name::cpe_name_new (const char *cpe) |
Create a new CPE structure from string cpe. More... | |
OSCAP_API struct cpe_name * | cpe_name::cpe_name_clone (struct cpe_name *old_name) |
Clone CPE Name. More... | |
OSCAP_API void | cpe_name::cpe_name_free (struct cpe_name *cpe) |
Destructor. More... | |
Evaluators | |
OSCAP_API cpe_format_t | cpe_name_get_format_of_str (const char *str) |
Looks at given string and returns format it is in. More... | |
OSCAP_API bool | cpe_name::cpe_name_match_one (const struct cpe_name *cpe, const struct cpe_name *against) |
Check if candidate CPE cpe matches CPE against according to CPE specification v 2.1. | |
OSCAP_API int | cpe_name::cpe_name_write (const struct cpe_name *cpe, FILE *f) |
Write CPE URI cpe to file a descriptor f. More... | |
OSCAP_API bool | cpe_name::cpe_name_check (const char *str) |
Checks whether str is valid CPE string (in any supported format). More... | |
OSCAP_API const char * | cpe_name::cpe_name_supported (void) |
Get supported version of CPE uri XML. More... | |
Getters | |
Return value is pointer to structure's member. Do not free unless you null the pointer in the structure. Use remove function otherwise. | |
OSCAP_API cpe_format_t | cpe_name::cpe_name_get_format (const struct cpe_name *cpe) |
Get how the CPE name was loaded and how it should be saved. | |
OSCAP_API cpe_part_t | cpe_name::cpe_name_get_part (const struct cpe_name *cpe) |
Get CPE name part type field. | |
OSCAP_API const char * | cpe_name::cpe_name_get_vendor (const struct cpe_name *cpe) |
Get CPE name vendor field. | |
OSCAP_API const char * | cpe_name::cpe_name_get_product (const struct cpe_name *cpe) |
Get CPE name product field. | |
OSCAP_API const char * | cpe_name::cpe_name_get_version (const struct cpe_name *cpe) |
Get CPE name version field. | |
OSCAP_API const char * | cpe_name::cpe_name_get_update (const struct cpe_name *cpe) |
Get CPE name update field. | |
OSCAP_API const char * | cpe_name::cpe_name_get_edition (const struct cpe_name *cpe) |
Get CPE name edition field. | |
OSCAP_API const char * | cpe_name::cpe_name_get_language (const struct cpe_name *cpe) |
Get CPE name language field. | |
OSCAP_API const char * | cpe_name::cpe_name_get_sw_edition (const struct cpe_name *cpe) |
Get CPE name sw_edition field. | |
OSCAP_API const char * | cpe_name::cpe_name_get_target_sw (const struct cpe_name *cpe) |
Get CPE name target_sw field. | |
OSCAP_API const char * | cpe_name::cpe_name_get_target_hw (const struct cpe_name *cpe) |
Get CPE name target_hw field. | |
OSCAP_API const char * | cpe_name::cpe_name_get_other (const struct cpe_name *cpe) |
Get CPE name other field. | |
OSCAP_API char * | cpe_name::cpe_name_get_as_format (const struct cpe_name *cpe, cpe_format_t format) |
Return CPE URI as a new string in specified format. More... | |
OSCAP_API char * | cpe_name::cpe_name_get_as_str (const struct cpe_name *cpe) |
Return CPE URI as a new string in the format in which it was loaded. More... | |
Setters | |
Parameters of set functions are duplicated in memory and need to be freed by caller. | |
OSCAP_API bool | cpe_name::cpe_name_set_format (struct cpe_name *cpe, cpe_format_t newval) |
Set how the CPE name was loaded and how it should be saved. | |
OSCAP_API bool | cpe_name::cpe_name_set_part (struct cpe_name *cpe, cpe_part_t newval) |
Set CPE name part type field. | |
OSCAP_API bool | cpe_name::cpe_name_set_vendor (struct cpe_name *cpe, const char *newval) |
Set CPE name vendor field. | |
OSCAP_API bool | cpe_name::cpe_name_set_product (struct cpe_name *cpe, const char *newval) |
Set CPE name product field. | |
OSCAP_API bool | cpe_name::cpe_name_set_version (struct cpe_name *cpe, const char *newval) |
Set CPE name version field. | |
OSCAP_API bool | cpe_name::cpe_name_set_update (struct cpe_name *cpe, const char *newval) |
Set CPE name update field. | |
OSCAP_API bool | cpe_name::cpe_name_set_edition (struct cpe_name *cpe, const char *newval) |
Set CPE name edition field. | |
OSCAP_API bool | cpe_name::cpe_name_set_language (struct cpe_name *cpe, const char *newval) |
Set CPE name language field. | |
OSCAP_API bool | cpe_name::cpe_name_set_sw_edition (struct cpe_name *cpe, const char *newval) |
Set CPE name sw_edition field. | |
OSCAP_API bool | cpe_name::cpe_name_set_target_sw (struct cpe_name *cpe, const char *newval) |
Set CPE name target_sw field. | |
OSCAP_API bool | cpe_name::cpe_name_set_target_hw (struct cpe_name *cpe, const char *newval) |
Set CPE name target_hw field. | |
OSCAP_API bool | cpe_name::cpe_name_set_other (struct cpe_name *cpe, const char *newval) |
Set CPE name other field. | |
enum cpe_format_t |
enum cpe_part_t |
OSCAP_API bool cpe_name_check | ( | const char * | str | ) |
Checks whether str is valid CPE string (in any supported format).
str | string to be validated |
Clone CPE Name.
old_name | CPE name |
OSCAP_API void cpe_name_free | ( | struct cpe_name * | cpe | ) |
Destructor.
Frees any used resources and safely destroys cpe.
cpe | CPE to be deleted |
OSCAP_API char * cpe_name_get_as_format | ( | const struct cpe_name * | cpe, |
cpe_format_t | format | ||
) |
Return CPE URI as a new string in specified format.
cpe | CPE to be converted |
format | Which format should the string be in |
NULL | on failure |
OSCAP_API char * cpe_name_get_as_str | ( | const struct cpe_name * | cpe | ) |
Return CPE URI as a new string in the format in which it was loaded.
cpe | CPE to be converted |
NULL | on failure |
OSCAP_API cpe_format_t cpe_name_get_format_of_str | ( | const char * | str | ) |
Looks at given string and returns format it is in.
CPE_FORMAT_UNKNOWN is used in case of errors
OSCAP_API struct cpe_name * cpe_name_new | ( | const char * | cpe | ) |
Create a new CPE structure from string cpe.
cpe | CPE URI string to be parsed |
NULL | on failure |
OSCAP_API const char * cpe_name_supported | ( | void | ) |
Get supported version of CPE uri XML.
OSCAP_API int cpe_name_write | ( | const struct cpe_name * | cpe, |
FILE * | f | ||
) |
Write CPE URI cpe to file a descriptor f.
cpe | cpe to write |
f | file descriptor to write CPE URI to |
<0 | on failure |