]> code.delx.au - gnu-emacs/blobdiff - src/systime.h
Update copyright year to 2015
[gnu-emacs] / src / systime.h
index a9bdf53b09fe0e62ffdd7933d09e8c744774c6e2..1d3a4ba2914ef3b95b138add768fe2b426a3c179 100644 (file)
@@ -1,5 +1,5 @@
 /* systime.h - System-dependent definitions for time manipulations.
-   Copyright (C) 1993-1994, 2002-2013 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 2002-2015 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -57,10 +57,10 @@ invalid_timespec (void)
   return make_timespec (0, -1);
 }
 
-/* Return 1 if TIME is a valid timespec.  This currently doesn't worry
+/* Return true if TIME is a valid timespec.  This currently doesn't worry
    about whether tv_nsec is less than TIMESPEC_RESOLUTION; leap seconds
    might cause a problem if it did.  */
-INLINE int
+INLINE bool
 timespec_valid_p (struct timespec t)
 {
   return t.tv_nsec >= 0;
@@ -86,13 +86,42 @@ extern void set_waiting_for_input (struct timespec *);
    happen when this files is used outside the src directory).
    Use GCPRO1 to determine if lisp.h was included.  */
 #ifdef GCPRO1
+
+/* Emacs uses the integer list (HI LO US PS) to represent the time
+   (HI << LO_TIME_BITS) + LO + US / 1e6 + PS / 1e12.  */
+enum { LO_TIME_BITS = 16 };
+
+/* A Lisp time (HI LO US PS), sans the cons cells.  */
+struct lisp_time
+{
+  EMACS_INT hi;
+  int lo, us, ps;
+};
+
 /* defined in editfns.c */
 extern Lisp_Object make_lisp_time (struct timespec);
 extern bool decode_time_components (Lisp_Object, Lisp_Object, Lisp_Object,
-                                   Lisp_Object, struct timespec *, double *);
+                                   Lisp_Object, struct lisp_time *, double *);
+extern struct timespec lisp_to_timespec (struct lisp_time);
 extern struct timespec lisp_time_argument (Lisp_Object);
 #endif
 
+#ifndef HAVE_TZALLOC
+# undef mktime_z
+# undef timezone_t
+# undef tzalloc
+# undef tzfree
+# define mktime_z emacs_mktime_z
+# define timezone_t emacs_timezone_t
+# define tzalloc emacs_tzalloc
+# define tzfree emacs_tzfree
+typedef char const *timezone_t;
+INLINE timezone_t tzalloc (char const *name) { return name; }
+INLINE void tzfree (timezone_t tz) { }
+/* Defined in editfns.c.  */
+extern time_t mktime_z (timezone_t, struct tm *);
+#endif
+
 INLINE_HEADER_END
 
 #endif /* EMACS_SYSTIME_H */