httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: ap_current_time() is not intuitive
Date Mon, 03 Jan 2000 20:12:36 GMT
On Mon, 3 Jan 2000 rbb@apache.org wrote:
>...
> I really think it would be a mistake to get the current time when we
> create the time instance, because we always represent the time in two
> forms inside the APR type.  Figuring out which of those two forms is the
> one we really care about is hard to do if we always fill out one of them.

Are you saying that the ap_time_t structure has a "mode"? If it does, then
it shouldn't be visible to the caller. I should be able to create one,
initialize it with a time (from anywhere), and then get the value (in any
format).

If you truly insist on a mode, then have several constructors. One of them
can create an ap_time_t with the current time. (I do agree that
initializing it with the current time adds a syscall when we might not
want it)

ap_get_curtime() is the wrong name. It does sound like "get me the current
time" rather than "return the ap_time_t's time in seconds since the
epoch." I would suggest renaming it ap_get_seconds() or maybe
ap_get_ansi_time(). [it is the ANSI-defined C time, not Unix time]

Happy New Year,
-g

-- 
Greg Stein, http://www.lyra.org/


Mime
View raw message