ARX
1.2.0
The next-generation open source augmented reality toolkit.
Toggle main menu visibility
Loading...
Searching...
No Matches
Source
ARX
ARUtil
uuid
uuid_sha1.h
Go to the documentation of this file.
1
/*
2
** OSSP uuid - Universally Unique Identifier
3
** Copyright (c) 2004-2008 Ralf S. Engelschall <
[email protected]
>
4
** Copyright (c) 2004-2008 The OSSP Project <http://www.ossp.org/>
5
**
6
** This file is part of OSSP uuid, a library for the generation
7
** of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
8
**
9
** Permission to use, copy, modify, and distribute this software for
10
** any purpose with or without fee is hereby granted, provided that
11
** the above copyright notice and this permission notice appear in all
12
** copies.
13
**
14
** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
15
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16
** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17
** IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
18
** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21
** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
24
** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25
** SUCH DAMAGE.
26
**
27
** uuid_sha1.h: SHA-1 API definition
28
*/
29
30
#ifndef __SHA1_H___
31
#define __SHA1_H___
32
33
#include <stddef.h>
/* size_t */
34
35
#ifdef __cplusplus
36
extern
"C"
{
37
#endif
38
39
//#define SHA1_PREFIX uuid_
40
41
/* embedding support */
42
#ifdef SHA1_PREFIX
43
#define __SHA1_CONCAT(x,y) x ## y
44
#define SHA1_CONCAT(x,y) __SHA1_CONCAT(x,y)
45
#define sha1_st SHA1_CONCAT(SHA1_PREFIX,sha1_st)
46
#define sha1_t SHA1_CONCAT(SHA1_PREFIX,sha1_t)
47
#define sha1_create SHA1_CONCAT(SHA1_PREFIX,sha1_create)
48
#define sha1_init SHA1_CONCAT(SHA1_PREFIX,sha1_init)
49
#define sha1_update SHA1_CONCAT(SHA1_PREFIX,sha1_update)
50
#define sha1_store SHA1_CONCAT(SHA1_PREFIX,sha1_store)
51
#define sha1_format SHA1_CONCAT(SHA1_PREFIX,sha1_format)
52
#define sha1_destroy SHA1_CONCAT(SHA1_PREFIX,sha1_destroy)
53
#endif
54
55
struct
sha1_st
;
56
typedef
struct
sha1_st
sha1_t
;
57
58
#define SHA1_LEN_BIN 20
59
#define SHA1_LEN_STR 40
60
61
typedef
enum
{
62
SHA1_RC_OK
= 0,
63
SHA1_RC_ARG
= 1,
64
SHA1_RC_MEM
= 2,
65
SHA1_RC_INT
= 3
66
}
sha1_rc_t
;
67
68
extern
sha1_rc_t
sha1_create
(
sha1_t
**
sha1
);
69
extern
sha1_rc_t
sha1_init
(
sha1_t
*
sha1
);
70
extern
sha1_rc_t
sha1_update
(
sha1_t
*
sha1
,
const
void
*data_ptr,
size_t
data_len);
71
extern
sha1_rc_t
sha1_store
(
sha1_t
*
sha1
,
void
**data_ptr,
size_t
*data_len);
72
extern
sha1_rc_t
sha1_format
(
sha1_t
*
sha1
,
char
**data_ptr,
size_t
*data_len);
73
extern
sha1_rc_t
sha1_destroy
(
sha1_t
*
sha1
);
74
75
#ifdef __cplusplus
76
}
77
#endif
78
79
#endif
/* __SHA1_H___ */
80
sha1
int sha1(const char *filePath, char sha1[41])
Definition
file_utils.c:812
sha1_st
Definition
uuid_sha1.c:321
sha1_format
sha1_rc_t sha1_format(sha1_t *sha1, char **data_ptr, size_t *data_len)
Definition
uuid_sha1.c:379
sha1_update
sha1_rc_t sha1_update(sha1_t *sha1, const void *data_ptr, size_t data_len)
Definition
uuid_sha1.c:345
sha1_init
sha1_rc_t sha1_init(sha1_t *sha1)
Definition
uuid_sha1.c:336
sha1_store
sha1_rc_t sha1_store(sha1_t *sha1, void **data_ptr, size_t *data_len)
Definition
uuid_sha1.c:354
sha1_create
sha1_rc_t sha1_create(sha1_t **sha1)
Definition
uuid_sha1.c:325
sha1_destroy
sha1_rc_t sha1_destroy(sha1_t *sha1)
Definition
uuid_sha1.c:417
sha1_rc_t
sha1_rc_t
Definition
uuid_sha1.h:61
SHA1_RC_INT
@ SHA1_RC_INT
Definition
uuid_sha1.h:65
SHA1_RC_OK
@ SHA1_RC_OK
Definition
uuid_sha1.h:62
SHA1_RC_ARG
@ SHA1_RC_ARG
Definition
uuid_sha1.h:63
SHA1_RC_MEM
@ SHA1_RC_MEM
Definition
uuid_sha1.h:64
sha1_t
struct sha1_st sha1_t
Definition
uuid_sha1.h:56
Generated on
for ARX by
1.18.0