00001 /* createrepo_c - Library of routines for manipulation with repodata 00002 * Copyright (C) 2012 Tomas Mlcoch 00003 * Copyright (C) 2007 James Bowes 00004 * Copyright (C) 2006 Seth Vidal 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00019 * USA. 00020 */ 00021 00022 #ifndef __C_CREATEREPOLIB_PACKAGE_H__ 00023 #define __C_CREATEREPOLIB_PACKAGE_H__ 00024 00025 #ifdef __cplusplus 00026 extern "C" { 00027 #endif 00028 00029 #include <glib.h> 00030 00036 typedef enum { 00037 CR_PACKAGE_FROM_HEADER = (1<<1), 00038 CR_PACKAGE_FROM_XML = (1<<2), 00039 /* Some values are reserved (for sqlite, solv, etc..) */ 00040 CR_PACKAGE_LOADED_PRI = (1<<10), 00041 CR_PACKAGE_LOADED_FIL = (1<<11), 00042 CR_PACKAGE_LOADED_OTH = (1<<12), 00043 } cr_PackageLoadingFlags; 00044 00047 typedef struct { 00048 char *name; 00049 char *flags; 00051 char *epoch; 00052 char *version; 00053 char *release; 00054 gboolean pre; 00055 } cr_Dependency; 00056 00059 typedef struct { 00060 char *type; 00061 char *path; 00062 char *name; 00063 } cr_PackageFile; 00064 00067 typedef struct { 00068 char *author; 00069 gint64 date; 00070 char *changelog; 00071 } cr_ChangelogEntry; 00072 00075 typedef struct { 00076 void *data; 00077 gsize size; 00078 } cr_BinaryData; 00079 00082 typedef struct { 00083 gint64 pkgKey; 00084 char *pkgId; 00085 char *name; 00086 char *arch; 00087 char *version; 00088 char *epoch; 00089 char *release; 00090 char *summary; 00091 char *description; 00092 char *url; 00093 gint64 time_file; 00094 gint64 time_build; 00095 char *rpm_license; 00096 char *rpm_vendor; 00097 char *rpm_group; 00099 char *rpm_buildhost; 00101 char *rpm_sourcerpm; 00102 gint64 rpm_header_start; 00103 gint64 rpm_header_end; 00104 char *rpm_packager; 00105 gint64 size_package; 00106 gint64 size_installed; 00107 gint64 size_archive; 00109 char *location_href; 00110 char *location_base; 00111 char *checksum_type; 00114 GSList *requires; 00115 GSList *provides; 00116 GSList *conflicts; 00117 GSList *obsoletes; 00118 GSList *suggests; 00119 GSList *enhances; 00120 GSList *recommends; 00121 GSList *supplements; 00123 GSList *files; 00125 GSList *changelogs; 00128 char *hdrid; 00129 cr_BinaryData *siggpg; 00130 cr_BinaryData *sigpgp; 00131 00132 GStringChunk *chunk; 00135 cr_PackageLoadingFlags loadingflags; 00137 } cr_Package; 00138 00142 cr_Dependency *cr_dependency_new(void); 00143 00147 cr_PackageFile *cr_package_file_new(void); 00148 00152 cr_ChangelogEntry *cr_changelog_entry_new(void); 00153 00157 cr_BinaryData *cr_binary_data_new(void); 00158 00162 cr_Package *cr_package_new(void); 00163 00167 cr_Package *cr_package_new_without_chunk(void); 00168 00172 void cr_package_free(cr_Package *package); 00173 00178 gchar *cr_package_nvra(cr_Package *package); 00179 00184 gchar *cr_package_nevra(cr_Package *package); 00185 00190 cr_Package *cr_package_copy(cr_Package *package); 00191 00194 #ifdef __cplusplus 00195 } 00196 #endif 00197 00198 #endif /* __C_CREATEREPOLIB_PACKAGE_H__ */