stime.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* classes: h_files */
  2. #ifndef SCM_STIME_H
  3. #define SCM_STIME_H
  4. /* Copyright (C) 1995,1996,1997,1998,2000, 2003, 2006 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
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but 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 02110-1301 USA
  19. */
  20. #include "libguile/__scm.h"
  21. #include <unistd.h> /* for sysconf */
  22. /* This should be figured out by autoconf.
  23. sysconf(_SC_CLK_TCK) is best, since it's the actual running kernel, not
  24. some compile-time CLK_TCK. On glibc 2.3.2 CLK_TCK (when defined) is in
  25. fact sysconf(_SC_CLK_TCK) anyway.
  26. CLK_TCK is obsolete in POSIX. In glibc 2.3.2 it's defined by default,
  27. but if you define _GNU_SOURCE or _POSIX_C_SOURCE to get other features
  28. then it goes away. */
  29. #if ! defined(SCM_TIME_UNITS_PER_SECOND) && defined(_SC_CLK_TCK)
  30. # define SCM_TIME_UNITS_PER_SECOND ((int) sysconf (_SC_CLK_TCK))
  31. #endif
  32. #if ! defined(SCM_TIME_UNITS_PER_SECOND) && defined(CLK_TCK)
  33. # define SCM_TIME_UNITS_PER_SECOND ((int) CLK_TCK)
  34. #endif
  35. #if ! defined(SCM_TIME_UNITS_PER_SECOND) && defined(CLOCKS_PER_SEC)
  36. # define SCM_TIME_UNITS_PER_SECOND ((int) CLOCKS_PER_SEC)
  37. #endif
  38. #if ! defined(SCM_TIME_UNITS_PER_SECOND)
  39. # define SCM_TIME_UNITS_PER_SECOND 60
  40. #endif
  41. SCM_API long scm_c_get_internal_run_time (void);
  42. SCM_API SCM scm_get_internal_real_time (void);
  43. SCM_API SCM scm_get_internal_run_time (void);
  44. SCM_API SCM scm_current_time (void);
  45. SCM_API SCM scm_gettimeofday (void);
  46. SCM_API SCM scm_localtime (SCM time, SCM zone);
  47. SCM_API SCM scm_gmtime (SCM time);
  48. SCM_API SCM scm_mktime (SCM sbd_time, SCM zone);
  49. SCM_API SCM scm_tzset (void);
  50. SCM_API SCM scm_times (void);
  51. SCM_API SCM scm_strftime (SCM format, SCM stime);
  52. SCM_API SCM scm_strptime (SCM format, SCM string);
  53. SCM_API void scm_init_stime (void);
  54. #endif /* SCM_STIME_H */
  55. /*
  56. Local Variables:
  57. c-file-style: "gnu"
  58. End:
  59. */