createrepo_c library
C library for metadata manipulation
Hlavní stránka
Moduly
Třídy
Soubory
Seznam souborů
Vše
Třídy
Funkce
Proměnné
Definice typů
Výčty
Hodnoty výčtu
Skupiny
Stránky
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
33
typedef
enum
{
34
CR_CW_AUTO_DETECT_COMPRESSION
,
35
CR_CW_UNKNOWN_COMPRESSION
,
36
CR_CW_NO_COMPRESSION
,
37
CR_CW_GZ_COMPRESSION
,
38
CR_CW_BZ2_COMPRESSION
,
39
CR_CW_XZ_COMPRESSION
,
40
}
cr_CompressionType
;
41
45
typedef
enum
{
46
CR_CW_MODE_READ
,
47
CR_CW_MODE_WRITE
48
}
cr_OpenMode
;
49
50
54
typedef
struct
{
55
cr_CompressionType
type
;
56
void
*
FILE
;
57
cr_OpenMode
mode
;
58
}
CR_FILE
;
59
61
#define CR_CW_OK 0
62
#define CR_CW_ERR -1
71
const char *cr_compression_suffix(cr_CompressionType comtype);
72
78
cr_CompressionType
cr_detect_compression
(
const
char
* filename);
79
87
CR_FILE
*
cr_open
(
const
char
*filename,
88
cr_OpenMode
mode,
89
cr_CompressionType
comtype);
90
98
int
cr_read
(
CR_FILE
*cr_file,
void
*buffer,
unsigned
int
len);
99
108
int
cr_write
(
CR_FILE
*cr_file,
const
void
*buffer,
unsigned
int
len);
109
116
int
cr_puts
(
CR_FILE
*cr_file,
const
char
*str);
117
125
int
cr_printf
(
CR_FILE
*cr_file,
const
char
*format, ...);
126
132
int
cr_close
(
CR_FILE
*cr_file);
133
134
#ifdef __cplusplus
135
}
136
#endif
137
138
#endif
/* __C_CREATEREPOLIB_COMPRESSION_WRAPPER_H__ */
src
compression_wrapper.h
Generováno pá 22. úno 2013 18.32:47 pro projekt createrepo_c library programem
1.8.1.1