Add 'GTimeSpec' as 'struct timespec' equivalent
authorRyan Lortie <desrt@desrt.ca>
Fri, 22 Oct 2010 15:28:46 +0000 (17:28 +0200)
committerRyan Lortie <desrt@desrt.ca>
Wed, 27 Oct 2010 13:22:12 +0000 (09:22 -0400)
docs/reference/glib/glib-sections.txt
docs/reference/glib/tmpl/date.sgml
glib/gmain.c
glib/gtypes.h

index 4bc1900..d51ffc7 100644 (file)
@@ -1320,6 +1320,9 @@ g_time_val_from_iso8601
 g_time_val_to_iso8601
 
 <SUBSECTION>
+GTimeSpec
+
+<SUBSECTION>
 GDate
 GTime
 GDateDMY
index d097edb..54b38cb 100644 (file)
@@ -134,6 +134,14 @@ length of the sleep.
 @Returns: 
 
 
+<!-- ##### STRUCT GTimeSpec ##### -->
+<para>
+
+</para>
+
+@tv_sec: 
+@tv_nsec: 
+
 <!-- ##### STRUCT GDate ##### -->
 <para>
 Represents a day between January 1, Year 1 and a few thousand years in
index da5bfea..31473c6 100644 (file)
@@ -1812,6 +1812,15 @@ g_get_current_time (GTimeVal *result)
 #endif
 }
 
+/**
+ * GTimeSpec:
+ *
+ * Represents a precise time, with seconds and nanoseconds.  This is
+ * similar to POSIX <structname>struct timespec</structname>.
+ *
+ * Since: 2.28
+ **/
+
 static void
 g_main_dispatch_free (gpointer dispatch)
 {
index e616f99..0b843c6 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <glibconfig.h>
 #include <glib/gmacros.h>
+#include <time.h>
 
 G_BEGIN_DECLS
 
@@ -423,6 +424,14 @@ struct _GTimeVal
   glong tv_usec;
 };
 
+typedef struct _GTimeSpec               GTimeSpec;
+
+struct _GTimeSpec
+{
+  time_t tv_sec;
+  glong  tv_nsec;
+};
+
 G_END_DECLS
 
 /* We prefix variable declarations so they can