From a8c30b898c2e4dec02c75a25e72c211d9dba473d Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Mon, 3 Dec 2018 23:05:01 -0500 Subject: Implement base64 encoding Will be used for SASL authentication. --- chat.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'chat.h') diff --git a/chat.h b/chat.h index b6411d7..6c1cf0f 100644 --- a/chat.h +++ b/chat.h @@ -30,6 +30,8 @@ #define err(...) do { uiHide(); err(__VA_ARGS__); } while (0) #define errx(...) do { uiHide(); errx(__VA_ARGS__); } while (0) +typedef unsigned char byte; + struct { char *host; char *port; @@ -193,6 +195,7 @@ char *awcstombs(const wchar_t *src); char *awcsntombs(const wchar_t *src, size_t nwc); int vaswprintf(wchar_t **ret, const wchar_t *format, va_list ap); int aswprintf(wchar_t **ret, const wchar_t *format, ...); +char *base64(const byte *src, size_t len); // HACK: clang won't check wchar_t *format strings. #ifdef NDEBUG -- cgit 1.4.1-2-gfad0