httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@raleigh.ibm.com>
Subject Re: ap_current_time() is not intuitive
Date Mon, 03 Jan 2000 20:24:09 GMT

> 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).

The mode isn't currently visible to the user, I am afriad that always
constructing a time variable with a value will make it visible in strange
bugs.

> 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)

We really don't have any choice but to have a mode, especially not when
you look at what we do with the time values, Apache and I think most
programs, use time values in one of two modes, either # of seconds or
expanded.  I would not be adverse to creating a second initializer that
does fill in the time value.

> 
> 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]

I agree completely that the name is wrong.  This is what happens when one
person writes the code and just needs a name to use. :-)  I personally
like ap_get_ansi_time.  I'll fix the Unix side soon.

Ryan

_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
4205 S Miami Blvd	
RTP, NC 27709		

Come to the first official Apache Software Foundation
Conference!  <http://ApacheCon.Com/>



Mime
View raw message