00001 /* 00002 cencode.h - c header for a base64 encoding algorithm 00003 00004 This is part of the libb64 project, and has been placed in the public domain. 00005 For details, see http://sourceforge.net/projects/libb64 00006 */ 00007 00008 #ifndef BASE64_CENCODE_H 00009 #define BASE64_CENCODE_H 00010 00011 typedef enum 00012 { 00013 step_A, step_B, step_C 00014 } base64_encodestep; 00015 00016 typedef struct 00017 { 00018 base64_encodestep step; 00019 char result; 00020 int stepcount; 00021 } base64_encodestate; 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 void base64_init_encodestate(base64_encodestate* state_in); 00028 00029 char base64_encode_value(char value_in); 00030 00031 int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in); 00032 00033 int base64_encode_blockend(char* code_out, base64_encodestate* state_in); 00034 00035 #ifdef __cplusplus 00036 } 00037 #endif 00038 #endif /* BASE64_CENCODE_H */