diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2003-04-28 01:28:08 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2003-04-28 01:28:08 -0400 |
commit | 03413d1c868839950b21fd0b10fa5f31fff83964 (patch) | |
tree | 69b5d38bd1d80a009b23a41cd40148e434e13e38 /src/LYStrings.c | |
parent | c812b42f4248ea1ab6641616f6aef08d402d9f92 (diff) | |
download | lynx-snapshots-03413d1c868839950b21fd0b10fa5f31fff83964.tar.gz |
snapshot of project "lynx", label v2-8-5dev_15
Diffstat (limited to 'src/LYStrings.c')
-rw-r--r-- | src/LYStrings.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/LYStrings.c b/src/LYStrings.c index 362dc497..e29f6495 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -5595,74 +5595,6 @@ PUBLIC char *LYSafeGets ARGS2( return result; } -#ifdef EXP_FILE_UPLOAD -static char basis_64[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -#define B64_LINE 76 - -PUBLIC void base64_encode ARGS3( - char *, dest, - char *, src, - int, len) -{ - int rlen; /* length of result string */ - unsigned char c1, c2, c3; - char *eol, *r, *str; - int eollen; - int chunk; - - str = src; - eol = "\n"; - eollen = 1; - - /* calculate the length of the result */ - rlen = (len+2) / 3 * 4; /* encoded bytes */ - if (rlen) { - /* add space for EOL */ - rlen += ((rlen-1) / B64_LINE + 1) * eollen; - } - - /* allocate a result buffer */ - r = dest; - - /* encode */ - for (chunk=0; len > 0; len -= 3, chunk++) { - if (chunk == (B64_LINE/4)) { - char *c = eol; - char *e = eol + eollen; - while (c < e) - *r++ = *c++; - chunk = 0; - } - c1 = *str++; - c2 = *str++; - *r++ = basis_64[c1>>2]; - *r++ = basis_64[((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)]; - if (len > 2) { - c3 = *str++; - *r++ = basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)]; - *r++ = basis_64[c3 & 0x3F]; - } else if (len == 2) { - *r++ = basis_64[(c2 & 0xF) << 2]; - *r++ = '='; - } else { /* len == 1 */ - *r++ = '='; - *r++ = '='; - } - } - if (rlen) { - /* append eol to the result string */ - char *c = eol; - char *e = eol + eollen; - while (c < e) - *r++ = *c++; - } - *r = '\0'; /* every SV in perl should be NUL-terminated */ -} - -#endif /* EXP_FILE_UPLOAD */ - #ifdef EXP_CMD_LOGGING PRIVATE FILE *cmd_logfile; PRIVATE FILE *cmd_script; |