Signed-off-by: John Keeping <j...@keeping.me.uk>
---
 html.c | 13 +++++++++++++
 html.h |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/html.c b/html.c
index cac1ed3..f7772dc 100644
--- a/html.c
+++ b/html.c
@@ -170,6 +170,19 @@ void html_ntxt(int len, const char *txt)
                html("...");
 }
 
+void html_attrf(const char *fmt, ...)
+{
+       va_list ap;
+       struct strbuf sb = STRBUF_INIT;
+
+       va_start(ap, fmt);
+       strbuf_vaddf(&sb, fmt, ap);
+       va_end(ap);
+
+       html_attr(sb.buf);
+       strbuf_release(&sb);
+}
+
 void html_attr(const char *txt)
 {
        const char *t = txt;
diff --git a/html.h b/html.h
index 6886a46..be3b311 100644
--- a/html.h
+++ b/html.h
@@ -15,6 +15,9 @@ extern void html_txtf(const char *format,...);
 __attribute__((format (printf,1,0)))
 extern void html_vtxtf(const char *format, va_list ap);
 
+__attribute__((format (printf,1,2)))
+extern void html_attrf(const char *format,...);
+
 extern void html_status(int code, const char *msg, int more_headers);
 extern void html_txt(const char *txt);
 extern void html_ntxt(int len, const char *txt);
-- 
1.8.2.692.g17a9715


_______________________________________________
cgit mailing list
cgit@hjemli.net
http://hjemli.net/mailman/listinfo/cgit

Reply via email to