summaryrefslogtreecommitdiff
path: root/textcode.h
diff options
context:
space:
mode:
authorFelix von Leitner <felix-libowfat@fefe.de>2003-02-27 17:23:14 +0000
committerFelix von Leitner <felix-libowfat@fefe.de>2003-02-27 17:23:14 +0000
commit23247995b1b1f0a37f9811071f8fd3e4ed3dacfc (patch)
treef29a8e9edda336406d6bee4ff451897da9fa5fad /textcode.h
parent4d21334deebe5d31bd22de7cad3888ef216cb200 (diff)
downloadlibowfat-23247995b1b1f0a37f9811071f8fd3e4ed3dacfc.tar.gz
libowfat-23247995b1b1f0a37f9811071f8fd3e4ed3dacfc.zip
add stralloc versions of textcode (Kai Ruemmler)
Diffstat (limited to 'textcode.h')
-rw-r--r--textcode.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/textcode.h b/textcode.h
index 1e66bfe..1fb6ad2 100644
--- a/textcode.h
+++ b/textcode.h
@@ -20,6 +20,30 @@ unsigned int scan_urlencoded(const char *src,char *dest,unsigned int *destlen);
unsigned int scan_yenc(const char *src,char *dest,unsigned int *destlen);
unsigned int scan_hexdump(const char *src,char *dest,unsigned int *destlen);
+#ifdef STRALLOC_H
+/* These take len bytes from src and write them in encoded form to sa.
+ * As the stralloc_* functions do, 1
+ * is returned. If they run out of memory, sa contains the bytes already
+ * written and 0 is returned. */
+int fmt_quotedprintable_sa(stralloc *sa,const char* src,unsigned int len);
+int fmt_base64_sa(stralloc *sa,const char* src,unsigned int len);
+int fmt_uuencoded_sa(stralloc *sa,const char* src,unsigned int len);
+int fmt_urlencoded_sa(stralloc *sa,const char* src,unsigned int len);
+int fmt_yenc_sa(stralloc *sa,const char* src,unsigned int len);
+int fmt_hexdump_sa(stralloc *sa,const char* src,unsigned int len);
+
+/* These read one line from src, decoded it, and write the result to
+ * sa. As the stralloc_* functions do, 1
+ * is returned. If they run out of memory, sa contains the bytes already
+ * written and 0 is returned. */
+int scan_base64_sa(const char *src,stralloc* sa);
+int scan_quotedprintable_sa(const char *src,stralloc* sa);
+int scan_uuencoded_sa(const char *src,stralloc *sa);
+int scan_urlencoded_sa(const char *src,stralloc *sa);
+int scan_yenc_sa(const char *src,stralloc *sa);
+int scan_hexdump_sa(const char *src,stralloc *sa);
+#endif
+
extern const char base64[64];
#endif