createrepo_c library 1.2.1 C library for metadata manipulation

deltarpms.h
1 /* createrepo_c - Library of routines for manipulation with repodata
2 * Copyright (C) 2014 Tomas Mlcoch
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17 * USA.
18 */
19
20 #ifndef __C_CREATEREPOLIB_DELTARPMS_H__
21 #define __C_CREATEREPOLIB_DELTARPMS_H__
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #include <glib.h>
28 #include <rpm/rpmlib.h>
29 #include "package.h"
30 #include "parsehdr.h"
31 #include "xml_file.h"
32
38 #ifndef CR_DELTA_RPM_SUPPORT
39 /* #undef CR_DELTA_RPM_SUPPORT */
40 #endif
41 #define CR_DEFAULT_MAX_DELTA_RPM_SIZE 100000000
42
43 typedef struct {
44 cr_Package *package;
45 char *nevr;
46 char *sequence;
47 GStringChunk *chunk;
48 } cr_DeltaPackage;
49
50 typedef struct {
51 char *name;
52 char *arch;
53 char *epoch;
54 char *version;
55 char *release;
56 char *location_href;
57 gint64 size_installed;
58
59 char *path;
60 GStringChunk *chunk;
61 } cr_DeltaTargetPackage;
62
63 gboolean cr_drpm_support(void);
64
65 #ifdef CR_DELTA_RPM_SUPPORT
66 char *
67 cr_drpm_create(cr_DeltaTargetPackage *old,
68 cr_DeltaTargetPackage *new,
69 const char *destdir,
70 GError **err);
71
72 cr_DeltaPackage *
73 cr_deltapackage_from_drpm_base(const char *filename,
74 int changelog_limit,
75 cr_HeaderReadingFlags flags,
76 GError **err);
77
78 void
79 cr_deltapackage_free(cr_DeltaPackage *deltapackage);
80
81 GHashTable *
82 cr_deltarpms_scan_oldpackagedirs(GSList *oldpackagedirs,
83 gint64 max_delta_rpm_size,
84 GError **err);
85
86 cr_DeltaTargetPackage *
87 cr_deltatargetpackage_from_package(cr_Package *pkg,
88 const char *path,
89 GError **err);
90
91 cr_DeltaTargetPackage *
92 cr_deltatargetpackage_from_rpm(const char *path, GError **err);
93
94 void
95 cr_deltatargetpackage_free(cr_DeltaTargetPackage *tpkg);
96
97 gboolean
98 cr_deltarpms_parallel_deltas(GSList *targetpackages,
99 GHashTable *oldpackages,
100 const char *outdeltadir,
101 gint num_deltas,
102 gint workers,
103 gint64 max_delta_rpm_size,
104 gint64 max_work_size,
105 GError **err);
106
107 GSList *
108 cr_deltarpms_scan_targetdir(const char *path,
109 gint64 max_delta_rpm_size,
110 GError **err);
111
112 gboolean
113 cr_deltarpms_generate_prestodelta_file(const gchar *drpmdir,
114 cr_XmlFile *f,
115 cr_XmlFile *zck_f,
116 cr_ChecksumType checksum_type,
117 gint workers,
118 const gchar *prefix_to_strip,
119 GError **err);
120 #endif
121
122
125 #ifdef __cplusplus
126 }
127 #endif
128
129 #endif /* __C_CREATEREPOLIB_DELTARPMS_H__ */
cr_ChecksumType
cr_ChecksumType
Definition: checksum.h:43
cr_HeaderReadingFlags
cr_HeaderReadingFlags
Definition: parsehdr.h:38
cr_DeltaTargetPackage
Definition: deltarpms.h:50
cr_XmlFile
Definition: xml_file.h:50
cr_Package
Definition: package.h:84
cr_DeltaPackage
Definition: deltarpms.h:43