[asterisk-commits] russell: trunk r58149 - /trunk/include/asterisk/utils.h

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Mar 6 16:58:38 MST 2007


Author: russell
Date: Tue Mar  6 17:58:38 2007
New Revision: 58149

URL: http://svn.digium.com/view/asterisk?view=rev&rev=58149
Log:
Add some documentation on the arguments to the base64 encode/decode functions.
(inspired by issue #9215)

Modified:
    trunk/include/asterisk/utils.h

Modified: trunk/include/asterisk/utils.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/utils.h?view=diff&rev=58149&r1=58148&r2=58149
==============================================================================
--- trunk/include/asterisk/utils.h (original)
+++ trunk/include/asterisk/utils.h Tue Mar  6 17:58:38 2007
@@ -161,7 +161,26 @@
 void ast_sha1_hash(char *output, char *input);
 
 int ast_base64encode_full(char *dst, const unsigned char *src, int srclen, int max, int linebreaks);
+
+/*!
+ * \brief Encode data in base64
+ * \param dst the destination buffer
+ * \param src the source data to be encoded
+ * \param srclen the number of bytes present in the source buffer
+ * \param max the maximum number of bytes to write into the destination
+ *        buffer, *including* the terminating NULL character.
+ */
 int ast_base64encode(char *dst, const unsigned char *src, int srclen, int max);
+
+/*!
+ * \brief Decode data from base64
+ * \param dst the destination buffer
+ * \param src the source buffer
+ * \param max The maximum number of bytes to write into the destination
+ *            buffer.  Note that this function will not ensure that the
+ *            destination buffer is NULL terminated.  So, in general,
+ *            this parameter should be sizeof(dst) - 1.
+ */
 int ast_base64decode(unsigned char *dst, const char *src, int max);
 
 /*!  \brief Turn text string to URI-encoded %XX version 



More information about the asterisk-commits mailing list