00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __C_CREATEREPOLIB_CHECKSUM_H__
00021 #define __C_CREATEREPOLIB_CHECKSUM_H__
00022
00023 #include <glib.h>
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00036 typedef struct _cr_ChecksumCtx cr_ChecksumCtx;
00037
00043 typedef enum {
00044 CR_CHECKSUM_UNKNOWN,
00045
00046 CR_CHECKSUM_MD5,
00047 CR_CHECKSUM_SHA,
00048 CR_CHECKSUM_SHA1,
00049 CR_CHECKSUM_SHA224,
00050 CR_CHECKSUM_SHA256,
00051 CR_CHECKSUM_SHA384,
00052 CR_CHECKSUM_SHA512,
00053 CR_CHECKSUM_SENTINEL,
00054 } cr_ChecksumType;
00055
00061 const char *cr_checksum_name_str(cr_ChecksumType type);
00062
00067 cr_ChecksumType cr_checksum_type(const char *name);
00068
00076 char *cr_checksum_file(const char *filename,
00077 cr_ChecksumType type,
00078 GError **err);
00079
00085 cr_ChecksumCtx *cr_checksum_new(cr_ChecksumType type, GError **err);
00086
00094 int cr_checksum_update(cr_ChecksumCtx *ctx,
00095 const void *buf,
00096 size_t len,
00097 GError **err);
00098
00105 char *cr_checksum_final(cr_ChecksumCtx *ctx, GError **err);
00106
00109 #ifdef __cplusplus
00110 }
00111 #endif
00112
00113 #endif