Open SCAP Library
cpeuri.h
Go to the documentation of this file.
1 
15 /*
16  * Copyright 2009 Red Hat Inc., Durham, North Carolina.
17  * All Rights Reserved.
18  *
19  * This library is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU Lesser General Public
21  * License as published by the Free Software Foundation; either
22  * version 2.1 of the License, or (at your option) any later version.
23  *
24  * This library is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27  * Lesser General Public License for more details.
28  *
29  * You should have received a copy of the GNU Lesser General Public
30  * License along with this library; if not, write to the Free Software
31  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32  *
33  * Authors:
34  * Lukas Kuklinek <lkuklinek@redhat.com>
35  */
36 
37 #ifndef _CPEURI_H_
38 #define _CPEURI_H_
39 
40 #include <stdbool.h>
41 #include <stdlib.h>
42 #include <stdio.h>
43 
45 typedef enum {
50 } cpe_part_t;
51 
58 struct cpe_name;
59 
69 struct cpe_name *cpe_name_new(const char *cpe);
70 
76 struct cpe_name * cpe_name_clone(struct cpe_name * old_name);
77 
83 void cpe_name_free(struct cpe_name *cpe);
84 
85 /************************************************************/
97 cpe_part_t cpe_name_get_part(const struct cpe_name *cpe);
98 
103 const char *cpe_name_get_vendor(const struct cpe_name *cpe);
104 
109 const char *cpe_name_get_product(const struct cpe_name *cpe);
110 
115 const char *cpe_name_get_version(const struct cpe_name *cpe);
116 
121 const char *cpe_name_get_update(const struct cpe_name *cpe);
122 
127 const char *cpe_name_get_edition(const struct cpe_name *cpe);
128 
133 const char *cpe_name_get_language(const struct cpe_name *cpe);
134 
143 char *cpe_name_get_uri(const struct cpe_name *cpe);
144 
145 /************************************************************/
148 /************************************************************/
160 bool cpe_name_set_part(struct cpe_name *cpe, cpe_part_t newval);
161 
166 bool cpe_name_set_vendor(struct cpe_name *cpe, const char *newval);
167 
172 bool cpe_name_set_product(struct cpe_name *cpe, const char *newval);
173 
178 bool cpe_name_set_version(struct cpe_name *cpe, const char *newval);
179 
184 bool cpe_name_set_update(struct cpe_name *cpe, const char *newval);
185 
190 bool cpe_name_set_edition(struct cpe_name *cpe, const char *newval);
191 
196 bool cpe_name_set_language(struct cpe_name *cpe, const char *newval);
197 
198 /************************************************************/
201 /************************************************************/
212 bool cpe_name_match_one(const struct cpe_name *cpe, const struct cpe_name *against);
213 
222 bool cpe_name_match_cpes(const struct cpe_name *name, size_t n, struct cpe_name **namelist);
223 
232 int cpe_name_write(const struct cpe_name *cpe, FILE * f);
233 
239 bool cpe_name_check(const char *str);
240 
251 int cpe_name_match_strs(const char *candidate, size_t n, char **targets);
252 
258 const char * cpe_name_supported(void);
259 
260 /************************************************************/
264 
267 #endif /* _CPEURI_H_ */