00001
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _CPEURI_H_
00038 #define _CPEURI_H_
00039
00040 #include <stdbool.h>
00041 #include <stdlib.h>
00042 #include <stdio.h>
00043
00045 typedef enum {
00046 CPE_PART_NONE,
00047 CPE_PART_HW,
00048 CPE_PART_OS,
00049 CPE_PART_APP
00050 } cpe_part_t;
00051
00058 struct cpe_name;
00059
00069 struct cpe_name* cpe_name_new(const char *cpe);
00070
00076 void cpe_name_free(struct cpe_name * cpe);
00077
00082 cpe_part_t cpe_name_get_part(const struct cpe_name * cpe);
00083
00088 const char* cpe_name_get_vendor(const struct cpe_name * cpe);
00089
00094 const char* cpe_name_get_product(const struct cpe_name * cpe);
00095
00100 const char* cpe_name_get_version(const struct cpe_name * cpe);
00101
00106 const char* cpe_name_get_update(const struct cpe_name * cpe);
00107
00112 const char* cpe_name_get_edition(const struct cpe_name * cpe);
00113
00118 const char* cpe_name_get_language(const struct cpe_name * cpe);
00119
00124 bool cpe_name_set_part(struct cpe_name * cpe, cpe_part_t newval);
00125
00130 bool cpe_name_set_vendor(struct cpe_name * cpe, const char *newval);
00131
00136 bool cpe_name_set_product(struct cpe_name * cpe, const char *newval);
00137
00142 bool cpe_name_set_version(struct cpe_name * cpe, const char *newval);
00143
00148 bool cpe_name_set_update(struct cpe_name * cpe, const char *newval);
00149
00154 bool cpe_name_set_edition(struct cpe_name * cpe, const char *newval);
00155
00160 bool cpe_name_set_language(struct cpe_name * cpe, const char *newval);
00161
00167 bool cpe_name_match_one(const struct cpe_name* cpe, const struct cpe_name* against);
00168
00177 bool cpe_name_match_cpes(const struct cpe_name* name, size_t n, struct cpe_name** namelist);
00178
00187 char *cpe_name_get_uri(const struct cpe_name * cpe);
00188
00197 int cpe_name_write(const struct cpe_name * cpe, FILE * f);
00198
00204 bool cpe_name_check(const char *str);
00205
00216 int cpe_name_match_strs(const char *candidate, size_t n, char **targets);
00217
00218
00219
00220 #endif