• Paul Eggert's avatar
    Move timestamp-related stuff to timefns.c · b5d08da1
    Paul Eggert authored
    This does not change behavior; it’s just long-overdue
    refactoring (Bug#32902).
    * src/emacs.c (main): Call init_timefns, syms_of_timefns.
    * src/timefns.c: New file, containing timestamp-related stuff
    from editfns.c and sysdep.c.
    * src/Makefile.in (base_obj): Add timefns.o.
    * src/editfns.c: Simplify by moving a big chunk to timefns.c.
    Do not include systime.h, sys/resource.h, sys/param.h,
    strftime.h, coding.h.
    (local_tz, utc_tz, emacs_localtime_rz, emacs_mktime_z)
    (invalid_time_zone_specification, xtzfree, tzlookup)
    (TIME_T_MIN, TIME_T_MAX, time_overflow, invalid_time)
    (check_time_validity, hi_time, lo_time, Fcurrent_time)
    (time_add, time_subtract, time_arith, Ftime_add)
    (Ftime_subtract, Ftime_less_p, Fget_internal_run_time)
    (make_lisp_time, disassemble_lisp_time, decode_float_time)
    (lisp_to_timespec, lisp_time_struct, lisp_time_argument)
    (lisp_seconds_argument, Ffloat_time, emacs_nmemftime)
    (Fformat_time_string, format_time_string, Fdecode_time)
    (check_tm_member, Fencode_time, Fcurrent_time_string)
    (tm_gmtoff, Fcurrent_time_zone, Fset_time_zone_rule)
    (emacs_getenv_TZ, emacs_setenv_TZ): Move to timefns.c.
    * src/emacs.c (main): Adjust to initialization changes.
    * src/sysdep.c: Include <sys/resource.h> if it's present.
    Regularize includes a bit.
    (Fget_internal_run_time): Move here from editfns.c.
    (init_timefns, syms_of_timefns): New functions.
    * src/w32.h (w32_get_internal_run_time): Move decl here
    so that it need not be cloned.
    * test/src/editfns-tests.el:
    * test/src/editfns-tests.el (format-time-string-with-zone)
    Move to ...
    * test/src/timefns-tests.el: ... this new file.
editfns.c 140 KB