base64.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*====================================================================*
  2. *
  3. * base64.h - base64 encode/decode definitions and declarations;
  4. *
  5. * Motley Tools by Charles Maier;
  6. * Copyright 2001-2006 by Charles Maier Associates;
  7. * Licensed under the Internet Software Consortium License;
  8. *
  9. *--------------------------------------------------------------------*/
  10. #ifndef BASE64_HEADER
  11. #define BASE64_HEADER
  12. /*====================================================================*
  13. *
  14. *--------------------------------------------------------------------*/
  15. #include <unistd.h>
  16. #include <stdio.h>
  17. /*====================================================================*
  18. * constants;
  19. *--------------------------------------------------------------------*/
  20. #define BASE64_CHARSET "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
  21. #define BASE64_BYTEMASK 0xFF
  22. #define BASE64_CHARMASK 0x3F
  23. #define BASE64_WORDSIZE 32
  24. #define BASE64_BYTESIZE 8
  25. #define BASE64_CHARSIZE 6
  26. /*====================================================================*
  27. * encode/decode functions;
  28. *--------------------------------------------------------------------*/
  29. void b64dump (void const * memory, size_t extent, size_t column, FILE *fp);
  30. /*====================================================================*
  31. *
  32. *--------------------------------------------------------------------*/
  33. #endif