diff common/strhelp.h @ 160:bf4bfd8843bd

Add memory allocating base64 decode function
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 25 Mar 2014 10:07:12 +0000
parents c719d3fdbc15
children 1f44aae4528e
line wrap: on
line diff
--- a/common/strhelp.h	Tue Mar 25 10:06:30 2014 +0000
+++ b/common/strhelp.h	Tue Mar 25 10:07:12 2014 +0000
@@ -75,4 +75,19 @@
  */
 bool str_trim (char **s);
 
+/** @brief decode base64 encoded data
+ *
+ * The memory allocated for dest needs to be free'd by the
+ * caller.
+ *
+ * @param [out] dst Pointer to the destination. Needs to be NULL
+ * @param [out] dst_size Size allocated for the destination.
+ * @param [in] src Pointer to the base64 encoded data.
+ * @param [in] src_size Size of the encoded data.
+ *
+ * @returns 0 on success a polarssl error or -1 otherwise
+ */
+int str_base64_decode(char **dst, size_t *dst_size, char *src,
+                      size_t src_size);
+
 #endif

http://wald.intevation.org/projects/trustbridge/