• Philipp Stephani's avatar
    Add conversions to and from struct timespec to module interface. · bffceab6
    Philipp Stephani authored
    Time values are a fundamental data type, and such conversions are hard
    to implement within modules because of the various forms of time
    values in Emacs Lisp.  Adding dedicated conversion functions can
    significantly simplify module code dealing with times.
    
    This approach uses nanosecond precision.  While Emacs in theory has
    support for higher-precision time values, in practice most languages
    and standards, such as POSIX, C, Java, and Go, have settled on
    nanosecond-precision integers to represent time.
    
    * src/emacs-module.h.in: Add header for struct timespec.
    
    * src/module-env-27.h: Add module functions for time conversion.
    
    * src/emacs-module.c (module_extract_time, module_make_time): New
    functions.
    (initialize_environment): Use them.
    
    * test/data/emacs-module/mod-test.c (Fmod_test_add_nanosecond): New
    test function.
    (emacs_module_init): Define it.
    
    * test/src/emacs-module-tests.el (mod-test-add-nanosecond/valid)
    (mod-test-add-nanosecond/nil, mod-test-add-nanosecond/invalid): New
    unit tests.
    
    * doc/lispref/internals.texi (Module Values): Document time
    conversion functions.
    bffceab6
Name
Last commit
Last update
admin Loading commit data...
build-aux Loading commit data...
doc Loading commit data...
etc Loading commit data...
leim Loading commit data...
lib Loading commit data...
lib-src Loading commit data...
lisp Loading commit data...
lwlib Loading commit data...
m4 Loading commit data...
modules Loading commit data...
msdos Loading commit data...
nextstep Loading commit data...
nt Loading commit data...
oldXMenu Loading commit data...
src Loading commit data...
test Loading commit data...
.clang-format Loading commit data...
.dir-locals.el Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
BUGS Loading commit data...
CONTRIBUTE Loading commit data...
COPYING Loading commit data...
ChangeLog.1 Loading commit data...
ChangeLog.2 Loading commit data...
ChangeLog.3 Loading commit data...
GNUmakefile Loading commit data...
INSTALL Loading commit data...
INSTALL.REPO Loading commit data...
Makefile.in Loading commit data...
README Loading commit data...
autogen.sh Loading commit data...
config.bat Loading commit data...
configure.ac Loading commit data...
make-dist Loading commit data...