Ingo Weinhold 9ea2a99edb Moved the old gcc to its new home.
git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@15071 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-22 15:53:32 +00:00

39 lines
656 B
C

#include <stdio.h>
#define MAXWORD 32
int
main(argc, argv)
int argc;
char *argv[];
{
register int len;
int inmap[MAXWORD];
int outmap[MAXWORD];
char in[MAXWORD];
char out[MAXWORD];
register int i;
register int a;
a = 1;
len = atoi(argv[a++]);
if (len > MAXWORD)
abort(); /* kind of drastic... */
for (i = 0; i < len; i++)
inmap[i] = atoi(argv[a++]);
if (atoi(argv[a++]) != len)
abort();
for (i = 0; i < len; i++)
outmap[i] = atoi(argv[a++]);
while (fread(in, 1, len, stdin) == len) {
for (i = 0; i < len; i++)
out[outmap[i]] = in[inmap[i]];
fwrite(out, 1, len, stdout);
}
#ifdef DBZ_FINISH
DBZ_FINISH;
#endif
exit(0);
}