/External/Mysql-5.0/include/base64.h

http://awoe.googlecode.com/ · C++ Header · 48 lines · 14 code · 8 blank · 26 comment · 0 complexity · 459107f81be61e5bc3b4f470dd0148e2 MD5 · raw file

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