aboutsummaryrefslogtreecommitdiff
path: root/mktpl/README
blob: cb50a6e3775f6822d0730e8d33f09d0300c1f728 (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
                              README

`mktpl' is a simple UNIX program that compiles template files (.t)
to C files (.tc). Template files support special syntax (<% ... %>)
that may contain C code.

For example, the template

	This will be printed.
	<%
	/* This C code will be executed. */
	for(i = 0; i<10; i++) printf("Hello World!\n");
	strcpy(s, "This");
	%>
	<%= s %> will be evaluated and printed as a string.

is compiled to the following C code:

	printf("This will be printed.\n	");
	/* This C code will be executed. */
	for(i = 0; i<10; i++) printf("Hello World!\n");
	strcpy(s, "This");

	printf("\n");
	printf("%s",  s );
	printf(" will be evaluated and printed as a string.");