stime.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* classes: h_files */
  2. #ifndef SCM_STIME_H
  3. #define SCM_STIME_H
  4. /* Copyright (C) 1995,1996,1997,1998,2000, 2003, 2006, 2008 Free Software Foundation, Inc.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public License
  8. * as published by the Free Software Foundation; either version 3 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. */
  21. #include "libguile/__scm.h"
  22. #include <unistd.h> /* for sysconf */
  23. /* This should be figured out by autoconf.
  24. sysconf(_SC_CLK_TCK) is best, since it's the actual running kernel, not
  25. some compile-time CLK_TCK. On glibc 2.3.2 CLK_TCK (when defined) is in
  26. fact sysconf(_SC_CLK_TCK) anyway.
  27. CLK_TCK is obsolete in POSIX. In glibc 2.3.2 it's defined by default,
  28. but if you define _GNU_SOURCE or _POSIX_C_SOURCE to get other features
  29. then it goes away. */
  30. #if ! defined(SCM_TIME_UNITS_PER_SECOND) && defined(_SC_CLK_TCK)
  31. # define SCM_TIME_UNITS_PER_SECOND ((int) sysconf (_SC_CLK_TCK))
  32. #endif
  33. #if ! defined(SCM_TIME_UNITS_PER_SECOND) && defined(CLK_TCK)
  34. # define SCM_TIME_UNITS_PER_SECOND ((int) CLK_TCK)
  35. #endif
  36. #if ! defined(SCM_TIME_UNITS_PER_SECOND) && defined(CLOCKS_PER_SEC)
  37. # define SCM_TIME_UNITS_PER_SECOND ((int) CLOCKS_PER_SEC)
  38. #endif
  39. #if ! defined(SCM_TIME_UNITS_PER_SECOND)
  40. # define SCM_TIME_UNITS_PER_SECOND 60
  41. #endif
  42. SCM_API long scm_c_get_internal_run_time (void);
  43. SCM_API SCM scm_get_internal_real_time (void);
  44. SCM_API SCM scm_get_internal_run_time (void);
  45. SCM_API SCM scm_current_time (void);
  46. SCM_API SCM scm_gettimeofday (void);
  47. SCM_API SCM scm_localtime (SCM time, SCM zone);
  48. SCM_API SCM scm_gmtime (SCM time);
  49. SCM_API SCM scm_mktime (SCM sbd_time, SCM zone);
  50. SCM_API SCM scm_tzset (void);
  51. SCM_API SCM scm_times (void);
  52. SCM_API SCM scm_strftime (SCM format, SCM stime);
  53. SCM_API SCM scm_strptime (SCM format, SCM string);
  54. SCM_INTERNAL void scm_init_stime (void);
  55. #endif /* SCM_STIME_H */
  56. /*
  57. Local Variables:
  58. c-file-style: "gnu"
  59. End:
  60. */