summaryrefslogtreecommitdiff
path: root/language/tibetan/sirlin/src/tfilt.c
blob: fc28e93ba8b2ed17ccefbd8e4933e467a63e97f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 *	Copyright 1987 Jeff Sparkes
 *	Department of Computer Science
 *	Memorial University of Newfoundland
 *	St. John's, Nfld.
 *	garfield!jeff1,	jeff1@garfield.mun.cdn
 *
 *	Permission is granted to distribute and/or modify this code, provided
 *	this copyright notice remains intact.
 *	If you use it, let me know.  If change it let me know.  If you
 *	make money from it, send me a share.
 */
	
#include <stdio.h>
#include "table.h"
#include "token.h"

main(argc, argv)
	int             argc;
	char          **argv;
{
	char            c;

	if (argc != 2) {
		fprintf(stderr, "usage: %s input_file\n", argv[0]);
		exit(11);
	}
	if ((input = fopen(argv[1], "r")) == NULL) {
		perror(argv[1]);
		exit(12);
	}
	/*
	 * Now the hard part begins. 
	 */

/* sws  moved to tibdef.tex */
/*	printf("\\font\\tibetan=tib\\font\\tibsp=tibsp ");*/
/*	printf("\\font\\tibetan=tib\n\\font\\tibsp=tibsp\n");
	printf("\\font\\tenrm=cmr10\n\n");
*/
	printf("\\input tibdef\n\n");

	/* sws fixed loss of comments' first char */
	while ((c = getc(input)) != EOF) {
	  if (c == '%') {
	    if ((c = getc(input)) == '%')
	      tparse();
	    else if (c == EOF)
	      exit(0);
	    else {
	      putchar('%');
	      putchar(c);
	    }
	  } else
	    putchar(c);
	}
	exit(0);
}