createrepo_c library
0.7.4
C library for metadata manipulation
Main Page
Modules
Data Structures
Files
File List
All
Data Structures
Functions
Variables
Typedefs
Enumerations
Enumerator
Groups
Pages
compression_wrapper.h
1
/* createrepo_c - Library of routines for manipulation with repodata
2
* Copyright (C) 2012 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_COMPRESSION_WRAPPER_H__
21
#define __C_CREATEREPOLIB_COMPRESSION_WRAPPER_H__
22
23
#ifdef __cplusplus
24
extern
"C"
{
25
#endif
26
27
#include <glib.h>
28
#include "checksum.h"
29
37
typedef
enum
{
38
CR_CW_AUTO_DETECT_COMPRESSION
,
39
CR_CW_UNKNOWN_COMPRESSION
,
40
CR_CW_NO_COMPRESSION
,
41
CR_CW_GZ_COMPRESSION
,
42
CR_CW_BZ2_COMPRESSION
,
43
CR_CW_XZ_COMPRESSION
,
44
CR_CW_COMPRESSION_SENTINEL
,
45
}
cr_CompressionType
;
46
49
typedef
enum
{
50
CR_CW_MODE_READ
,
51
CR_CW_MODE_WRITE
,
52
CR_CW_MODE_SENTINEL
,
53
}
cr_OpenMode
;
54
57
typedef
struct
{
58
gint64
size
;
59
cr_ChecksumType
checksum_type
;
60
char
*
checksum
;
61
}
cr_ContentStat
;
62
69
cr_ContentStat
*
cr_contentstat_new
(
cr_ChecksumType
type, GError **err);
70
75
void
cr_contentstat_free
(
cr_ContentStat
*cstat, GError **err);
76
79
typedef
struct
{
80
cr_CompressionType
type
;
81
void
*
FILE
;
82
cr_OpenMode
mode
;
83
cr_ContentStat
*
stat
;
84
cr_ChecksumCtx
*
checksum_ctx
;
85
}
CR_FILE
;
86
87
#define CR_CW_ERR -1
93
const char *cr_compression_suffix(cr_CompressionType comtype);
94
100
cr_CompressionType
cr_detect_compression
(
const
char
* filename, GError **err);
101
106
cr_CompressionType
cr_compression_type
(
const
char
*name);
107
115
#define cr_open(FILENAME, MODE, COMTYPE, ERR) \
116
cr_sopen(FILENAME, MODE, COMTYPE, NULL, ERR)
117
128
CR_FILE
*
cr_sopen
(
const
char
*filename,
129
cr_OpenMode
mode,
130
cr_CompressionType
comtype,
131
cr_ContentStat
*stat,
132
GError **err);
133
141
int
cr_read
(
CR_FILE
*cr_file,
void
*buffer,
unsigned
int
len, GError **err);
142
151
int
cr_write
(
CR_FILE
*cr_file,
152
const
void
*buffer,
153
unsigned
int
len,
154
GError **err);
155
162
int
cr_puts
(
CR_FILE
*cr_file,
const
char
*str, GError **err);
163
171
int
cr_printf
(GError **err,
CR_FILE
*cr_file,
const
char
*format, ...);
172
178
int
cr_close
(
CR_FILE
*cr_file, GError **err);
179
182
#ifdef __cplusplus
183
}
184
#endif
185
186
#endif
/* __C_CREATEREPOLIB_COMPRESSION_WRAPPER_H__ */
src
compression_wrapper.h
Generated on Tue Nov 11 2014 15:27:42 for createrepo_c library by
1.8.3.1