Mercury
mchecksum.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Argonne National Laboratory, Department of Energy,
3  *                    UChicago Argonne, LLC and The HDF Group.
4  * All rights reserved.
5  *
6  * The full copyright notice, including terms governing use, modification,
7  * and redistribution, is contained in the COPYING file that can be
8  * found at the root of the source code distribution tree.
9  */
10 
11 #ifndef MCHECKSUM_H
12 #define MCHECKSUM_H
13 
14 #include "mchecksum_config.h"
15 
16 typedef void *mchecksum_object_t;
17 
18 #define MCHECKSUM_OBJECT_NULL ((mchecksum_object_t)0)
19 
20 #define MCHECKSUM_NOFINALIZE 0
21 #define MCHECKSUM_FINALIZE 1
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
36 MCHECKSUM_EXPORT int
37 mchecksum_init(const char *hash_method, mchecksum_object_t *checksum);
38 
46 MCHECKSUM_EXPORT int
48 
56 MCHECKSUM_EXPORT int
58 
66 MCHECKSUM_EXPORT size_t
68 
84 MCHECKSUM_EXPORT int
85 mchecksum_get(mchecksum_object_t checksum, void *buf, size_t size, int finalize);
86 
96 MCHECKSUM_EXPORT int
97 mchecksum_update(mchecksum_object_t checksum, const void *data, size_t size);
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 #endif /* MCHECKSUM_H */
MCHECKSUM_EXPORT int mchecksum_update(mchecksum_object_t checksum, const void *data, size_t size)
Accumulates a partial checksum of the input data.
MCHECKSUM_EXPORT size_t mchecksum_get_size(mchecksum_object_t checksum)
Get size of checksum.
void * mchecksum_object_t
Definition: mchecksum.h:16
MCHECKSUM_EXPORT int mchecksum_reset(mchecksum_object_t checksum)
Reset the checksum.
MCHECKSUM_EXPORT int mchecksum_init(const char *hash_method, mchecksum_object_t *checksum)
Initialize the checksum with the specified hash method.
MCHECKSUM_EXPORT int mchecksum_destroy(mchecksum_object_t checksum)
Destroy the checksum.
MCHECKSUM_EXPORT int mchecksum_get(mchecksum_object_t checksum, void *buf, size_t size, int finalize)
Get checksum and copy it into buf.