2 6509b181 2022-12-30 thomas #include <stdlib.h>
3 6509b181 2022-12-30 thomas #include <string.h>
5 6509b181 2022-12-30 thomas #include "tmpl.h"
7 6509b181 2022-12-30 thomas int base(struct template *, const char *);
10 6509b181 2022-12-30 thomas {{ define base(struct template *tp, const char *title) }}
11 6509b181 2022-12-30 thomas {! char *foo = NULL; !}
12 6509b181 2022-12-30 thomas <!doctype html>
15 6509b181 2022-12-30 thomas <title>{{ title }}</title>
18 6509b181 2022-12-30 thomas <h1>{{ title }}</h1>
19 6509b181 2022-12-30 thomas {{ if strchr(title, '*') != NULL }}
20 6509b181 2022-12-30 thomas <p>"{{ title }}" has a '*' in it</p>
21 6509b181 2022-12-30 thomas {{ if 1 }}
22 6509b181 2022-12-30 thomas <p>tautology!</p>
24 6509b181 2022-12-30 thomas {{ else if strchr(title, '=') != NULL }}
25 6509b181 2022-12-30 thomas <p>"{{ title }}" has a '=' in it!</p>
26 6509b181 2022-12-30 thomas {{ else }}
27 6509b181 2022-12-30 thomas <p>"{{ title }}" doesn't have a '*' in it</p>
31 6509b181 2022-12-30 thomas {{ finally }}
32 6509b181 2022-12-30 thomas {! free(foo); !}