cencode.h 788 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. cencode.h - c header for a base64 encoding algorithm
  3. This is part of the libb64 project, and has been placed in the public domain.
  4. For details, see http://sourceforge.net/projects/libb64
  5. */
  6. #ifndef BASE64_CENCODE_H
  7. #define BASE64_CENCODE_H
  8. #ifdef _WIN32
  9. #pragma warning(disable : 4127 )
  10. #endif // _WIN32
  11. typedef enum
  12. {
  13. step_A, step_B, step_C
  14. } base64_encodestep;
  15. typedef struct
  16. {
  17. base64_encodestep step;
  18. char result;
  19. int stepcount;
  20. } base64_encodestate;
  21. void base64_init_encodestate(base64_encodestate* state_in);
  22. char base64_encode_value(char value_in);
  23. int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in);
  24. int base64_encode_blockend(char* code_out, base64_encodestate* state_in);
  25. #endif /* BASE64_CENCODE_H */