From: Andrea Zagli Date: Sun, 6 Dec 2015 09:19:14 +0000 (+0100) Subject: Added function ::gvalue_new_gdatetime. X-Git-Tag: v0.0.1~10 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=cbf67cefd7f9da714bd5248c5dbaaba98ba5d05d;p=libzakutils Added function ::gvalue_new_gdatetime. --- diff --git a/src/generic.c b/src/generic.c index 76c9ee3..8d9e720 100644 --- a/src/generic.c +++ b/src/generic.c @@ -387,6 +387,23 @@ GValue return gval; } +/** + * zak_utils_gvalue_new_gdatetime: + * @datetime: + * + */ +GValue +*zak_utils_gvalue_new_gdatetime (GDateTime *datetime) +{ + GValue *gval; + + gval = g_new0 (GValue, 1); + g_value_init (gval, G_TYPE_DATE_TIME); + g_value_set_boxed (gval, datetime); + + return gval; +} + /** * zak_utils_str_to_boolean: * @value: diff --git a/src/generic.h b/src/generic.h index 8ea64e1..0ee9247 100644 --- a/src/generic.h +++ b/src/generic.h @@ -43,6 +43,7 @@ GValue *zak_utils_gvalue_new_int (int i); GValue *zak_utils_gvalue_new_string (const gchar *str); GValue *zak_utils_gvalue_new_boolean (gboolean b); GValue *zak_utils_gvalue_new_float (gfloat f); +GValue *zak_utils_gvalue_new_gdatetime (GDateTime *datetime); gboolean zak_utils_str_to_boolean (const gchar *str);