aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorJim Blandy1992-03-14 19:09:32 +0000
committerJim Blandy1992-03-14 19:09:32 +0000
commit956ace37a8ec4df40a07940c08d5aa6d10e8b073 (patch)
tree47a79680bb2980f34271e67401a3c0f545045a51 /src/editfns.c
parentfb955dfadd6fd6031b50561e184610c56f04a2cc (diff)
downloademacs-956ace37a8ec4df40a07940c08d5aa6d10e8b073.tar.gz
emacs-956ace37a8ec4df40a07940c08d5aa6d10e8b073.zip
*** empty log message ***
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 2d75d105a44..d0db0837591 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1,5 +1,5 @@
1/* Lisp functions pertaining to editing. 1/* Lisp functions pertaining to editing.
2 Copyright (C) 1985, 1986, 1987, 1989 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -21,7 +21,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
21#include "config.h" 21#include "config.h"
22 22
23#ifdef VMS 23#ifdef VMS
24#include "pwd.h" 24#include "vms-pwd.h"
25#else 25#else
26#include <pwd.h> 26#include <pwd.h>
27#endif 27#endif
@@ -30,13 +30,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
30#include "buffer.h" 30#include "buffer.h"
31#include "window.h" 31#include "window.h"
32 32
33#ifdef NEED_TIME_H 33#include "systime.h"
34#include <time.h>
35#else /* not NEED_TIME_H */
36#ifdef HAVE_TIMEVAL
37#include <sys/time.h>
38#endif /* HAVE_TIMEVAL */
39#endif /* not NEED_TIME_H */
40 34
41#define min(a, b) ((a) < (b) ? (a) : (b)) 35#define min(a, b) ((a) < (b) ? (a) : (b))
42#define max(a, b) ((a) > (b) ? (a) : (b)) 36#define max(a, b) ((a) > (b) ? (a) : (b))
@@ -509,10 +503,25 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
509} 503}
510 504
511DEFUN ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0, 505DEFUN ("current-time", Fcurrent_time, Scurrent_time, 0, 0, 0,
512 "Return the current time, as an integer.") 506 "Return the current time, as the number of seconds since 12:00 AM January 1970.\n\
507The time is returned as a list of three integers. The first has the\n\
508most significant 16 bits of the seconds, while the second has the\n\
509least significant 16 bits. The third integer gives the microsecond\n\
510count.\n\
511\n\
512The microsecond count is zero on systems that do not provide\n\
513resolution finer than a second.")
513 () 514 ()
514{ 515{
515 return make_number (time(0)); 516 EMACS_TIME t;
517 Lisp_Object result[3];
518
519 EMACS_GET_TIME (t);
520 XSET (result[0], Lisp_Int, (EMACS_SECS (t) >> 16) & 0xffff);
521 XSET (result[1], Lisp_Int, (EMACS_SECS (t) >> 0) & 0xffff);
522 XSET (result[2], Lisp_Int, EMACS_USECS (t));
523
524 return Flist (3, result);
516} 525}
517 526
518 527