public void GetCurrentTime(GLib.TimeVal timeval) { IntPtr native_timeval = GLib.Marshaller.StructureToPtrAlloc(timeval); g_source_get_current_time(Handle, native_timeval); timeval = GLib.TimeVal.New(native_timeval); Marshal.FreeHGlobal(native_timeval); }
public DateTime(GLib.TimeVal tv) { IntPtr native_tv = GLib.Marshaller.StructureToPtrAlloc(tv); Raw = g_date_time_new_from_timeval_local(native_tv); tv = GLib.TimeVal.New(native_tv); Marshal.FreeHGlobal(native_tv); }
public static DateTime NewFromTimevalUtc(GLib.TimeVal tv) { IntPtr native_tv = GLib.Marshaller.StructureToPtrAlloc(tv); DateTime result = new DateTime(g_date_time_new_from_timeval_utc(native_tv)); tv = GLib.TimeVal.New(native_tv); Marshal.FreeHGlobal(native_tv); return(result); }
public bool ToTimeval(GLib.TimeVal tv) { IntPtr native_tv = GLib.Marshaller.StructureToPtrAlloc(tv); bool raw_ret = g_date_time_to_timeval(Handle, native_tv); bool ret = raw_ret; tv = GLib.TimeVal.New(native_tv); Marshal.FreeHGlobal(native_tv); return(ret); }
public static bool FromIso8601(string iso_date, out GLib.TimeVal time_) { IntPtr native_iso_date = GLib.Marshaller.StringToPtrGStrdup (iso_date); IntPtr native_time_ = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (GLib.TimeVal))); bool raw_ret = g_time_val_from_iso8601(native_iso_date, native_time_); bool ret = raw_ret; GLib.Marshaller.Free (native_iso_date); time_ = GLib.TimeVal.New (native_time_); Marshal.FreeHGlobal (native_time_); return ret; }
static void ReadNative (IntPtr native, ref GLib.TimeVal target) { target = New (native); }