Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6b8b6f43-8c53-42ad-a7e5-187b05997950@cs.ucla.edu>
Date: Wed, 21 Jun 2023 14:18:26 -0700
From: Paul Eggert <eggert@...ucla.edu>
To: enh <enh@...gle.com>, Guy Harris <gharris@...ic.net>
Cc: Time zone mailing list <tz@...a.org>, libc-coord@...ts.openwall.com
Subject: Re: [tz] thread-safe localtime() for an arbitrary
 timezone

On 2023-06-21 12:50, enh wrote:
> my preference would be for timezone_t to be more like DIR...
> 
> typedef struct DIR DIR;

Although that would also work, that's not how NetBSD did things when it 
introduced timezone_t in NetBSD 6.0 (2012), and tzcode copied this part 
of NetBSD in tzdb 2014g. I doubt whether we should change the meaning of 
timezone_t at this point, as it'd be too much backward-compatibility hassle.

We could use a different name, though, for the struct. How about if we 
change this line in tzcode private.h:

   typedef struct state *timezone_t;

to the following?

   typedef struct tm_timezone *timezone_t;

and change all other instances of "struct state" to "struct tm_timezone"?

This would let users write "struct tm_timezone *" and "timezone_t" 
interchangeably. The name tm_timezone, like timezone_t, is reserved by 
POSIX when you include <time.h>[1], so if the <time.h> implementation 
uses this name it won't break any conforming programs.

[1]: 
https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02_02

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.