createrepo_c library
0.2.1
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 "checksum.h"
28
36
typedef
enum
{
37
CR_CW_AUTO_DETECT_COMPRESSION
,
38
CR_CW_UNKNOWN_COMPRESSION
,
39
CR_CW_NO_COMPRESSION
,
40
CR_CW_GZ_COMPRESSION
,
41
CR_CW_BZ2_COMPRESSION
,
42
CR_CW_XZ_COMPRESSION
,
43
CR_CW_COMPRESSION_SENTINEL
,
44
}
cr_CompressionType
;
45
48
typedef
enum
{
49
CR_CW_MODE_READ
,
50
CR_CW_MODE_WRITE
,
51
CR_CW_MODE_SENTINEL
,
52
}
cr_OpenMode
;
53
56
typedef
struct
{
57
gint64
size
;
58
cr_ChecksumType
checksum_type
;
59
char
*
checksum
;
60
}
cr_ContentStat
;
61
68
cr_ContentStat
*
cr_contentstat_new
(
cr_ChecksumType
type, GError **err);
69
74
void
cr_contentstat_free
(
cr_ContentStat
*cstat, GError **err);
75
78
typedef
struct
{
79
cr_CompressionType
type
;
80
void
*
FILE
;
81
cr_OpenMode
mode
;
82
cr_ContentStat
*
stat
;
83
cr_ChecksumCtx
*
checksum_ctx
;
84
}
CR_FILE
;
85
86
#define CR_CW_ERR -1
92
const char *cr_compression_suffix(cr_CompressionType comtype);
93
99
cr_CompressionType
cr_detect_compression
(
const
char
* filename, GError **err);
100
108
#define cr_open(FILENAME, MODE, COMTYPE, ERR) \
109
cr_sopen(FILENAME, MODE, COMTYPE, NULL, ERR)
110
121
CR_FILE
*
cr_sopen
(
const
char
*filename,
122
cr_OpenMode
mode,
123
cr_CompressionType
comtype,
124
cr_ContentStat
*stat,
125
GError **err);
126
134
int
cr_read
(
CR_FILE
*cr_file,
void
*buffer,
unsigned
int
len, GError **err);
135
144
int
cr_write
(
CR_FILE
*cr_file,
145
const
void
*buffer,
146
unsigned
int
len,
147
GError **err);
148
155
int
cr_puts
(
CR_FILE
*cr_file,
const
char
*str, GError **err);
156
164
int
cr_printf
(GError **err,
CR_FILE
*cr_file,
const
char
*format, ...);
165
171
int
cr_close
(
CR_FILE
*cr_file, GError **err);
172
175
#ifdef __cplusplus
176
}
177
#endif
178
179
#endif
/* __C_CREATEREPOLIB_COMPRESSION_WRAPPER_H__ */
src
compression_wrapper.h
Generated on Wed Aug 14 2013 09:00:21 for createrepo_c library by
1.8.4