createrepo_c library
1.2.3
C library for metadata manipulation
Toggle main menu visibility
Loading...
Searching...
No Matches
checksum.h
1
/* createrepo_c - Library of routines for manipulation with repodata
2
* Copyright (C) 2013 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_CHECKSUM_H__
21
#define __C_CREATEREPOLIB_CHECKSUM_H__
22
23
#include <glib.h>
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
33
36
typedef
struct
_cr_ChecksumCtx
cr_ChecksumCtx
;
37
43
typedef
enum
{
44
CR_CHECKSUM_UNKNOWN
= 0,
45
CR_CHECKSUM_MD5
= 1,
46
#ifdef WITH_LEGACY_HASHES
47
CR_CHECKSUM_SHA = 2,
48
CR_CHECKSUM_SHA1 = 3,
49
#endif
50
CR_CHECKSUM_SHA224
= 4,
51
CR_CHECKSUM_SHA256
= 5,
52
CR_CHECKSUM_SHA384
= 6,
53
CR_CHECKSUM_SHA512
= 7,
54
CR_CHECKSUM_SENTINEL
= 8,
55
}
cr_ChecksumType
;
56
62
const
char
*
cr_checksum_name_str
(
cr_ChecksumType
type);
63
68
cr_ChecksumType
cr_checksum_type
(
const
char
*name);
69
74
size_t
cr_checksum_raw_size
(
cr_ChecksumType
type);
75
83
char
*
cr_checksum_file
(
const
char
*filename,
84
cr_ChecksumType
type,
85
GError **err);
86
92
cr_ChecksumCtx
*
cr_checksum_new
(
cr_ChecksumType
type, GError **err);
93
101
int
cr_checksum_update
(
cr_ChecksumCtx
*ctx,
102
const
void
*buf,
103
size_t
len,
104
GError **err);
105
112
char
*
cr_checksum_final
(
cr_ChecksumCtx
*ctx, GError **err);
113
120
size_t
cr_checksum_final_raw
(
cr_ChecksumCtx
*ctx,
unsigned
char
*raw_checksum, GError **err);
121
123
124
#ifdef __cplusplus
125
}
126
#endif
127
128
#endif
/* __C_CREATEREPOLIB_XML_PARSER_H__ */
cr_checksum_update
int cr_checksum_update(cr_ChecksumCtx *ctx, const void *buf, size_t len, GError **err)
cr_checksum_final_raw
size_t cr_checksum_final_raw(cr_ChecksumCtx *ctx, unsigned char *raw_checksum, GError **err)
cr_ChecksumType
cr_ChecksumType
Definition
checksum.h:43
cr_checksum_type
cr_ChecksumType cr_checksum_type(const char *name)
cr_checksum_new
cr_ChecksumCtx * cr_checksum_new(cr_ChecksumType type, GError **err)
cr_checksum_file
char * cr_checksum_file(const char *filename, cr_ChecksumType type, GError **err)
cr_checksum_final
char * cr_checksum_final(cr_ChecksumCtx *ctx, GError **err)
cr_ChecksumCtx
struct _cr_ChecksumCtx cr_ChecksumCtx
Definition
checksum.h:36
cr_checksum_name_str
const char * cr_checksum_name_str(cr_ChecksumType type)
cr_checksum_raw_size
size_t cr_checksum_raw_size(cr_ChecksumType type)
CR_CHECKSUM_SHA224
@ CR_CHECKSUM_SHA224
Definition
checksum.h:50
CR_CHECKSUM_SENTINEL
@ CR_CHECKSUM_SENTINEL
Definition
checksum.h:54
CR_CHECKSUM_SHA384
@ CR_CHECKSUM_SHA384
Definition
checksum.h:52
CR_CHECKSUM_SHA512
@ CR_CHECKSUM_SHA512
Definition
checksum.h:53
CR_CHECKSUM_MD5
@ CR_CHECKSUM_MD5
Definition
checksum.h:45
CR_CHECKSUM_UNKNOWN
@ CR_CHECKSUM_UNKNOWN
Definition
checksum.h:44
CR_CHECKSUM_SHA256
@ CR_CHECKSUM_SHA256
Definition
checksum.h:51
src
checksum.h
Generated by
1.17.0