00001 00008 /* 00009 * Copyright 2008 Red Hat Inc., Durham, North Carolina. 00010 * All Rights Reserved. 00011 * 00012 * This library is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU Lesser General Public 00014 * License as published by the Free Software Foundation; either 00015 * version 2.1 of the License, or (at your option) any later version. 00016 * 00017 * This library is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 * Lesser General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public 00023 * License along with this library; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 * 00026 * Authors: 00027 * Lukas Kuklinek <lkuklinek@redhat.com> 00028 */ 00029 00030 #ifndef _CPEDICT_H_ 00031 #define _CPEDICT_H_ 00032 00033 #include <stdlib.h> 00034 00035 #include "cpeuri.h" 00036 00038 typedef struct cpe_dict_check { 00039 char *system; 00040 char *href; 00041 char *identifier; 00042 } cpe_dict_check_t; 00043 00045 typedef struct cpe_dict_reference { 00046 char *href; 00047 char *content; 00048 } cpe_dict_reference_t; 00049 00051 typedef struct cpe_dict_item { 00052 00053 cpe_t *name; 00054 00055 char *title; 00056 00057 char **notes; 00058 size_t notes_n; 00059 size_t notes_alloc_; 00060 00061 cpe_t *depracated; 00062 char *depracation_date; 00063 00064 cpe_dict_reference_t *references; 00065 size_t references_n; 00066 size_t references_alloc_; 00067 00068 cpe_dict_check_t **check; 00069 size_t check_n; 00070 size_t check_alloc_; 00071 00072 struct cpe_dict_item *next; 00073 00074 } cpe_dict_item_t; 00075 00077 typedef struct cpe_dict { 00078 00079 struct cpe_dict_item *first; 00080 struct cpe_dict_item *last; 00081 size_t item_n; 00082 cpe_t **cpes; 00083 size_t cpes_alloc_; 00084 00085 struct { 00086 char *product_name; 00087 char *product_version; 00088 char *schema_version; 00089 char *timestamp; 00090 } generator; 00091 00092 } cpe_dict_t; 00093 00100 cpe_dict_t *cpe_dict_new(const char *fname); 00101 00107 cpe_dict_t *cpe_dict_new_empty(); 00108 00117 bool cpe_dict_add_item(cpe_dict_t * dict, cpe_dict_item_t * item); 00118 00123 void cpe_dict_delete(cpe_dict_t * dict); 00124 00130 cpe_dict_item_t *cpe_dictitem_new_empty(); 00131 00136 void cpe_dictitem_delete(cpe_dict_item_t * item); 00137 00138 void cpe_dictcheck_delete(cpe_dict_check_t * check); 00139 00140 #endif /* _CPEDICT_H_ */