summaryrefslogtreecommitdiff
path: root/textcode.h
diff options
context:
space:
mode:
authorFelix von Leitner <felix-libowfat@fefe.de>2016-02-28 12:26:05 +0000
committerFelix von Leitner <felix-libowfat@fefe.de>2016-02-28 12:26:05 +0000
commitfd2ad91adf66c82a025ff5f3584fc49b465aaa85 (patch)
treeb3c35c6c5d97bd1ef68424eca0aa176cedc8bd0e /textcode.h
parent4aee13bc9e9bd76fd0cf2296b12de5a417cc4588 (diff)
downloadlibowfat-fd2ad91adf66c82a025ff5f3584fc49b465aaa85.tar.gz
libowfat-fd2ad91adf66c82a025ff5f3584fc49b465aaa85.zip
add base64url support (forgot header)
compile byte/* with -O3
Diffstat (limited to 'textcode.h')
-rw-r--r--textcode.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/textcode.h b/textcode.h
index 2bb1132..71829fe 100644
--- a/textcode.h
+++ b/textcode.h
@@ -15,6 +15,7 @@ extern "C" {
size_t fmt_uuencoded(char* dest,const char* src,size_t len);
/* Needs len/3*4 bytes */
size_t fmt_base64(char* dest,const char* src,size_t len);
+size_t fmt_base64url(char* dest,const char* src,size_t len);
/* Worst case: len*3 */
size_t fmt_quotedprintable(char* dest,const char* src,size_t len);
/* Worst case: len*3 */
@@ -59,6 +60,7 @@ size_t fmt_base85(char* dest,const char* src,size_t len);
* should be able to hold strlen(src) bytes as a rule of thumb. */
size_t scan_uuencoded(const char* src,char* dest,size_t* destlen);
size_t scan_base64(const char* src,char* dest,size_t* destlen);
+size_t scan_base64url(const char* src,char* dest,size_t* destlen);
size_t scan_quotedprintable(const char* src,char* dest,size_t* destlen);
size_t scan_urlencoded(const char* src,char* dest,size_t* destlen);
size_t scan_urlencoded2(const char* src,char* dest,size_t* destlen);
@@ -93,6 +95,7 @@ size_t scan_to_sa(size_t (*func)(const char*,char*,size_t*),
#define fmt_uuencoded_sa(sa,src,len) fmt_to_sa(fmt_uuencoded,sa,src,len)
#define fmt_base64_sa(sa,src,len) fmt_to_sa(fmt_base64,sa,src,len)
+#define fmt_base64url_sa(sa,src,len) fmt_to_sa(fmt_base64url,sa,src,len)
#define fmt_quotedprintable_sa(sa,src,len) fmt_to_sa(fmt_quotedprintable,sa,src,len)
#define fmt_urlencoded_sa(sa,src,len) fmt_to_sa(fmt_urlencoded,sa,src,len)
#define fmt_yenc_sa(sa,src,len) fmt_to_sa(fmt_yenc,sa,src,len)
@@ -108,6 +111,7 @@ size_t scan_to_sa(size_t (*func)(const char*,char*,size_t*),
#define scan_uuencoded_sa(src,sa) scan_to_sa(scan_uuencoded,src,sa)
#define scan_base64_sa(src,sa) scan_to_sa(scan_base64,src,sa)
+#define scan_base64url_sa(src,sa) scan_to_sa(scan_base64url,src,sa)
#define scan_quotedprintable_sa(src,sa) scan_to_sa(scan_quotedprintable,src,sa)
#define scan_urlencoded_sa(src,sa) scan_to_sa(scan_urlencoded,src,sa)
#define scan_yenc_sa(src,sa) scan_to_sa(scan_yenc,src,sa)
@@ -139,6 +143,7 @@ size_t scan_tofrom_array(size_t (*func)(const char*,char*,size_t*),
#endif
extern const char base64[64];
+extern const char base64url[64];
#ifdef __cplusplus
}