diff options
author | John Keeping | 2013-04-07 14:40:50 +0100 |
---|---|---|
committer | Jason A. Donenfeld | 2013-04-08 16:10:11 +0200 |
commit | fd00d2f9d6088223f57006949dc6ce7c36316a79 (patch) | |
tree | 46092821a261964a35b36f0e22b924fdd144bf75 /html.h | |
parent | 57d09bf448990b3a67436e928807e854e491756f (diff) | |
download | cgit-fd00d2f9d6088223f57006949dc6ce7c36316a79.tar.gz cgit-fd00d2f9d6088223f57006949dc6ce7c36316a79.tar.bz2 cgit-fd00d2f9d6088223f57006949dc6ce7c36316a79.zip |
html.c: add various strbuf and varadic helpers
This adds the fmtalloc helper, html_txtf, html_vtxtf, and html_attrf.
These takes a printf style format string like htmlf but escapes the
resulting string. The html_vtxtf variant takes a va_list whereas
html_txtf is variadic.
Signed-off-by: John Keeping <john@keeping.me.uk>
Diffstat (limited to 'html.h')
-rw-r--r-- | html.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,7 +1,7 @@ | |||
1 | #ifndef HTML_H | 1 | #ifndef HTML_H |
2 | #define HTML_H | 2 | #define HTML_H |
3 | 3 | ||
4 | #include <stddef.h> | 4 | #include "cgit.h" |
5 | 5 | ||
6 | extern void html_raw(const char *txt, size_t size); | 6 | extern void html_raw(const char *txt, size_t size); |
7 | extern void html(const char *txt); | 7 | extern void html(const char *txt); |
@@ -9,6 +9,15 @@ extern void html(const char *txt); | |||
9 | __attribute__((format (printf,1,2))) | 9 | __attribute__((format (printf,1,2))) |
10 | extern void htmlf(const char *format,...); | 10 | extern void htmlf(const char *format,...); |
11 | 11 | ||
12 | __attribute__((format (printf,1,2))) | ||
13 | extern void html_txtf(const char *format,...); | ||
14 | |||
15 | __attribute__((format (printf,1,0))) | ||
16 | extern void html_vtxtf(const char *format, va_list ap); | ||
17 | |||
18 | __attribute__((format (printf,1,2))) | ||
19 | extern void html_attrf(const char *format,...); | ||
20 | |||
12 | extern void html_status(int code, const char *msg, int more_headers); | 21 | extern void html_status(int code, const char *msg, int more_headers); |
13 | extern void html_txt(const char *txt); | 22 | extern void html_txt(const char *txt); |
14 | extern void html_ntxt(int len, const char *txt); | 23 | extern void html_ntxt(int len, const char *txt); |