]> diplodocus.org Git - nmh/commitdiff
Beginning stubs to support base64 header encoding.
authorKen Hornstein <kenh@pobox.com>
Thu, 31 Oct 2013 15:51:52 +0000 (11:51 -0400)
committerKen Hornstein <kenh@pobox.com>
Thu, 31 Oct 2013 15:51:52 +0000 (11:51 -0400)
sbr/encode_rfc2047.c

index 33ed5d87cdb1b1e9ab8313a6001a0a9b6c747afa..2929db1c4527ae2a576e7e8212e264d3d3161075 100644 (file)
@@ -44,6 +44,7 @@ static char *address_headers[] = {
 static void unfold_header(char **, int);
 static int field_encode_address(const char *, char **, int, const char *);
 static int field_encode_quoted(const char *, char **, const char *, int, int);
+static int field_encode_base64(const char *, char **, const char *);
 static int utf8len(const char *);
 
 /*
@@ -126,10 +127,8 @@ encode_rfc2047(const char *name, char **value, int encoding,
 
     switch (encoding) {
 
-#if 0
     case CE_BASE64:
-       return field_encode_base64(name, value, encoding, charset);
-#endif
+       return field_encode_base64(name, value, charset);
 
     case CE_QUOTED:
        return field_encode_quoted(name, value, charset, asciicount,
@@ -142,7 +141,7 @@ encode_rfc2047(const char *name, char **value, int encoding,
 }
 
 /*
- * Encode our specified header using quoted-printable
+ * Encode our specified header (or field) using quoted-printable
  */
 
 static int
@@ -280,6 +279,19 @@ field_encode_quoted(const char *name, char **value, const char *charset,
     return 0;
 }
 
+/*
+ * Encode our specified header (or field) using base64.
+ *
+ * This is a little easier since every character gets encoded, we can
+ * calculate the line wrap up front.
+ */
+
+static int
+field_encode_base64(const char *name, char **value, const char *encoding)
+{
+    return 0;
+}
+
 /*
  * Calculate the length of a UTF-8 character.
  *