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 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026
00034 typedef struct _cr_ChecksumCtx cr_ChecksumCtx;
00035
00041 typedef enum {
00042 CR_CHECKSUM_UNKNOWN,
00043
00044 CR_CHECKSUM_MD5,
00045 CR_CHECKSUM_SHA,
00046 CR_CHECKSUM_SHA1,
00047 CR_CHECKSUM_SHA224,
00048 CR_CHECKSUM_SHA256,
00049 CR_CHECKSUM_SHA384,
00050 CR_CHECKSUM_SHA512,
00051 CR_CHECKSUM_SENTINEL,
00052 } cr_ChecksumType;
00053
00059 const char *cr_checksum_name_str(cr_ChecksumType type);
00060
00065 cr_ChecksumType cr_checksum_type(const char *name);
00066
00074 char *cr_checksum_file(const char *filename,
00075 cr_ChecksumType type,
00076 GError **err);
00077
00083 cr_ChecksumCtx *cr_checksum_new(cr_ChecksumType type, GError **err);
00084
00092 int cr_checksum_update(cr_ChecksumCtx *ctx,
00093 const void *buf,
00094 size_t len,
00095 GError **err);
00096
00103 char *cr_checksum_final(cr_ChecksumCtx *ctx, GError **err);
00104
00107 #ifdef __cplusplus
00108 }
00109 #endif
00110
00111 #endif