]>
git.saurik.com Git - wxWidgets.git/blob - src/tiff/contrib/mac-mpw/mactrans.c
2 * mactrans.c -- Hack filter used to generate MPW files
3 * with special characters from pure ASCII, denoted "%nn"
4 * where nn is hex. (except for "%%", which is literal '%').
8 * catenate file | mactrans [-toascii | -fromascii] > output
10 * Written by: Niles Ritter.
17 void from_ascii(void);
19 main(int argc
, char *argv
[])
21 if (argc
<2 || argv
[1][1]=='f') from_ascii();
30 while ((c
=getchar())!=EOF
)
32 if (c
!='%' || (c
=getchar())=='%') putchar(c
);
37 *((unsigned char *)&c
) = d
;
47 while ((c
=getchar())!=EOF
)
49 if (isascii(c
)) putchar (c
);
52 d
= *((unsigned char *)&c
);