-rw-r--r-- | html.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -32,12 +32,17 @@ char *fmt(const char *format, ...) fprintf(stderr, "[html.c] string truncated: %s\n", format); exit(1); } return buf[bufidx]; } +void html_raw(const char *data, size_t size) +{ + write(htmlfd, data, size); +} + void html(const char *txt) { write(htmlfd, txt, strlen(txt)); } void htmlf(const char *format, ...) @@ -48,15 +53,15 @@ void htmlf(const char *format, ...) va_start(args, format); vsnprintf(buf, sizeof(buf), format, args); va_end(args); html(buf); } -void html_status(int code, int more_headers) +void html_status(int code, const char *msg, int more_headers) { - htmlf("Status: %d\n", code); + htmlf("Status: %d %s\n", code, msg); if (!more_headers) html("\n"); } void html_txt(char *txt) { |