You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Sascha Schumann <sa...@schumann.cx> on 1999/12/29 23:46:39 UTC
ap_strftime
Why is ap_strftime declared as returning ap_status_t, but
does not return anything? Does not look correct to me.
ap_status_t ap_strftime(char *s, ap_size_t max, const char
*format, struct atime_t *tm)
{
strftime(s, max, format, tm->explodedtime);
}
src/lib/apr/time/unix/timestr.c
--
Regards,
Sascha Schumann
Consultant
Re: ap_strftime
Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
On Thu, 30 Dec 1999, Dean Gaudet wrote:
> i worry only about namespace collision...
I know, I've had the same worry. The advantage to the way things are
currently written, is that we can easily change the internal name without
affecting anything external. My current thought, is leave it alone for
now, and if there is a problem later, it will take a half-day to fix it.
We should come to a decision on this before we actually release Apache
2.0, but for right now, I think we are safe.
Ryan
>
> On Thu, 30 Dec 1999, Ryan Bloom wrote:
>
> > On Wed, 29 Dec 1999, Dean Gaudet wrote:
> >
> > > > > ap_status_t ap_strftime(char *s, ap_size_t max, const char
> > > > > *format, struct atime_t *tm)
> > >
> > > struct atime_t ? shouldn't that be ap_time_t ?
> >
> > Nope. Because we are using incomplete types, I have two basic naming
> > conventions. Inside APR in the library that defines the type, we are
> > using the format "struct basetype_t". Outside of APR, this is defined to
> > be "ap_basetype_t", and we use that outside of the APR library. Yes, I
> > could have named the struct ap_basetype_t, but I was hoping that by not
> > naming them the same things, people would be forced to look around and
> > figure out the incomplete types stuff. Not sure if this was a good design
> > or not, but it has let me find a bug or two very quickly.
> >
> > 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/>
Re: ap_strftime
Posted by Dean Gaudet <dg...@arctic.org>.
i worry only about namespace collision...
Dean
On Thu, 30 Dec 1999, Ryan Bloom wrote:
> On Wed, 29 Dec 1999, Dean Gaudet wrote:
>
> > > > ap_status_t ap_strftime(char *s, ap_size_t max, const char
> > > > *format, struct atime_t *tm)
> >
> > struct atime_t ? shouldn't that be ap_time_t ?
>
> Nope. Because we are using incomplete types, I have two basic naming
> conventions. Inside APR in the library that defines the type, we are
> using the format "struct basetype_t". Outside of APR, this is defined to
> be "ap_basetype_t", and we use that outside of the APR library. Yes, I
> could have named the struct ap_basetype_t, but I was hoping that by not
> naming them the same things, people would be forced to look around and
> figure out the incomplete types stuff. Not sure if this was a good design
> or not, but it has let me find a bug or two very quickly.
>
> 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/>
>
>
>
Re: ap_strftime
Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
On Wed, 29 Dec 1999, Dean Gaudet wrote:
> > > ap_status_t ap_strftime(char *s, ap_size_t max, const char
> > > *format, struct atime_t *tm)
>
> struct atime_t ? shouldn't that be ap_time_t ?
Nope. Because we are using incomplete types, I have two basic naming
conventions. Inside APR in the library that defines the type, we are
using the format "struct basetype_t". Outside of APR, this is defined to
be "ap_basetype_t", and we use that outside of the APR library. Yes, I
could have named the struct ap_basetype_t, but I was hoping that by not
naming them the same things, people would be forced to look around and
figure out the incomplete types stuff. Not sure if this was a good design
or not, but it has let me find a bug or two very quickly.
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/>
Re: ap_strftime
Posted by Dean Gaudet <dg...@arctic.org>.
> > ap_status_t ap_strftime(char *s, ap_size_t max, const char
> > *format, struct atime_t *tm)
struct atime_t ? shouldn't that be ap_time_t ?
Dean
Re: ap_strftime
Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
That's an easy question to answer. I wrote it quickly to get things
working a few weeks ago, and forgot to fix it. I'll get to it tomorrow
some time. It does need to return something.
Ryan
On Wed, 29 Dec 1999, Sascha Schumann wrote:
> Why is ap_strftime declared as returning ap_status_t, but
> does not return anything? Does not look correct to me.
>
> ap_status_t ap_strftime(char *s, ap_size_t max, const char
> *format, struct atime_t *tm)
> {
> strftime(s, max, format, tm->explodedtime);
> }
>
> src/lib/apr/time/unix/timestr.c
>
> --
>
> Regards,
>
> Sascha Schumann
> Consultant
>
_______________________________________________________________________
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/>