aboutsummaryrefslogtreecommitdiff
path: root/jim-clock.c
AgeCommit message (Collapse)AuthorFilesLines
2023-03-20build: define _GNU_SOURCE only on the command lineSteve Bennett1-12/+0
Not in source files See https://ariadne.space/2021/12/21/stop-defining-feature-test-macros-in-your-code/ Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-02-13clock millis, time: now use monotonic raw time if possibleSteve Bennett1-14/+9
Instead of using all time, these commands now use a monotonically increasing system timer so that they are not affected by time (e.g. ntp) adjustments. (But not on Windows since it doesn't work reliably) Fixes #240 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-01-10package: add ABI version checkingSteve Bennett1-3/+1
jim.h now includes JIM_ABI_VERSION that should be incremented whenever the ABI changes. Then all loadable modules should call Jim_CheckAbiVersion() to make sure they are loaded against the correct version. Add Jim_PackageProvideCheck() that does both Jim_CheckAbiVersion() and Jim_PackageProvide() to simplify the implementation of loadable extensions. Also rename the "big" sqlite3 extension to just sqlite to avoid a naming conflict with the smaller jim-sqlite3 extension. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-05-20clock scan: Implement timegm() locallySteve Bennett1-18/+15
Don't rely on system timegm(), and use a locally implemented timegm() that doesn't rely on changing TZ in the environment Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-05-20clock scan: Unspecified fields use the current date/timeSteve Bennett1-5/+2
When scanning a time with unspecified fields, those fields should use the current date/time, not 1 Jan 1900. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-18clock: Fix clock format on mingw platformsSteve Bennett1-4/+6
gmtime() fails for negative time_t values. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-18clock: Add -gmt option to format and scanSteve Bennett1-35/+108
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-21many comment changes, some small code changesSteve Bennett1-2/+1
Sweep through and clean up all (most) of the comments in the code. While there, adjust some variable and function names to be more consistent, and make a few small code changes - again, mostly for consistency. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15clock: remove an extra space from the default formatSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15clock: handle case of format string too longSteve Bennett1-1/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-24Create build-jim-ext for building extensionsSteve Bennett1-2/+1
Simplifies the process of building loadable extensions Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-07Allow building with MSVC on windowsSteve Bennett1-1/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-07Remove use of designated initialisersSteve Bennett1-33/+37
For better compatibility c89 compatibility. Also simplify jim-subcmd. Remove -usage and command descriptions. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-09Revert to using localtime() and rand()Steve Bennett1-2/+1
Some platforms don't have localtime_r() and rand_r()
2011-06-01Add Jim_String() macroSteve Bennett1-2/+2
It is very common to get the string value without the length. Jim_String() is a macro which does that. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-12-21Minor compiler warning fixesSteve Bennett1-0/+2
Also, don't define _XOPEN_SOURCE if already defined Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-09Allow jim to be used as an autoconf subdirSteve Bennett1-0/+1
Ensure that no public headers include the autoconf header, jimautoconf.h, as it leads to problems with redefined symbols. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add support for clock clicks, micros, millisSteve Bennett1-0/+41
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Make jim more reentrantSteve Bennett1-2/+3
Make the exec wait table allocated and per-interpeter Use reentrant variants of some libc calls Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Ensure that Tcl extensions can be built-in or externalSteve Bennett1-0/+3
All C extensions must call Jim_PackageProvide() make-c-ext ensures that Tcl extensions call Jim_PackageProvide() if compiled in. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix QNX buildSteve Bennett1-1/+1
Which wants _XOPEN_SOURCE defined to something particular Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Clean up the indentation messSteve Bennett1-6/+4
Use 'indent'. Not perfect, but at least consistent. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improvements to jim configureSteve Bennett1-0/+4
Create and use config.h Check for backtrace, fork, vfork, syslog, regcomp and others Disable extensions which require missing functions/features Check for one arg vs. two arg mkdir() Distinguish between mingw and native windows The aio extension has reduced functionality for ANSI C only Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Add Jim_SetResultFormatted() for simplied messagesSteve Bennett1-2/+2
Makes creating error messages much simpler Also convert a couple of long if/else to switch Also some error message improvements Also fix some memory leaks
2010-10-15Make static extensions buildSteve Bennett1-1/+1
Also clean up some white space
2010-10-15Add clock commandSteve Bennett1-0/+110