6
/* Copyright (C) 1995,1996,1997,1998,2000, 2003, 2006 Free Software Foundation, Inc.
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License, or (at your option) any later version.
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25
#include "libguile/__scm.h"
27
#include <unistd.h> /* for sysconf */
31
/* This should be figured out by autoconf.
33
sysconf(_SC_CLK_TCK) is best, since it's the actual running kernel, not
34
some compile-time CLK_TCK. On glibc 2.3.2 CLK_TCK (when defined) is in
35
fact sysconf(_SC_CLK_TCK) anyway.
37
CLK_TCK is obsolete in POSIX. In glibc 2.3.2 it's defined by default,
38
but if you define _GNU_SOURCE or _POSIX_C_SOURCE to get other features
41
#if ! defined(SCM_TIME_UNITS_PER_SECOND) && defined(_SC_CLK_TCK)
42
# define SCM_TIME_UNITS_PER_SECOND ((int) sysconf (_SC_CLK_TCK))
44
#if ! defined(SCM_TIME_UNITS_PER_SECOND) && defined(CLK_TCK)
45
# define SCM_TIME_UNITS_PER_SECOND ((int) CLK_TCK)
47
#if ! defined(SCM_TIME_UNITS_PER_SECOND) && defined(CLOCKS_PER_SEC)
48
# define SCM_TIME_UNITS_PER_SECOND ((int) CLOCKS_PER_SEC)
50
#if ! defined(SCM_TIME_UNITS_PER_SECOND)
51
# define SCM_TIME_UNITS_PER_SECOND 60
55
SCM_API long scm_c_get_internal_run_time (void);
56
SCM_API SCM scm_get_internal_real_time (void);
57
SCM_API SCM scm_get_internal_run_time (void);
58
SCM_API SCM scm_current_time (void);
59
SCM_API SCM scm_gettimeofday (void);
60
SCM_API SCM scm_localtime (SCM time, SCM zone);
61
SCM_API SCM scm_gmtime (SCM time);
62
SCM_API SCM scm_mktime (SCM sbd_time, SCM zone);
63
SCM_API SCM scm_tzset (void);
64
SCM_API SCM scm_times (void);
65
SCM_API SCM scm_strftime (SCM format, SCM stime);
66
SCM_API SCM scm_strptime (SCM format, SCM string);
67
SCM_API void scm_init_stime (void);
69
#endif /* SCM_STIME_H */