Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 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_CDECODE_H |
| 9 | #define BASE64_CDECODE_H |
| 10 | |
| 11 | #include <stdint.h> |
| 12 | |
| 13 | #if defined(__cplusplus) |
| 14 | extern "C" |
| 15 | { |
| 16 | #endif |
| 17 | |
| 18 | typedef enum |
| 19 | { |
| 20 | step_a, step_b, step_c, step_d |
| 21 | } base64_decodestep; |
| 22 | |
| 23 | typedef struct |
| 24 | { |
| 25 | base64_decodestep step; |
| 26 | char plainchar; |
| 27 | } base64_decodestate; |
| 28 | |
| 29 | void base64_init_decodestate(base64_decodestate* state_in); |
| 30 | |
| 31 | int base64_decode_value(char value_in); |
| 32 | |
| 33 | int base64_decode_block(const char* code_in, const int length_in, uint8_t *plaintext_out, base64_decodestate* state_in); |
| 34 | |
| 35 | #if defined(__cplusplus) |
| 36 | } |
| 37 | #endif |
| 38 | |
| 39 | #endif /* BASE64_CDECODE_H */ |