/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
126.1.1 by Gustav Hartvigsson
* Using
1
#pragma once
89 by Gustav Hartvigsson
* Started working on Threads
2
3
#include "defs.h"
138 by Gustav Hartvigsson
* Fixed s_base_16_enc
4
#include "utils.h"
89 by Gustav Hartvigsson
* Started working on Threads
5
110 by Gustav Hartvigsson
* added S_ prifix to my macros. I should not be a scrub.
6
S_BEGIN_DECLS
89 by Gustav Hartvigsson
* Started working on Threads
7
8
/**
9
 * @file
92 by Gustav Hartvigsson
* Woops.
10
 * @defgroup BaseN BaseN
11
 * @addtogroup BaseN
89 by Gustav Hartvigsson
* Started working on Threads
12
 * @{
13
 * https://tools.ietf.org/html/rfc4648
14
 */
15
16
/**
17
 * Encode a Byte array to a Base16 string.
18
 */
119 by Gustav Hartvigsson
* added S_EXPERTED to public functions.
19
S_EXPORTED
89 by Gustav Hartvigsson
* Started working on Threads
20
schar *
138 by Gustav Hartvigsson
* Fixed s_base_16_enc
21
s_base_16_enc (const sbyte * input_data,
100 by Gustav Hartvigsson
* Fixed README.
22
               size_t in_len,
23
               size_t * out_len);
89 by Gustav Hartvigsson
* Started working on Threads
24
25
/**
26
 * Decode a base16 encoded string into a Byte array.
27
 */
119 by Gustav Hartvigsson
* added S_EXPERTED to public functions.
28
S_EXPORTED
89 by Gustav Hartvigsson
* Started working on Threads
29
sbyte *
138 by Gustav Hartvigsson
* Fixed s_base_16_enc
30
s_base_16_dec (const schar * base16_str,
100 by Gustav Hartvigsson
* Fixed README.
31
               size_t in_len,
32
               size_t * out_len);
89 by Gustav Hartvigsson
* Started working on Threads
33
34
/**
161 by Gustav Hartvigsson
Base16[enc,dec] - Can now create byte arrays of fixed size.
35
 * Decode a base16 string into a byte array of a fixed size.
36
 */
37
S_EXPORTED
38
sbyte *
39
s_base_16_dec_size (const schar * base16_str,
40
                    size_t in_len,
41
                    size_t out_len);
42
43
/**
89 by Gustav Hartvigsson
* Started working on Threads
44
 * Encode a Byte array to a Base16 string.
45
 */
119 by Gustav Hartvigsson
* added S_EXPERTED to public functions.
46
S_EXPORTED
89 by Gustav Hartvigsson
* Started working on Threads
47
schar *
138 by Gustav Hartvigsson
* Fixed s_base_16_enc
48
s_base_32_enc (const sbyte * input_data,
100 by Gustav Hartvigsson
* Fixed README.
49
               size_t in_len,
50
               size_t * out_len);
89 by Gustav Hartvigsson
* Started working on Threads
51
52
/**
90 by Gustav Hartvigsson
* Macros were wrong.
53
 * Decode a base32 encoded string into a Byte array.
89 by Gustav Hartvigsson
* Started working on Threads
54
 */
162 by Gustav Hartvigsson
* stuff to do with the unfinished base32 implementation.
55
S_EXPORTED
89 by Gustav Hartvigsson
* Started working on Threads
56
sbyte *
138 by Gustav Hartvigsson
* Fixed s_base_16_enc
57
s_base_32_dec (const schar * base32_str,
100 by Gustav Hartvigsson
* Fixed README.
58
               size_t in_len,
59
               size_t * out_len);
89 by Gustav Hartvigsson
* Started working on Threads
60
162 by Gustav Hartvigsson
* stuff to do with the unfinished base32 implementation.
61
/**
62
 * Decode a base32 encoded string into a Byte array of fixed size.
63
 */
64
S_EXPORTED
65
sbyte *
66
s_base_32_dec_size (const schar * base32_str,
67
                    size_t in_len,
68
                    size_t out_len);
69
161 by Gustav Hartvigsson
Base16[enc,dec] - Can now create byte arrays of fixed size.
70
89 by Gustav Hartvigsson
* Started working on Threads
71
/**
90 by Gustav Hartvigsson
* Macros were wrong.
72
 * Encode a Byte array to a Base32 Hex (Extended hex) string.
89 by Gustav Hartvigsson
* Started working on Threads
73
 */
119 by Gustav Hartvigsson
* added S_EXPERTED to public functions.
74
S_EXPORTED
89 by Gustav Hartvigsson
* Started working on Threads
75
schar *
138 by Gustav Hartvigsson
* Fixed s_base_16_enc
76
s_base_32_hex_enc (const sbyte * input_data,
100 by Gustav Hartvigsson
* Fixed README.
77
                   size_t in_len,
78
                   size_t * out_len);
89 by Gustav Hartvigsson
* Started working on Threads
79
80
/**
90 by Gustav Hartvigsson
* Macros were wrong.
81
 * Decode a base32 Hex (Extended hex) encoded string into a Byte array.
89 by Gustav Hartvigsson
* Started working on Threads
82
 */
119 by Gustav Hartvigsson
* added S_EXPERTED to public functions.
83
S_EXPORTED
89 by Gustav Hartvigsson
* Started working on Threads
84
sbyte *
138 by Gustav Hartvigsson
* Fixed s_base_16_enc
85
s_base_32_hex_dec (const schar * base32_str,
100 by Gustav Hartvigsson
* Fixed README.
86
                   size_t in_len,
87
                   size_t * out_len);
89 by Gustav Hartvigsson
* Started working on Threads
88
89
/**
90 by Gustav Hartvigsson
* Macros were wrong.
90
 * Encode a Byte array to a Base64 string.
89 by Gustav Hartvigsson
* Started working on Threads
91
 */
119 by Gustav Hartvigsson
* added S_EXPERTED to public functions.
92
S_EXPORTED
89 by Gustav Hartvigsson
* Started working on Threads
93
schar *
138 by Gustav Hartvigsson
* Fixed s_base_16_enc
94
s_base_64_enc (const sbyte * input_data,
100 by Gustav Hartvigsson
* Fixed README.
95
               size_t in_len,
96
               size_t * out_len);
89 by Gustav Hartvigsson
* Started working on Threads
97
98
/**
90 by Gustav Hartvigsson
* Macros were wrong.
99
 * Decode a base64 encoded string into a Byte array.
100
 */
119 by Gustav Hartvigsson
* added S_EXPERTED to public functions.
101
S_EXPORTED
90 by Gustav Hartvigsson
* Macros were wrong.
102
sbyte *
138 by Gustav Hartvigsson
* Fixed s_base_16_enc
103
s_base_64_dec (const schar * base64_str,
100 by Gustav Hartvigsson
* Fixed README.
104
               size_t in_len,
105
               size_t * out_len);
90 by Gustav Hartvigsson
* Macros were wrong.
106
107
/**
108
 * Encode a byte array into a URI safe Base64 string.
109
 */
119 by Gustav Hartvigsson
* added S_EXPERTED to public functions.
110
S_EXPORTED
90 by Gustav Hartvigsson
* Macros were wrong.
111
schar *
138 by Gustav Hartvigsson
* Fixed s_base_16_enc
112
s_base_64_safe_enc (const sbyte * input_data,
100 by Gustav Hartvigsson
* Fixed README.
113
                    size_t in_len,
114
                    size_t * out_len);
90 by Gustav Hartvigsson
* Macros were wrong.
115
116
/**
117
 * Decode a URI safe Base64 string into a byte array.
118
 */
119 by Gustav Hartvigsson
* added S_EXPERTED to public functions.
119
S_EXPORTED
90 by Gustav Hartvigsson
* Macros were wrong.
120
sbyte *
138 by Gustav Hartvigsson
* Fixed s_base_16_enc
121
s_base_64_safe_dec (const schar * base64_str,
100 by Gustav Hartvigsson
* Fixed README.
122
                    size_t in_len,
123
                    size_t * out_len);
90 by Gustav Hartvigsson
* Macros were wrong.
124
125
89 by Gustav Hartvigsson
* Started working on Threads
126
127
/**
128
 * @}
129
 */
130
110 by Gustav Hartvigsson
* added S_ prifix to my macros. I should not be a scrub.
131
S_END_DECLS