cpe_name Struct Reference
CPE URIs

Structure holding Common Platform Enumeration URI data. More...

`#include <cpe_name.h>`

## Public Member Functions

struct cpe_name * | cpe_name_new (const char *cpe)
| Create a new CPE structure from string cpe. More...
struct cpe_name * | cpe_name_clone (struct cpe_name *old_name)
| Clone CPE Name. More...
void | cpe_name_free (struct cpe_name *cpe)
| Destructor. 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.
cpe_format_t | cpe_name_get_format (const struct cpe_name *cpe)
| Get how the CPE name was loaded and how it should be saved.
cpe_part_t | cpe_name_get_part (const struct cpe_name *cpe)
| Get CPE name part type field.
const char * | cpe_name_get_vendor (const struct cpe_name *cpe)
| Get CPE name vendor field.
const char * | cpe_name_get_product (const struct cpe_name *cpe)
| Get CPE name product field.
const char * | cpe_name_get_version (const struct cpe_name *cpe)
| Get CPE name version field.
const char * | cpe_name_get_update (const struct cpe_name *cpe)
| Get CPE name update field.
const char * | cpe_name_get_edition (const struct cpe_name *cpe)
| Get CPE name edition field.
const char * | cpe_name_get_language (const struct cpe_name *cpe)
| Get CPE name language field.
const char * | cpe_name_get_sw_edition (const struct cpe_name *cpe)
| Get CPE name sw_edition field.
const char * | cpe_name_get_target_sw (const struct cpe_name *cpe)
| Get CPE name target_sw field.
const char * | cpe_name_get_target_hw (const struct cpe_name *cpe)
| Get CPE name target_hw field.
const char * | cpe_name_get_other (const struct cpe_name *cpe)
| Get CPE name other field.
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. More...
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. More...
Setters
For lists use add functions. Parameters of set functions are duplicated in memory and need to be freed by caller.
bool | 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.
bool | cpe_name_set_part (struct cpe_name *cpe, cpe_part_t newval)
| Set CPE name part type field.
bool | cpe_name_set_vendor (struct cpe_name *cpe, const char *newval)
| Set CPE name vendor field.
bool | cpe_name_set_product (struct cpe_name *cpe, const char *newval)
| Set CPE name product field.
bool | cpe_name_set_version (struct cpe_name *cpe, const char *newval)
| Set CPE name version field.
bool | cpe_name_set_update (struct cpe_name *cpe, const char *newval)
| Set CPE name update field.
bool | cpe_name_set_edition (struct cpe_name *cpe, const char *newval)
| Set CPE name edition field.
bool | cpe_name_set_language (struct cpe_name *cpe, const char *newval)
| Set CPE name language field.
bool | cpe_name_set_sw_edition (struct cpe_name *cpe, const char *newval)
| Set CPE name sw_edition field.
bool | cpe_name_set_target_sw (struct cpe_name *cpe, const char *newval)
| Set CPE name target_sw field.
bool | cpe_name_set_target_hw (struct cpe_name *cpe, const char *newval)
| Set CPE name target_hw field.
bool | cpe_name_set_other (struct cpe_name *cpe, const char *newval)
| Set CPE name other field.
Evaluators
bool | 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.
bool | cpe_name_match_cpes (const struct cpe_name *name, size_t n, struct cpe_name **namelist)
| Check if CPE name matches any CPE in namelist. More...
int | cpe_name_write (const struct cpe_name *cpe, FILE *f)
| Write CPE URI cpe to file a descriptor f. More...
bool | cpe_name_check (const char *str)
| Checks whether str is valid CPE string (in any supported format). More...
int | cpe_name_match_strs (const char *candidate, size_t n, char **targets)
| Match CPE URI candidate against list of n CPE URIs given by targets. More...
const char * | cpe_name_supported (void)
| Get supported version of CPE uri XML. More...

## Data Fields

cpe_format_t | format
cpe_part_t | part
char * | vendor
char * | product
char * | version
char * | update
char * | edition
char * | language
char * | sw_edition
char * | target_sw
char * | target_hw
char * | other

## Detailed Description

Structure holding Common Platform Enumeration URI data.

Empty components are set to NULL.

The documentation for this struct was generated from the following files:

- cpename.c
- cpe_name.h