bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new module 'c-nstrftime'


From: Bruno Haible
Subject: new module 'c-nstrftime'
Date: Thu, 08 Feb 2024 01:29:54 +0100

Paul Eggert suggested a new module 'c-nstrftime', as the base for the
migration away from function 'ctime'.

These two patches implement it.


2024-02-07  Bruno Haible  <bruno@clisp.org>

        c-nstrftime: Add tests.
        * tests/test-c-nstrftime.c: New file, based on tests/test-nstrftime.c.
        * tests/test-c-nstrftime-1.sh: New file, based on
        tests/test-nstrftime-1.sh.
        * tests/test-c-nstrftime-2.sh: New file, based on
        tests/test-nstrftime-2.sh.
        * modules/c-nstrftime-tests: New file.

        c-nstrftime: New module.
        Suggested by Paul Eggert.
        * lib/strftime.h (c_nstrftime): New declaration.
        * lib/c-nstrftime.c: New file.
        * lib/strftime.c (FPRINTFTIME): Move fallback definition before its
        first use.
        (USE_C_LOCALE): Add fallback definition.
        If USE_C_LOCALE is set, include c-ctype.h instead of <ctype.h>.
        Conditionally include <locale.h>.
        (TOUPPER, TOLOWER): Define differently if USE_C_LOCALE is set.
        (c_locale_cache, c_locale): New definitions, copied from lib/c-strtod.c.
        (c_weekday_names, c_month_names): New variables, based on
        glibc/time/strftime_l.c.
        (__strftime_internal): Define a_wkday, aw_len, f_wkday, a_month, am_len,
        f_month, ampm, ap_len differently for USE_C_LOCALE. Avoid a
        'goto underlying_strftime' if USE_C_LOCALE && !HAVE_STRFTIME_L. If
        USE_C_LOCALE, use strftime_l() with the C locale object instead of
        strftime().
        * m4/c-nstrftime.m4: New file, based on m4/nstrftime.m4.
        * modules/c-nstrftime: New file, based on modules/nstrftime.

Attachment: 0001-c-nstrftime-New-module.patch
Description: Text Data

Attachment: 0002-c-nstrftime-Add-tests.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]