You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB

  1. /* Copyright (C) 2003 MySQL AB
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; either version 2 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program; if not, write to the Free Software
  12. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
  13. #ifndef __BASE64_H_INCLUDED__
  14. #define __BASE64_H_INCLUDED__
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /*
  19. Calculate how much memory needed for dst of base64_encode()
  20. */
  21. int base64_needed_encoded_length(int length_of_data);
  22. /*
  23. Calculate how much memory needed for dst of base64_decode()
  24. */
  25. int base64_needed_decoded_length(int length_of_encoded_data);
  26. /*
  27. Encode data as a base64 string
  28. */
  29. int base64_encode(const void *src, size_t src_len, char *dst);
  30. /*
  31. Decode a base64 string into data
  32. */
  33. int base64_decode(const char *src, size_t src_len, void *dst);
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #endif /* !__BASE64_H_INCLUDED__ */