From 4be1e8fd5e352a54e87a81979d5ad303efdcbffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Tue, 14 Sep 2010 13:06:29 +0300 Subject: auth-ip: print information in shell compatible format so we can dump information from http cgi-bin scripts. --- blob.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'blob.c') diff --git a/blob.c b/blob.c index f2a80f6..2c5dd17 100644 --- a/blob.c +++ b/blob.c @@ -1,3 +1,4 @@ +#include #include #include @@ -208,6 +209,17 @@ void blob_push_uint(blob_t *to, unsigned int value, int radix) blob_push(to, BLOB_PTR_PTR(ptr+1, &buf[sizeof(buf)-1])); } +void blob_push_ctime(blob_t *to, time_t t) +{ + char buf[128]; + blob_t b; + + ctime_r(&t, buf); + b = BLOB_STRLEN(buf); + b.len--; + blob_push(to, b); +} + void blob_push_hexdump(blob_t *to, blob_t binary) { char *d; -- cgit v1.2.3