diff options
| author | lishu <[email protected]> | 2018-12-05 19:26:56 +0800 |
|---|---|---|
| committer | lishu <[email protected]> | 2018-12-05 19:26:56 +0800 |
| commit | fe846caaa5a0fbfa417fba266b6192ae4c13aec0 (patch) | |
| tree | 42681bdd020f9ff7fb9954de9942d62b0c91beb7 /src/base64.h | |
create http project
Diffstat (limited to 'src/base64.h')
| -rw-r--r-- | src/base64.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/base64.h b/src/base64.h new file mode 100644 index 0000000..ea0f5b2 --- /dev/null +++ b/src/base64.h @@ -0,0 +1,38 @@ + +#ifndef H_HTTP_BASE64_H +#define H_HTTP_BASE64_H + + +/* Generate a mask of LENGTH one-bits, right justified in a word. */ +#define MASK(Length) ((unsigned) ~(~0 << (Length))) + +/* Indicate if CHARACTER holds into 7 bits. */ +#define IS_ASCII(Character) \ + (!((Character) & ~MASK (7))) + +/* Maximum number of characters per MIME line. */ +#define MIME_LINE_LENGTH 76 + +/* Tables declared in base64.c and also used in utf7.c. */ +extern char httpproxy_base64_value_to_char[64]; +extern int httpproxy_base64_char_to_value[128]; +extern char base64_charset[64]; + +/* Macros. */ +#define IS_BASE64(Character) \ + (IS_ASCII (Character) && httpproxy_base64_char_to_value[(int)(Character)] >= 0) + + +#ifdef __cplusplus +extern "C" { +#endif + +int http_proxy_base64_decode(int flag_quote,char *src_buf,int srclen, char *dest); + + +#ifdef __cplusplus +} +#endif + + +#endif // H_MIME_BASE64_H |
