<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 21, 2023 at 2:18 PM Paul Eggert <<a href="mailto:eggert@cs.ucla.edu">eggert@cs.ucla.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2023-06-21 12:50, enh wrote:<br>
> my preference would be for timezone_t to be more like DIR...<br>
> <br>
> typedef struct DIR DIR;<br>
<br>
Although that would also work, that's not how NetBSD did things when it <br>
introduced timezone_t in NetBSD 6.0 (2012), and tzcode copied this part <br>
of NetBSD in tzdb 2014g. I doubt whether we should change the meaning of <br>
timezone_t at this point, as it'd be too much backward-compatibility hassle.<br>
<br>
We could use a different name, though, for the struct. How about if we <br>
change this line in tzcode private.h:<br>
<br>
typedef struct state *timezone_t;<br>
<br>
to the following?<br>
<br>
typedef struct tm_timezone *timezone_t;<br>
<br>
and change all other instances of "struct state" to "struct tm_timezone"?<br>
<br>
This would let users write "struct tm_timezone *" and "timezone_t" <br>
interchangeably. The name tm_timezone, like timezone_t, is reserved by <br>
POSIX when you include <time.h>[1], so if the <time.h> implementation <br>
uses this name it won't break any conforming programs.<br></blockquote><div><br></div><div>(i just checked and NetBSD does have `typedef struct __state *timezone_t;` in its <time.h>. my objection to that is that the compiler will actually use the underlying name in error messages, which is less than helpful if the names aren't close. so having s/state/tm_timezone/ seems like a step forward even just in that regard!)</div><div><br></div><div>up to you (especially since my #define in "private.h" is unlikely to be much of a maintenance burden), but "i'd use this" (if only to get rid of my #define)...</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[1]: <br>
<a href="https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02_02" rel="noreferrer" target="_blank">https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02_02</a><br>
</blockquote></div></div>