Base64.h
1 /*
2 cdecode.h - c header for a base64 decoding algorithm
3 
4 This is part of the libb64 project, and has been placed in the public domain.
5 For details, see http://sourceforge.net/projects/libb64
6 */
7 
8 #ifndef BASE64_H_MMR5NHB7
9 #define BASE64_H_MMR5NHB7
10 
11 #if defined(_WIN32) && !defined(USCXML_STATIC)
12 # ifdef USCXML_EXPORT
13 # define USCXML_API __declspec(dllexport)
14 # else
15 # define USCXML_API __declspec(dllimport)
16 # endif
17 #else
18 # define USCXML_API
19 #endif
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
26 
27 typedef enum {
28  step_a, step_b, step_c, step_d
29 }
30 base64_decodestep;
31 
32 typedef struct {
33  base64_decodestep step;
34  char plainchar;
36 
37 USCXML_API void base64_init_decodestate(base64_decodestate* state_in);
38 USCXML_API int base64_decode_value(char value_in);
39 USCXML_API int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in);
40 
42 
43 typedef enum {
44  step_A, step_B, step_C
45 } base64_encodestep;
46 
47 typedef struct {
48  base64_encodestep step;
49  char result;
50  int stepcount;
52 
53 USCXML_API void base64_init_encodestate(base64_encodestate* state_in);
54 USCXML_API char base64_encode_value(char value_in);
55 USCXML_API int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in);
56 USCXML_API int base64_encode_blockend(char* code_out, base64_encodestate* state_in);
57 
58 #ifdef __cplusplus
59 }
60 #endif
61 
62 
63 #endif /* end of include guard: BASE64_H_MMR5NHB7 */
Definition: Base64.h:32
Definition: Base64.h:47