From 440075247d11a7852d8567753f426fa67f41d875 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 22 Apr 2010 11:42:45 +0200 Subject: spoolss: pretty-print a struct spoolss_Time. Guenther --- librpc/ndr/ndr_spoolss_buf.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'librpc/ndr/ndr_spoolss_buf.c') diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c index f8a67063be5..e15591633dc 100644 --- a/librpc/ndr/ndr_spoolss_buf.c +++ b/librpc/ndr/ndr_spoolss_buf.c @@ -1414,3 +1414,30 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo2(struct ndr_push *ndr, i } return NDR_ERR_SUCCESS; } + +_PUBLIC_ void ndr_print_spoolss_Time(struct ndr_print *ndr, const char *name, const struct spoolss_Time *r) +{ + struct tm tm; + time_t t; + char *str; + + tm.tm_sec = r->second; + tm.tm_min = r->minute; + tm.tm_hour = r->hour; + tm.tm_mday = r->day; + tm.tm_mon = r->month - 1; + tm.tm_year = r->year - 1900; + tm.tm_wday = r->day_of_week; + tm.tm_yday = 0; + tm.tm_isdst = -1; + + t = mktime(&tm); + + str = timestring(ndr, t); + + ndr_print_struct(ndr, name, "spoolss_Time"); + ndr->depth++; + ndr_print_string(ndr, "", str); + ndr->depth--; + talloc_free(str); +} -- cgit