2 * Copyright (c) 2022 Omar Polo <op@openbsd.org>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 typedef int (*tmpl_write
)(void *, const void *, size_t);
33 int tp_write(struct template *, const char *, size_t);
34 int tp_writes(struct template *, const char *);
35 int tp_writef(struct template *, const char *, ...)
36 __attribute__((__format__ (printf
, 2, 3)));
37 int tp_urlescape(struct template *, const char *);
38 int tp_htmlescape(struct template *, const char *);
39 int tp_write_htmlescape(struct template *, const char *, size_t);
41 struct template *template(void *, tmpl_write
, char *, size_t);
42 int template_flush(struct template *);
43 void template_free(struct template *);