aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base64.h
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-10-15 11:41:12 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2006-10-15 11:41:12 +0200
commit69cb62335f8bbe46b2879aabc5fdbe288891b02b (patch)
tree38fcda3162027d741598536c28a2c0cd4c3f52c6 /lib/base64.h
parent695e39232324711816f1db8e25fdba59a0c6456f (diff)
parente97827bee83d3a0663aa284e72a4f6c84b4b4dfe (diff)
Merging with storage-xml. It seems to be working pretty well, so maybe
this way more people will test it. :-)
Diffstat (limited to 'lib/base64.h')
-rw-r--r--lib/base64.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/base64.h b/lib/base64.h
new file mode 100644
index 00000000..570f2b14
--- /dev/null
+++ b/lib/base64.h
@@ -0,0 +1,33 @@
+/***************************************************************************\
+* *
+* BitlBee - An IRC to IM gateway *
+* Base64 handling functions. encode_real() is mostly based on the y64 en- *
+* coder from libyahoo2. Moving it to a new file because it's getting big. *
+* *
+* Copyright 2006 Wilmer van der Gaast <wilmer@gaast.net> *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License along *
+* with this program; if not, write to the Free Software Foundation, Inc., *
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
+* *
+\***************************************************************************/
+
+#include <glib.h>
+#include <gmodule.h>
+
+G_MODULE_EXPORT char *tobase64( const char *text );
+G_MODULE_EXPORT char *base64_encode( const char *in, int len );
+G_MODULE_EXPORT int base64_encode_real( const unsigned char *in, int inlen, unsigned char *out, const char *b64digits );
+G_MODULE_EXPORT char *frombase64( const char *in );
+G_MODULE_EXPORT int base64_decode( const char *in, unsigned char **out );
+G_MODULE_EXPORT int base64_decode_real( const unsigned char *in, unsigned char *out, char *b64reverse );