createrepo_c library 1.2.1 C library for metadata manipulation

package.h
1 /* createrepo_c - Library of routines for manipulation with repodata
2 * Copyright (C) 2012 Tomas Mlcoch
3 * Copyright (C) 2007 James Bowes
4 * Copyright (C) 2006 Seth Vidal
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19 * USA.
20 */
21
22 #ifndef __C_CREATEREPOLIB_PACKAGE_H__
23 #define __C_CREATEREPOLIB_PACKAGE_H__
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #include <glib.h>
30
36 typedef enum {
37 CR_PACKAGE_FROM_HEADER = (1<<1),
38 CR_PACKAGE_FROM_XML = (1<<2),
39 /* Some values are reserved (for sqlite, solv, etc..) */
40 CR_PACKAGE_LOADED_PRI = (1<<10),
41 CR_PACKAGE_LOADED_FIL = (1<<11),
42 CR_PACKAGE_LOADED_OTH = (1<<12),
43 CR_PACKAGE_SINGLE_CHUNK = (1<<13),
44 } cr_PackageLoadingFlags;
45
48 typedef struct {
49 char *name;
50 char *flags;
52 char *epoch;
53 char *version;
54 char *release;
55 gboolean pre;
56 } cr_Dependency;
57
60 typedef struct {
61 char *type;
62 char *path;
63 char *name;
64 char *digest;
65 } cr_PackageFile;
66
69 typedef struct {
70 char *author;
71 gint64 date;
72 char *changelog;
73 } cr_ChangelogEntry;
74
77 typedef struct {
78 void *data;
79 gsize size;
80 } cr_BinaryData;
81
84 typedef struct {
85 gint64 pkgKey;
86 char *pkgId;
87 char *name;
88 char *arch;
89 char *version;
90 char *epoch;
91 char *release;
92 char *summary;
93 char *description;
94 char *url;
95 gint64 time_file;
96 gint64 time_build;
97 char *rpm_license;
98 char *rpm_vendor;
99 char *rpm_group;
101 char *rpm_buildhost;
103 char *rpm_sourcerpm;
104 gint64 rpm_header_start;
105 gint64 rpm_header_end;
106 char *rpm_packager;
107 gint64 size_package;
108 gint64 size_installed;
109 gint64 size_archive;
111 char *location_href;
112 char *location_base;
113 char *checksum_type;
115 char *files_checksum_type;
118 GSList *requires;
119 GSList *provides;
120 GSList *conflicts;
121 GSList *obsoletes;
122 GSList *suggests;
123 GSList *enhances;
124 GSList *recommends;
125 GSList *supplements;
127 GSList *files;
129 GSList *changelogs;
132 char *hdrid;
133 cr_BinaryData *siggpg;
134 cr_BinaryData *sigpgp;
135
136 GStringChunk *chunk;
139 cr_PackageLoadingFlags loadingflags;
141 gboolean skip_dump;
142 } cr_Package;
143
147 cr_Dependency *cr_dependency_new(void);
148
152 cr_PackageFile *cr_package_file_new(void);
153
157 cr_ChangelogEntry *cr_changelog_entry_new(void);
158
162 cr_BinaryData *cr_binary_data_new(void);
163
167 cr_Package *cr_package_new(void);
168
172 cr_Package *cr_package_new_without_chunk(void);
173
177 void cr_package_free(cr_Package *package);
178
183 gchar *cr_package_nvra(cr_Package *package);
184
189 gchar *cr_package_nevra(cr_Package *package);
190
195 cr_Package *cr_package_copy(cr_Package *package);
196
199 #ifdef __cplusplus
200 }
201 #endif
202
203 #endif /* __C_CREATEREPOLIB_PACKAGE_H__ */
cr_Dependency::flags
char * flags
Definition: package.h:50
cr_package_new_without_chunk
cr_Package * cr_package_new_without_chunk(void)
CR_PACKAGE_LOADED_FIL
@ CR_PACKAGE_LOADED_FIL
Definition: package.h:41
cr_Package::recommends
GSList * recommends
Definition: package.h:124
cr_Package::summary
char * summary
Definition: package.h:92
cr_PackageFile::path
char * path
Definition: package.h:62
CR_PACKAGE_LOADED_PRI
@ CR_PACKAGE_LOADED_PRI
Definition: package.h:40
cr_Dependency::epoch
char * epoch
Definition: package.h:52
cr_ChangelogEntry::date
gint64 date
Definition: package.h:71
cr_Package::obsoletes
GSList * obsoletes
Definition: package.h:121
cr_package_free
void cr_package_free(cr_Package *package)
cr_ChangelogEntry
Definition: package.h:69
cr_BinaryData
Definition: package.h:77
cr_Package::url
char * url
Definition: package.h:94
cr_Package::loadingflags
cr_PackageLoadingFlags loadingflags
Definition: package.h:139
cr_Package::location_href
char * location_href
Definition: package.h:111
cr_Dependency::release
char * release
Definition: package.h:54
cr_Package::rpm_buildhost
char * rpm_buildhost
Definition: package.h:101
cr_Package::release
char * release
Definition: package.h:91
cr_Package::size_package
gint64 size_package
Definition: package.h:107
cr_Package::pkgKey
gint64 pkgKey
Definition: package.h:85
cr_Package::arch
char * arch
Definition: package.h:88
cr_Package::suggests
GSList * suggests
Definition: package.h:122
cr_package_nevra
gchar * cr_package_nevra(cr_Package *package)
cr_package_nvra
gchar * cr_package_nvra(cr_Package *package)
cr_ChangelogEntry::author
char * author
Definition: package.h:70
cr_PackageFile::digest
char * digest
Definition: package.h:64
cr_PackageFile::type
char * type
Definition: package.h:61
cr_Package::enhances
GSList * enhances
Definition: package.h:123
cr_changelog_entry_new
cr_ChangelogEntry * cr_changelog_entry_new(void)
cr_Package::rpm_group
char * rpm_group
Definition: package.h:99
cr_Dependency::name
char * name
Definition: package.h:49
cr_Package::pkgId
char * pkgId
Definition: package.h:86
CR_PACKAGE_FROM_HEADER
@ CR_PACKAGE_FROM_HEADER
Definition: package.h:37
CR_PACKAGE_SINGLE_CHUNK
@ CR_PACKAGE_SINGLE_CHUNK
Definition: package.h:43
cr_Package::chunk
GStringChunk * chunk
Definition: package.h:136
cr_Package::size_archive
gint64 size_archive
Definition: package.h:109
cr_Package::changelogs
GSList * changelogs
Definition: package.h:129
cr_Package::checksum_type
char * checksum_type
Definition: package.h:113
cr_Package::conflicts
GSList * conflicts
Definition: package.h:120
cr_Package::epoch
char * epoch
Definition: package.h:90
cr_Package::rpm_license
char * rpm_license
Definition: package.h:97
cr_binary_data_new
cr_BinaryData * cr_binary_data_new(void)
cr_Package::location_base
char * location_base
Definition: package.h:112
cr_PackageFile::name
char * name
Definition: package.h:63
cr_Package::rpm_sourcerpm
char * rpm_sourcerpm
Definition: package.h:103
cr_PackageFile
Definition: package.h:60
cr_Package::description
char * description
Definition: package.h:93
cr_Package::rpm_packager
char * rpm_packager
Definition: package.h:106
cr_package_file_new
cr_PackageFile * cr_package_file_new(void)
cr_package_new
cr_Package * cr_package_new(void)
cr_Package::skip_dump
gboolean skip_dump
Definition: package.h:141
cr_Package::requires
GSList * requires
Definition: package.h:118
cr_Package::time_build
gint64 time_build
Definition: package.h:96
cr_Package::supplements
GSList * supplements
Definition: package.h:125
cr_Dependency::pre
gboolean pre
Definition: package.h:55
cr_Package::rpm_header_end
gint64 rpm_header_end
Definition: package.h:105
CR_PACKAGE_FROM_XML
@ CR_PACKAGE_FROM_XML
Definition: package.h:38
CR_PACKAGE_LOADED_OTH
@ CR_PACKAGE_LOADED_OTH
Definition: package.h:42
cr_Package::provides
GSList * provides
Definition: package.h:119
cr_Package::files_checksum_type
char * files_checksum_type
Definition: package.h:115
cr_Package::rpm_vendor
char * rpm_vendor
Definition: package.h:98
cr_Package::size_installed
gint64 size_installed
Definition: package.h:108
cr_package_copy
cr_Package * cr_package_copy(cr_Package *package)
cr_Dependency
Definition: package.h:48
cr_Package::version
char * version
Definition: package.h:89
cr_Dependency::version
char * version
Definition: package.h:53
cr_dependency_new
cr_Dependency * cr_dependency_new(void)
cr_Package::time_file
gint64 time_file
Definition: package.h:95
cr_Package
Definition: package.h:84
cr_Package::name
char * name
Definition: package.h:87
cr_Package::files
GSList * files
Definition: package.h:127
cr_ChangelogEntry::changelog
char * changelog
Definition: package.h:72
cr_PackageLoadingFlags
cr_PackageLoadingFlags
Definition: package.h:36
cr_Package::rpm_header_start
gint64 rpm_header_start
Definition: package.h:104