Christos Zoulas wrote:
just adjust the prototypes how you like them, and I will take care of the rest
Thanks. I looked into doing that and found two more issues. First, there's no need for timelocal_z. timelocal is merely an ancient (pre-C89) compatibility function, superseded by mktime. There's no need to expand it, as callers can easily use mktime_z. Let's remove it. Second and more important, strftime_z has an unnecessary timezone_t argument. This argument is present to format %Z and %z, but NetBSD can format %Z from the tm_zone member of struct tm, and similarly for %z and tm_gmtoff. The timezone_t argument was invented under the idea that a strictly conforming C application can leave tm_zone and tm_gmtoff in an undefined state. Although this is true for strftime, it need not and should not be true for a new function that we define, as we can impose the restriction that if the new function is used with %Z and %z, its struct tm argument must have filled-in values. This way, the new function will do the right thing in zones that have three or more time zone abbreviations, or three or more UTC offsets, which is relatively common. In contrast strftime_z handles only the two most-current abbreviations and offsets, and this botches historical time stamps. Let's call the new function tm_strftime instead of strftime_z. It doesn't have a time zone argument so the trailing "_z" would be misleading. The "tm_" prefix can be a mnemonic that this strftime trusts its struct tm argument; also, the "tm_" prefix is reserved by POSIX for time.h extensions so it helps to avoids namespace pollution. Similarly for strftime_lz, renaming it to tm_strftime_l. A preliminary proposed patch to NetBSD-current sources attached. Again, I don't know how NetBSD does deprecation. Also, I have not tried to compile or test this.