summaryrefslogtreecommitdiff
path: root/librpc/ndr
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-04-22 11:42:45 +0200
committerGünther Deschner <gd@samba.org>2010-04-22 11:53:41 +0200
commit440075247d11a7852d8567753f426fa67f41d875 (patch)
treeaa53ac2578afb587da9639313db56fea8570eb77 /librpc/ndr
parent404f7ac0292c91ef3101e9bc32b8aea3b2aec4be (diff)
downloadsamba-440075247d11a7852d8567753f426fa67f41d875.tar.gz
samba-440075247d11a7852d8567753f426fa67f41d875.tar.bz2
samba-440075247d11a7852d8567753f426fa67f41d875.zip
spoolss: pretty-print a struct spoolss_Time.
Guenther
Diffstat (limited to 'librpc/ndr')
-rw-r--r--librpc/ndr/ndr_spoolss_buf.c27
-rw-r--r--librpc/ndr/ndr_spoolss_buf.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c
index f8a67063be..e15591633d 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);
+}
diff --git a/librpc/ndr/ndr_spoolss_buf.h b/librpc/ndr/ndr_spoolss_buf.h
index 2766abb1cd..89dcb4617c 100644
--- a/librpc/ndr/ndr_spoolss_buf.h
+++ b/librpc/ndr/ndr_spoolss_buf.h
@@ -51,6 +51,7 @@ size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t
void ndr_print_spoolss_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r);
enum ndr_err_code ndr_pull_spoolss_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r);
enum ndr_err_code ndr_push_spoolss_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r);
+_PUBLIC_ void ndr_print_spoolss_Time(struct ndr_print *ndr, const char *name, const struct spoolss_Time *r);
#undef _PRINTF_ATTRIBUTE
#define _PRINTF_ATTRIBUTE(a1, a2)