blob: f05439237b1eb45995fe9a237d47a74178128442 [file] [log] [blame]
Alexandre Lision7fd5d3d2013-12-04 13:06:40 -05001/*
2cencode.h - c header for a base64 encoding algorithm
3
4This is part of the libb64 project, and has been placed in the public domain.
5For details, see http://sourceforge.net/projects/libb64
6*/
7
8#ifndef BASE64_CENCODE_H
9#define BASE64_CENCODE_H
10
11#include <stdint.h>
12
13#if defined(__cplusplus)
14extern "C"
15{
16#endif
17
18typedef enum
19{
20 step_A, step_B, step_C
21} base64_encodestep;
22
23typedef struct
24{
25 base64_encodestep step;
26 char result;
27 int stepcount;
28 int lineLength;
29} base64_encodestate;
30
31void base64_init_encodestate(base64_encodestate* state_in, int lineLength);
32
33char base64_encode_value(const int8_t value_in);
34
35int base64_encode_block(const uint8_t *plaintext_in, int length_in, char* code_out, base64_encodestate* state_in);
36
37int base64_encode_blockend(char *code_out, base64_encodestate* state_in);
38#if defined(__cplusplus)
39}
40#endif
41
42#endif /* BASE64_CENCODE_H */