2 * Modified by Bradley Bell, 2002, 2003
3 * This program is licensed under the terms of the GPL, version 2 or later
10 main(int argc, char *argv[])
18 printf("TXB2TEX V1.0 Copyright (c) Bryan Aamot, 1995\n"
19 "Modified by Bradley Bell, 2002, 2003\n"
20 "TXB to Text converter for Descent HOG files.\n"
21 "Converts a *.txb descent hog file to an ascii file.\n"
22 "Usage: TXB2TEX <txb file name> <text file name>\n"
23 "Example: TXB2TEX briefing.txb briefing.tex\n");
26 file = fopen(argv[1], "rb");
28 printf("Can't open txb file (%s)\n", argv[1]);
33 strcpy(outfilename, argv[2]);
35 strcpy(outfilename, argv[1]);
36 strcpy(strrchr(outfilename, '.'), ".tex");
39 outfile = fopen(outfilename, "wb");
41 printf("Can't open file (%s)\n", outfilename);
47 if (feof(file)) break;
49 fprintf(outfile, "\x0d\x0a");
51 ch = ( ( (code&0x3f) << 2 ) + ( (code&0xc0) >> 6 ) ) ^ 0xa7;
52 fprintf(outfile, "%c", ch);