/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2003-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* uuencode familiy coders
*/
#include <codex.h>
#include <ctype.h>
typedef struct
{
int pad;
int fill;
int length;
} Data_t;
typedef struct State_s
{
unsigned char* bb;
unsigned char* bp;
unsigned char* bl;
unsigned char* be;
unsigned char* map;
unsigned char* pb;
unsigned char* pp;
int c1;
int c2;
int nl;
int string;
int text;
} State_t;
{
'=',
0,
0,
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
};
{
0,
0156,
1,
"`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
};
{
0,
0,
1,
" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
};
static int
{
ssize_t r;
{
return EOF;
}
}
static int
{
uint32_t b;
int c3;
int x;
x = 1;
{
x++;
{
x++;
}
}
{
{
}
else
{
}
return EOF;
}
return 0;
}
static int
{
register char* s;
register char** a;
unsigned char* m;
unsigned char* q;
int c;
int n;
int string;
int text;
a = (char**)args + 1;
while (s = *++a)
else if (streq(s, "posix"))
else if (streq(s, "string"))
{
{
return -1;
}
string = 1;
}
else if (streq(s, "text"))
text = 1;
else
{
return -1;
}
{
return -1;
}
if (p->flags & CODEX_DECODE)
{
if (n)
}
return 0;
}
static int
{
int n;
if (p->flags & CODEX_ENCODE)
{
{
}
}
else
{
}
return 0;
}
static ssize_t
{
register char* s = (char*)buf;
register char* e = s + n;
register uint32_t b;
register int c;
register int x;
{
}
while (s < e)
{
{
case EOF:
goto done;
case '\n':
continue;
}
{
c = 0;
else
b = (b << 6) | c;
c = 0;
else
b = (b << 6) | c;
c = 0;
else
b = (b << 6) | c;
{
if ((c = (b >> 16) & 0xFF) != '\r')
if ((c = (b >> 8) & 0xFF) != '\r')
if ((c = b & 0xFF) != '\r')
}
else
{
}
s--;
}
}
else
while (s < e)
{
if (c != UU_IGN)
goto done;
b = c;
if (c != UU_IGN)
{
goto done;
}
b = (b << 6) | c;
if (c != UU_IGN)
{
{
if ((x = (b >> 4) & 0xFF) != '\r')
}
else
goto done;
}
b = (b << 6) | c;
if (c != UU_IGN)
{
{
if ((x = (b >> 10) & 0xFF) != '\r')
if ((x = (b >> 2) & 0xFF) != '\r')
}
else
{
}
goto done;
}
b = (b << 6) | c;
{
if ((x = (b >> 16) & 0xFF) != '\r')
if ((x = (b >> 8) & 0xFF) != '\r')
if ((x = b & 0xFF) != '\r')
}
else
{
}
}
done:
return s - (char*)buf;
}
static ssize_t
{
register unsigned char* s;
register unsigned char* e;
register uint32_t b;
register int c1;
register int c2;
register int c3;
s = (unsigned char*)buf;
e = s + n;
{
{
goto get_3;
}
goto get_2;
}
while (s < e)
{
do
{
{
c1 = '\n';
goto get_2;
}
if (s >= e)
break;
c1 = *s++;
{
c1 = '\r';
c2 = '\n';
goto get_3;
}
if (s >= e)
{
return n;
}
c2 = *s++;
{
c2 = '\r';
c3 = '\n';
goto put_123;
}
if (s >= e)
{
return n;
}
c3 = *s++;
{
c3 = '\r';
}
{
return -1;
}
{
}
}
return n;
}
static int
{
}
{
"uu",
"uuencode printable encoding.",
"[+posix?Posix \buuencode\b(1). This is the default.]"
"[+base64|mime?MIME base64 encoding.]"
"[+bsd|ucb?BSD \buuencode\b(1).]"
"[+string?Encode into a string with no separators (base64 only).]"
"[+text?Encode \\n => \\r\\n, decode \\r\\n => \\n.]"
"[+(version)?codex-uu (AT&T Research) 2010-01-15]"
"[+(author)?Glenn Fowler <gsf@research.att.com>]",
0,
0,
0,
0,
0,
0,
0,
0,
};