• 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
..
charsets Loading commit data...
e Loading commit data...
forms Loading commit data...
gnus Loading commit data...
images Loading commit data...
nxml Loading commit data...
org Loading commit data...
refcards Loading commit data...
schema Loading commit data...
srecode Loading commit data...
themes Loading commit data...
tutorials Loading commit data...
AUTHORS Loading commit data...
CALC-NEWS Loading commit data...
COPYING Loading commit data...
ChangeLog.1 Loading commit data...
DEBUG Loading commit data...
DEVEL.HUMOR Loading commit data...
DISTRIB Loading commit data...
ERC-NEWS Loading commit data...
ETAGS.EBNF Loading commit data...
ETAGS.README Loading commit data...
HELLO Loading commit data...
HISTORY Loading commit data...
JOKES Loading commit data...
MACHINES Loading commit data...
MH-E-NEWS Loading commit data...
NEWS Loading commit data...
NEWS.1-17 Loading commit data...
NEWS.18 Loading commit data...
NEWS.19 Loading commit data...
NEWS.20 Loading commit data...
NEWS.21 Loading commit data...
NEWS.22 Loading commit data...
NEWS.23 Loading commit data...
NEWS.24 Loading commit data...
NEWS.25 Loading commit data...
NEWS.26 Loading commit data...
NEXTSTEP Loading commit data...
NXML-NEWS Loading commit data...
ORG-NEWS Loading commit data...
PROBLEMS Loading commit data...
README Loading commit data...
TERMS Loading commit data...
TODO Loading commit data...
compilation.txt Loading commit data...
edt-user.el Loading commit data...
emacs-buffer.gdb Loading commit data...
emacs.appdata.xml Loading commit data...
emacs.desktop Loading commit data...
emacs.icon Loading commit data...
emacs.service Loading commit data...
enriched.txt Loading commit data...
future-bug Loading commit data...
gnus-tut.txt Loading commit data...
grep.txt Loading commit data...
package-keyring.gpg Loading commit data...
ps-prin0.ps Loading commit data...
ps-prin1.ps Loading commit data...
publicsuffix.txt Loading commit data...
rgb.txt Loading commit data...
ses-example.ses Loading commit data...
spook.lines Loading commit data...
yow.lines Loading commit data...