Commit 6b0c55b7 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a BASE64 class to VCT

parent 50a59f10
......@@ -47,6 +47,7 @@
#define VCT_TCHAR (1<<9)
#define VCT_ID (1<<10)
#define VCT_IDENT (VCT_ALPHA | VCT_DIGIT | VCT_ID)
#define VCT_BASE64 (1<<11)
#define VCT_VT (1<<12)
#define VCT_SPACE (VCT_LWS | VCT_VT)
#define VCT_UPPER (1<<13)
......@@ -75,6 +76,7 @@ vct_is(int x, uint16_t y)
#define vct_islower(x) vct_is(x, VCT_LOWER)
#define vct_isupper(x) vct_is(x, VCT_UPPER)
#define vct_isalnum(x) vct_is(x, VCT_ALPHA | VCT_DIGIT)
#define vct_isbase64(x) vct_is(x, VCT_BASE64)
#define vct_issep(x) vct_is(x, VCT_SEPARATOR)
#define vct_issepctl(x) vct_is(x, VCT_SEPARATOR | VCT_CTL)
#define vct_isident1(x) vct_isalpha(x)
......
......@@ -43,8 +43,8 @@
/* NB: VCT always operate in ASCII, don't replace 0x0d with \r etc. */
#define VCT_UPALPHA (VCT_ALPHA | VCT_UPPER)
#define VCT_LOALPHA (VCT_ALPHA | VCT_LOWER)
#define VCT_UPALPHA (VCT_ALPHA | VCT_UPPER | VCT_BASE64)
#define VCT_LOALPHA (VCT_ALPHA | VCT_LOWER | VCT_BASE64)
const uint16_t vct_typtab[256] = {
[0x00] = VCT_CTL,
......@@ -90,25 +90,25 @@ const uint16_t vct_typtab[256] = {
[0x28] = VCT_SEPARATOR,
[0x29] = VCT_SEPARATOR,
[0x2a] = VCT_TCHAR,
[0x2b] = VCT_TCHAR,
[0x2b] = VCT_TCHAR | VCT_BASE64,
[0x2c] = VCT_SEPARATOR,
[0x2d] = VCT_XMLNAME | VCT_TCHAR | VCT_ID,
[0x2e] = VCT_XMLNAME | VCT_TCHAR,
[0x2f] = VCT_SEPARATOR,
[0x30] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME,
[0x31] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME,
[0x32] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME,
[0x33] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME,
[0x34] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME,
[0x35] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME,
[0x36] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME,
[0x37] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME,
[0x38] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME,
[0x39] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME,
[0x2f] = VCT_SEPARATOR | VCT_BASE64,
[0x30] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME | VCT_BASE64,
[0x31] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME | VCT_BASE64,
[0x32] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME | VCT_BASE64,
[0x33] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME | VCT_BASE64,
[0x34] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME | VCT_BASE64,
[0x35] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME | VCT_BASE64,
[0x36] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME | VCT_BASE64,
[0x37] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME | VCT_BASE64,
[0x38] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME | VCT_BASE64,
[0x39] = VCT_DIGIT | VCT_HEX | VCT_XMLNAME | VCT_BASE64,
[0x3a] = VCT_SEPARATOR | VCT_XMLNAMESTART,
[0x3b] = VCT_SEPARATOR,
[0x3c] = VCT_SEPARATOR,
[0x3d] = VCT_SEPARATOR,
[0x3d] = VCT_SEPARATOR | VCT_BASE64,
[0x3e] = VCT_SEPARATOR,
[0x3f] = VCT_SEPARATOR,
[0x40] = VCT_SEPARATOR,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment