00001 00014 /* 00015 * Copyright 2008 Red Hat Inc., Durham, North Carolina. 00016 * All Rights Reserved. 00017 * 00018 * This library is free software; you can redistribute it and/or 00019 * modify it under the terms of the GNU Lesser General Public 00020 * License as published by the Free Software Foundation; either 00021 * version 2.1 of the License, or (at your option) any later version. 00022 * 00023 * This library is distributed in the hope that it will be useful, 00024 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00025 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00026 * Lesser General Public License for more details. 00027 * 00028 * You should have received a copy of the GNU Lesser General Public 00029 * License along with this library; if not, write to the Free Software 00030 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00031 * 00032 * Authors: 00033 * Lukas Kuklinek <lkuklinek@redhat.com> 00034 */ 00035 00036 #ifndef _CPEDICT_H_ 00037 #define _CPEDICT_H_ 00038 00039 #include <stdlib.h> 00040 00041 #include "cpeuri.h" 00042 #include "../common/oscap.h" 00043 00048 struct cpe_dict_check; 00049 00054 struct cpe_dict_reference; 00055 00060 struct cpe_dictitem; 00061 00066 struct cpe_dict; 00067 00068 00069 00074 struct cpe_dictitem_iterator; 00076 struct cpe_dictitem* cpe_dictitem_iterator_next(struct cpe_dictitem_iterator* it); 00078 bool cpe_dictitem_iterator_has_more(struct cpe_dictitem_iterator* it); 00080 void cpe_dictitem_iterator_free(struct cpe_dictitem_iterator* it); 00081 00086 struct cpe_dict_reference_iterator; 00088 struct cpe_dict_reference* cpe_dict_reference_iterator_next(struct cpe_dict_reference_iterator* it); 00090 bool cpe_dict_reference_iterator_has_more(struct cpe_dict_reference_iterator* it); 00092 void cpe_dict_reference_iterator_free(struct cpe_dict_reference_iterator* it); 00093 00098 struct cpe_dict_check_iterator; 00100 struct cpe_dict_check* cpe_dict_check_iterator_next(struct cpe_dict_check_iterator* it); 00102 bool cpe_dict_check_iterator_has_more(struct cpe_dict_check_iterator* it); 00104 void cpe_dict_check_iterator_free(struct cpe_dict_check_iterator* it); 00105 00106 00114 struct cpe_dict *cpe_dict_new(const char *fname); 00115 00122 struct cpe_dict *cpe_dict_new_empty(void); 00123 00133 bool cpe_dict_add_item(struct cpe_dict * dict, struct cpe_dictitem * item); 00134 00140 void cpe_dict_free(struct cpe_dict * dict); 00141 00146 struct cpe_dictitem_iterator* cpe_dict_get_items(const struct cpe_dict* item); 00147 00152 const char* cpe_dict_get_generator_product_name(const struct cpe_dict* item); 00153 00158 const char* cpe_dict_get_generator_product_version(const struct cpe_dict* item); 00159 00164 const char* cpe_dict_get_generator_schema_version(const struct cpe_dict* item); 00165 00170 const char* cpe_dict_get_generator_timestamp(const struct cpe_dict* item); 00171 00176 const char* cpe_dict_check_get_system(const struct cpe_dict_check* item); 00177 00182 const char* cpe_dict_check_get_href(const struct cpe_dict_check* item); 00183 00188 const char* cpe_dict_check_get_identifier(const struct cpe_dict_check* item); 00189 00190 00195 const char* cpe_dict_reference_get_href(const struct cpe_dict_reference* item); 00196 00201 const char* cpe_dict_reference_get_content(const struct cpe_dict_reference* item); 00202 00203 00208 struct cpe_name* cpe_dictitem_get_name(const struct cpe_dictitem* item); 00209 00214 const char* cpe_dictitem_get_title(const struct cpe_dictitem* item); 00215 00220 struct cpe_dict_reference_iterator* cpe_dictitem_get_references(const struct cpe_dictitem* item); 00221 00226 struct cpe_dict_check_iterator* cpe_dictitem_get_checks(const struct cpe_dictitem* item); 00227 00232 struct oscap_string_iterator* cpe_dictitem_get_notes(const struct cpe_dictitem* item); 00233 00239 struct cpe_name* cpe_dictitem_get_deprecated(const struct cpe_dictitem* item); 00240 00245 const char* cpe_dictitem_get_deprecation_date(const struct cpe_dictitem* item); 00246 00255 bool cpe_name_match_dict(struct cpe_name * cpe, struct cpe_dict * dict); 00256 00265 bool cpe_name_match_dict_str(const char *cpe, struct cpe_dict * dict); 00266 00267 #endif /* _CPEDICT_H_ */ 00268