46 if (wrap && *
len >= wrap) {
57 if (tuple == 0 &&
count == 4) {
59 }
else if (tuple == 0x20202020 &&
count == 4 && y_abbr) {
62 for (
i = 0;
i < 5;
i++) {
63 out[
i] = tuple % 85 +
'!';
67 for (
i = 4;
i >= lim;
i--) {
76 putchar(tuple >> ((4 -
i) * 8));
82 unsigned long tuple = 0;
90 tuple |=
c << ((3 -
count++) * 8);
94 }
else if (
count == 0) {
112 unsigned long tuple = 0, pows[] = { 85 * 85 * 85 * 85, 85 * 85 * 85, 85 * 85, 85, 1 };
121 }
else if (
c == EOF) {
122 eprintf(
"ascii85: missing <~");
128 if (
c ==
'z' &&
count == 0) {
132 if (
c ==
'y' &&
count == 0) {
136 if (
c ==
'~' && delims) {
139 eprintf(
"ascii85: ~ without >\n");
146 if (delims && !
end) {
147 eprintf(
"ascii85: missing ~>");
151 tuple += pows[
count - 1];
156 if (c < '!' || c >
'u') {
157 if (ignore_garbage) {
160 eprintf(
"ascii85: invalid character '%c'\n",
c);
163 tuple += (
c -
'!') * pows[
count++];
static void encode_tuple(unsigned long tuple, int count, int wrap, int *plen, int y_abbr)
static void putc_wrap(char c, int wrap, int *len)
RZ_API bool rz_base85_decode(FILE *fp, int delims, int ignore_garbage)
static int getc_nospace(FILE *f)
RZ_API void rz_base85_encode(FILE *fp, int delims, int wrap, int y_abbr)
RZ_API void rz_base85_decode_tuple(unsigned long tuple, int count)
const lzma_allocator const uint8_t size_t uint8_t * out
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count