aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-utils.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-03-01 02:16:02 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-03-01 02:16:02 +0800
commit4321d72d9ba3e58e4ab05a75dc4beeb16246a392 (patch)
tree41c05185abe98030044f806820203dec34bf50b6 /camel/camel-mime-utils.c
parent27a5d50b233a2d780e6bc5866ae2daf55f3be8e9 (diff)
downloadgsoc2013-evolution-4321d72d9ba3e58e4ab05a75dc4beeb16246a392.tar
gsoc2013-evolution-4321d72d9ba3e58e4ab05a75dc4beeb16246a392.tar.gz
gsoc2013-evolution-4321d72d9ba3e58e4ab05a75dc4beeb16246a392.tar.bz2
gsoc2013-evolution-4321d72d9ba3e58e4ab05a75dc4beeb16246a392.tar.lz
gsoc2013-evolution-4321d72d9ba3e58e4ab05a75dc4beeb16246a392.tar.xz
gsoc2013-evolution-4321d72d9ba3e58e4ab05a75dc4beeb16246a392.tar.zst
gsoc2013-evolution-4321d72d9ba3e58e4ab05a75dc4beeb16246a392.zip
Added camel-sasl*.[c,h] to the build.
2001-02-28 Jeffrey Stedfast <fejj@ximian.com> * Makefile.am: Added camel-sasl*.[c,h] to the build. * camel-sasl.[c,h]: new "abstract" SASL class * camel-sasl-kerberos4.[c,h]: new SASL class for KERBEROS_V4 * camel-sasl-cram-md5.[c,h]: new SASL class for CRAM-MD5 * camel-sasl-plain.[c,h]: new SASL class for PLAIN * providers/imap/camel-imap-auth.c: Removed the base64 functions. * camel-mime-utils.c (base64_encode_simple): Moved here from camel-imap-auth.c (base64_decode_simple): Same. svn path=/trunk/; revision=8428
Diffstat (limited to 'camel/camel-mime-utils.c')
-rw-r--r--camel/camel-mime-utils.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 10d2c99001..49dce438e1 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -465,6 +465,30 @@ base64_decode_step(unsigned char *in, int len, unsigned char *out, int *state, u
return outptr-out;
}
+char *
+base64_encode_simple (const char *data, int len)
+{
+ unsigned char *out;
+ int state = 0, outlen;
+ unsigned int save = 0;
+
+ out = g_malloc (len * 4 / 3 + 5);
+ outlen = base64_encode_close ((unsigned char *)data, len, FALSE,
+ out, &state, &save);
+ out[outlen] = '\0';
+ return (char *)out;
+}
+
+int
+base64_decode_simple (char *data, int len)
+{
+ int state = 0;
+ unsigned int save = 0;
+
+ return base64_decode_step ((unsigned char *)data, len,
+ (unsigned char *)data, &state, &save);
+}
+
/**
* uudecode_step: uudecode a chunk of data