3 /* If it turns out that we need to make this conditional on config.sh derived
4 values, it might be easier just to rip out the use of strerrer(). */
6 /* If a platform doesn't support errno.h, it's probably so strange that
7 "hello world" won't port easily to it. */
10 void output_block_to_file(const char *progname, const char *filename,
11 const char *block, size_t count) {
12 FILE *const out = fopen(filename, "w");
15 fprintf(stderr, "%s: Could not open '%s': %s\n", progname, filename,
22 fprintf(out, "%d", *block);
34 fprintf(stderr, "%s: Could not close '%s': %s\n", progname, filename,
41 static const char PL_uuemap[]
42 = "`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_";
44 typedef unsigned char U8;
46 /* This will ensure it is all zeros. */
47 static char PL_uudmap[256];
49 int main(int argc, char **argv) {
52 if (argc < 2 || argv[1][0] == '\0') {
53 fprintf(stderr, "Usage: %s uudemap.h\n", argv[0]);
57 for (i = 0; i < sizeof(PL_uuemap) - 1; ++i)
58 PL_uudmap[(U8)PL_uuemap[i]] = (char)i;
60 * Because ' ' and '`' map to the same value,
61 * we need to decode them both the same.
63 PL_uudmap[(U8)' '] = 0;
65 output_block_to_file(argv[0], argv[1], PL_uudmap, sizeof(PL_uudmap));