summaryrefslogtreecommitdiff
path: root/libguile/stime.c
Commit message (Expand)AuthorAgeFilesLines
* Fix build warning...* libguile/stime.c (scm_init_stime): Remove unused variable. Andy Wingo2017-01-191-2/+0
* Fix scm_init_stime for macOS...* libguile/stime.c (scm_init_stime): Remove needless test of clock_getcpuclockid. Fixes build on macOS; thanks to Matt Wette for the report and fix. Andy Wingo2017-01-081-4/+1
* Fix --without-threads...* libguile/dynl.c: * libguile/gc.c: * libguile/keywords.c: * libguile/scmsigs.c: * libguile/stime.c: Use scm_i_dynamic_link instead of scm_dynamic_link so that things compile in without-threads configurations. Andy Wingo2016-12-071-2/+2
* Mutexes instead of critical sections in stime.c...* libguile/stime.c (scm_current_time): No need for a critical section around time(). (tz_lock): New mutex. (scm_localtime): Use tz_lock in a dynwind. Fixes bug in which critical section was never left on error. (scm_gmtime, scm_mktime, scm_strftime, scm_strptime): Use a normal mutex instead of a critical section. Andy Wingo2016-11-011-15/+16
* Use non-deprecated HAVE_STRUCT_TM_TM_ZONE...* libguile/stime.c: Change uses of the deprecated HAVE_TM_ZONE to the new HAVE_STRUCT_TM_TM_ZONE. Andy Wingo2016-07-251-5/+5
* Add missing 'const' qualifier....* libguile/stime.c (tzvar): Add 'const'. Ludovic Courtès2016-07-251-1/+1
* Unconditionally include <time.h> from Gnulib....* libguile/stime.c: Unconditionally include <time.h>. Ludovic Courtès2016-07-251-5/+1
* Merge branch 'stable-2.0'...Conflicts: GUILE-VERSION NEWS guile-readline/ice-9/readline.scm libguile/async.c libguile/backtrace.c libguile/deprecated.h libguile/gc-malloc.c libguile/gdbint.c libguile/init.c libguile/ioext.c libguile/mallocs.c libguile/print.c libguile/rw.c libguile/scmsigs.c libguile/script.c libguile/simpos.c libguile/snarf.h libguile/strports.c libguile/threads.c libguile/vm-i-scheme.c libguile/vm-i-system.c module/srfi/srfi-18.scm test-suite/Makefile.am test-suite/standalone/test-num2integral.c Mark H Weaver2014-04-251-3/+2
|\
| * Rely on Gnulib for <unistd.h>....* libguile/async.c: * libguile/backtrace.c: * libguile/error.c: * libguile/filesys.c: * libguile/fports.c: * libguile/gc-malloc.c: * libguile/gc.c: * libguile/gdbint.c: * libguile/init.c: * libguile/ioext.c: * libguile/load.c: * libguile/mallocs.c: * libguile/mkstemp.c: * libguile/ports.c: * libguile/posix.c: * libguile/r6rs-ports.c: * libguile/random.c: * libguile/rw.c: * libguile/scmsigs.c: * libguile/script.c: * libguile/simpos.c: * libguile/socket.c: * libguile/stime.c: * libguile/strports.c: * libguile/threads.c: Unconditionally include <unistd.h>. Mark H Weaver2014-02-271-3/+2
* | Change uses of scm_is_simple_vector to scm_is_vector...* libguile/filesys.c, libguile/random.c, libguile/stime.c, libguile/trees.c, libguile/validate.h: use scm_is_vector instead of scm_is_simple_vector. * libguile/sort.c (scm_sort_x, scm_sort, scm_stable_sort_x) (scm_stable_sort): Remove scm_is_vector check; scm_is_array is sufficient. * test-suite/tests/arrays.test: Fix header. * test-suite/tests/random.test: New coverage test covering random:normal-vector!. * test-suite/Makefile.am: Include random.test in make check. Daniel Llorens2014-02-081-1/+1
|/
* stime: Remove #ifdef HAVE_*_H for headers provided by Gnulib....* libguile/stime.c: Remove #ifdef HAVE_SYS_TIMES_H, HAVE_SYS_TYPES_H, and HAVE_STRING_H since those headers are always provided by Gnulib when the corresponding macro is undefined. Fixes a regression on MinGW introduced by commit 40e2a31. Ludovic Courtès2013-04-101-10/+2
* fix stime patch for HAVE_TIMES removal...* libguile/stime.c (scm_init_stime): Fix previous patch. At this point in the source, we definitely have a run-time function, but don't necessarily have a real-time function. Andy Wingo2013-04-091-3/+14
* simplify configure checks for functionality provided by gnulib...* configure.ac: Remove checks for pipe, stftime, times, and select, as our Gnulib modules already ensure they are provided. * libguile/stime.c: Rely on gnulib providing `times'. Andy Wingo2013-04-091-21/+0
* simplify stime back-compat shims for tzname...* libguile/stime.c: Remove tzname declarations for ancient mingw and SGI RS6000. Andy Wingo2013-03-091-8/+1
* Improve the usage of variable names in C docstrings....* libguile/alist.c: * libguile/array-map.c: * libguile/arrays.c: * libguile/bitvectors.c: * libguile/filesys.c: * libguile/foreign.c: * libguile/generalized-arrays.c: * libguile/hashtab.c: * libguile/ioext.c: * libguile/load.c: * libguile/numbers.c: * libguile/ports.c: * libguile/posix.c: * libguile/print.c: * libguile/procprop.c: * libguile/promises.c: * libguile/simpos.c: * libguile/socket.c: * libguile/srfi-1.c: * libguile/srfi-13.c: * libguile/srfi-14.c: * libguile/stacks.c: * libguile/stime.c: * libguile/strings.c: * libguile/struct.c: * libguile/symbols.c: * libguile/threads.c: * libguile/weak-table.c: * libguile/weak-vector.c: Make the variable names in the C docstrings more consistent. Replace a few instances of @var with @code when appropriate. Bake Timmons2012-02-021-8/+9
* clocktime freebsd portability...* libguile/stime.c (HAVE_POSIX_CPUTIME): Hack around buggy FreeBSD implementation of _POSIX_CPUTIME. Andy Wingo2011-05-201-3/+7
* scm_c_get_internal_run_time is more precise...* libguile/stime.h (SCM_TIME_UNITS_PER_SECOND): Redefine to point to a C variable instead of being a pure preprocessor thing. This has the possibility to break existing compiled C extensions' interpretation of the internal-time-units-per-second, but hopefully there's no too much of that code out there, and in the worst case they can just recompile. Scheme code will get it right without the need to recompile. * libguile/stime.c (TIME_UNITS_PER_SECOND): New local define, and increase to nanosecond resolution if we are on a system in which this is useful and practical. (time_from_seconds_and_nanoseconds): New helper. (get_internal_real_time, get_internal_run_time): New global vars: function pointers. (get_internal_real_time_posix_timer): (get_internal_run_time_posix_timer): (get_internal_real_time_gettimeofday): (get_internal_run_time_times): (get_internal_real_time_fallback): Various implementations. (scm_get_internal_real_time): Return the get_internal_real_time() result. (scm_c_get_internal_run_time): Likewise. (scm_gettimeofday): No need for a critical section, and remove obsolete ftime block. (scm_init_stime): Init all of the new time bases, and decide on implementations of real time and run time accessors. Andy Wingo2011-05-041-79/+165
* add scm_{to,from}_{utf8,latin1}_string{n,}...* libguile/strings.h: * libguile/strings.c (scm_from_latin1_string, scm_to_latin1_string): New functions, in terms of the latin1_stringn variants. (scm_from_utf8_string, scm_from_utf8_stringn) (scm_to_utf8_string, scm_to_utf8_stringn): New functions. (scm_i_from_utf8_string, scm_i_to_utf8_string): Removed these internal functions. (scm_from_stringn): Handle -1 as a length. Unlike the previous behavior of scm_from_locale_string (NULL), which returned the empty string, we now raise an error. The null pointer is not the same as the empty string. * libguile/stime.c (scm_strftime, scm_strptime): Adapt to publishing of utf8 functions. Andy Wingo2011-01-071-17/+14
* Fix stylistic issues revealed by "make syntax-check"....* libguile/gc-malloc.c (scm_must_free): Remove unnecessary `if' before `free ()'. * libguile/stime.c (scm_localtime, scm_mktime): Likewise. * libguile/eval.i.c (ceval): Don't cast the result of alloca(3). * libguile/i18n.c (SCM_STRING_TO_U32_BUF): Likewise. * test-suite/standalone/test-unwind.c: Likewise. * libguile/strings.c (scm_i_deprecated_string_chars): Don't end error message in period. Ludovic Courtès2009-11-171-5/+4
* Modify socket and time functions for wide strings...* libguile/socket.c (scm_recv): receive the message without holding the stringbuf writing lock (scm_send): try to narrow a string before using it * libguile/stime.c (strftime): convert string to UTF-8 so that it can be safely passed to strftime (strptime): convert input string to UTF-8 so that it can be safely passed through strptime * libguile/strings.c (narrow_stringbuf): new function (scm_i_try_narrow_string): new function * libguile/strings.h: new declaration for scm_i_try_narrow_string Michael Gran2009-08-231-15/+35
* Change Guile license to LGPLv3+...(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* ) Neil Jerram2009-06-171-6/+7
* gnulib-tool --import environ; rely on gnulib for environ definitions...* libguile/posix.c: * libguile/stime.c: Remove environ definition, gnulib provides it now. Andy Wingo2009-05-261-13/+0
* Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès2008-09-131-1/+1
* Use Gnulib's `strftime' to address bug #24130....* libguile/stime.c (scm_strftime): Use `nstrftime ()' from Gnulib. This provides the same semantics on all platforms, thereby fixing bug #24130. * doc/ref/posix.texi (Time): Remove note about non-portable `%Z' behavior. Describe the new, portable behavior. * test-suite/tests/time.test ("strftime")["strftime %Z doesn't return garbage"]: Reinstate. ["C99 %z format"](have-strftime-%z): Remove. ("GMT", "EST+5"): Don't use `have-strftime-%z'. Ludovic Courtès2008-09-021-4/+4
* Never define `_GNU_SOURCE' explicitly since `AC_USE_SYSTEM_EXTENSIONS'...takes care of it. Conflicts: ChangeLog configure.in libguile/eval.c libguile/srfi-14.c libguile/threads.c Ludovic Courtès2008-08-201-2/+1
* Changes from arch/CVS synchronizationLudovic Courtès2007-08-231-1/+3
* Add #define _REENTRANT, to get gmtime_r() prototype on...solaris 2.6. Reported by anirkko. Kevin Ryde2007-08-161-1/+2
* merge from 1.8 branchKevin Ryde2006-10-091-2/+16
* merge from 1.8 branchKevin Ryde2006-04-171-1/+1
* Renamed the "frames" that are related to dynamic-wind to "dynamic...contexts. Renamed all functions from scm_frame_ to scm_dynwind_. Updated documentation. Marius Vollmer2006-01-291-4/+4
* (scm_mktime): Use scm_frame_critical_section instead of...SCM_CRITICAL_SECTION_START/END since the code inside the critical section might exit non-locally. Marius Vollmer2005-11-061-2/+2
* (scm_strftime): Update docstring from posix.texi.Kevin Ryde2005-10-231-7/+16
* * hashtab.h: Bugfix: use SCM_API (WAS: extern)....* socket.c: Remove obsolete comment about socklen_t. (s_scm_setsockopt)[!HAVE_IP_MREQ]: Do not use ip_mreq code. * numbers.h (isnan)[__MINGW32__]: Remove. * Makefile.am (gen_scmconfig_SOURCES): Bugfix: Add DEFAULT_INCLUDES when cross compiling. * threads.c (ETIMEDOUT, pipe)[__MINGW32__]: Add defines. * stime.c (s_scm_strftime)[!HAVE_TM_ZONE]: Use SCM_SIMPLE_VECTOR_REF instead of SCM_VELTS. (Changed slightly from Jan's patch.) Marius Vollmer2005-06-051-6/+5
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
* Include "libguile/async.h" for SCM_CRITICAL_SECTION_START/END.Marius Vollmer2005-03-071-0/+1
* See ChangeLog from 2005-03-02.Marius Vollmer2005-03-021-17/+17
* (scm_mktime): Missing default errno=EINVAL from prev change.Kevin Ryde2005-01-101-1/+2
* (scm_strftime): Free t.tm_zone produced by bdtime2c....Reported by Bill Schottstaedt. Kevin Ryde2005-01-041-0/+3
* Use new vector elements API or simple vector API, as appropriate....Removed SCM_HAVE_ARRAYS ifdefery. Replaced all uses of SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET. Marius Vollmer2005-01-021-42/+32
* (_POSIX_C_SOURCE): Use this only on hpux, it...causes too many problems elsewhere (glibc, freebsd, mingw). Reported by Andreas Vögele. Kevin Ryde2004-09-081-1/+14
* (scm_current_time, scm_gettimeofday, scm_strptime): Don't...throw error before unlocking mutex with SCM_ALLOW_INTS. Kevin Ryde2004-09-071-8/+22
* 2004-09-03 Stefan Jahn <stefan@lkcc.org>... * configure.in (isinf): Let configure find the isinf() function on MinGW32 systems. 2004-09-03 Stefan Jahn <stefan@lkcc.org> * threads.c (scm_threads_mark_stacks): Fixed local variable definitions. * strings.c (scm_i_substring_copy, s_scm_string_append): Fixed local variable definitions. * stime.c (_POSIX_C_SOURCE): Do not define this item on MinGW32 because it conflicts with its pthread headers. (s_scm_mktime): Consider the HAVE_STRUCT_TM_TM_ZONE define. (s_scm_strftime): Using scm_from_locale_string() instead of scm_makfrom0str(). * posix.c (s_scm_putenv): Fixed typo in the !HAVE_UNSETENV part. * numbers.c (scm_init_numbers): Removed check_sanity() call inside GUILE_DEBUG. The function has been removed somewhen... * filesys.c (_POSIX_C_SOURCE): Do not define this item on MinGW32 because it conflicts with its pthread headers. 2004-09-03 Stefan Jahn <stefan@lkcc.org> * srfi-1.c, srfi-1.h: Renamed any 'lst1' into 'list1' because lst1 is a #define on Win32 systems. Stefan Jahn2004-09-031-1/+5
* * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,...scm_i_string_writable_chars, scm_i_string_stop_writing): New, to replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH. Updated all uses. (scm_i_make_string, scm_c_make_string): New, to replace scm_allocate_string. Updated all uses. (SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS, SCM_STRING_LENGTH): Deprecated. (scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string, scm_str2string, scm_makfrom0str, scm_makfrom0str_opt): Discouraged. Replaced all uses with scm_from_locale_string or similar, as appropriate. (scm_c_string_length, scm_c_string_ref, scm_c_string_set_x, scm_c_substring, scm_c_substring_shared, scm_c_substring_copy, scm_substring_shared, scm_substring_copy): New. * symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC, SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS, SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol, scm_str2symbol, scm_mem2uninterned_symbol): Discouraged. (SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str): Deprecated. (SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS, SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed. (scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln): New, to replace scm_str2symbol and scm_mem2symbol, respectively. Updated all uses. (scm_gensym): Generate only the number suffix in the buffer, just string-append the prefix. Marius Vollmer2004-08-191-9/+18
* * stime.c, socket.c, simpos.c, procs.c, posix.c, ports.c,...net_db.c, fports.c, filesys.c, eval.c, deprecation.c, dynl.c: Replaced uses of SCM_STRING_CHARS with proper uses of scm_to_locale_string. Replaced SCM_STRINGP with scm_is_string. Replaced scm_mem2string with scm_from_locale_string. * simpos.c, posix.c (allocate_string_pointers, environ_list_to_c): Removed, replaced all uses with scm_i_allocate_string_pointers. Marius Vollmer2004-08-101-5/+9
* * numbers.h, numbers.c, discouraged.h, discouraged.c (scm_short2num,...scm_ushort2num, scm_int2num, scm_uint2num, scm_long2num, scm_ulong2num, scm_size2num, scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint, scm_num2long, scm_num2ulong, scm_num2size, scm_num2ptrdiff, scm_long_long2num, scm_ulong_long2num, scm_num2long_long, scm_num2ulong_long): Discouraged by moving to discouraged.h and discouraged.c and reimplementing in terms of scm_from_* and scm_to_*. Changed all uses to the new scm_from_* and scm_to_* functions. Marius Vollmer2004-08-021-16/+18
* * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,...SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP and SCM_I_INUM, respectively and adding deprecated versions to deprecated.h and deprecated.c. Changed all uses to either use the SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate. Marius Vollmer2004-07-231-27/+28
* * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to...SCM_I_MAKINUM and changed all uses. Marius Vollmer2004-07-081-17/+17
* * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,...SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h". Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively. Marius Vollmer2004-07-061-3/+3
* (_POSIX_C_SOURCE): Define to 199506L to get gmtime_r (in...particular on HP-UX). Reported by Andreas Vögele. Kevin Ryde2004-04-271-0/+1
* (scm_gmtime): Use gmtime_r when available, for thread safety.Kevin Ryde2004-03-201-7/+20