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 00044 typedef struct cpe_dict_check { 00045 char *system; 00046 char *href; 00047 char *identifier; 00048 } cpe_dict_check_t; 00049 00051 typedef struct cpe_dict_reference { 00052 char *href; 00053 char *content; 00054 } cpe_dict_reference_t; 00055 00057 typedef struct cpe_dict_item { 00058 00059 cpe_t *name; 00060 00061 char *title; 00062 00063 char **notes; 00064 size_t notes_n; 00065 size_t notes_alloc_; 00066 00067 cpe_t *depracated; 00068 char *depracation_date; 00069 00070 cpe_dict_reference_t *references; 00071 size_t references_n; 00072 size_t references_alloc_; 00073 00074 cpe_dict_check_t **check; 00075 size_t check_n; 00076 size_t check_alloc_; 00077 00078 struct cpe_dict_item *next; 00079 00080 } cpe_dict_item_t; 00081 00083 typedef struct cpe_dict { 00084 00085 struct cpe_dict_item *first; 00086 struct cpe_dict_item *last; 00087 size_t item_n; 00088 cpe_t **cpes; 00089 size_t cpes_alloc_; 00090 00091 struct { 00092 char *product_name; 00093 char *product_version; 00094 char *schema_version; 00095 char *timestamp; 00096 } generator; 00097 00098 } cpe_dict_t; 00099 00106 cpe_dict_t *cpe_dict_new(const char *fname); 00107 00113 cpe_dict_t *cpe_dict_new_empty(); 00114 00123 bool cpe_dict_add_item(cpe_dict_t * dict, cpe_dict_item_t * item); 00124 00129 void cpe_dict_delete(cpe_dict_t * dict); 00130 00136 cpe_dict_item_t *cpe_dictitem_new_empty(); 00137 00142 void cpe_dictitem_delete(cpe_dict_item_t * item); 00143 00144 void cpe_dictcheck_delete(cpe_dict_check_t * check); 00145 00146 #endif /* _CPEDICT_H_ */ 00147