| * Copyright (c) 2000 Markus Friedl. All rights reserved. |
| uuencode(unsigned char *src, unsigned int srclength, |
| char *target, size_t targsize) |
| return __b64_ntop(src, srclength, target, targsize); |
| uudecode(const char *src, unsigned char *target, size_t targsize) |
| /* copy the 'readonly' source */ |
| /* skip whitespace and data */ |
| for (p = encoded; *p == ' ' || *p == '\t'; p++) |
| for (; *p != '\0' && *p != ' ' && *p != '\t'; p++) |
| /* and remote trailing whitespace because __b64_pton needs this */ |
| len = __b64_pton(encoded, target, targsize); |
| dump_base64(FILE *fp, unsigned char *data, int len) |
| unsigned char *buf = xmalloc(2*len); |
| n = uuencode(data, len, buf, 2*len); |
| for (i = 0; i < n; i++) { |
| fprintf(fp, "%c", buf[i]); |