lib/libc/strptime.h|c

Neil Williams linux at codehelp.co.uk
Sun Aug 7 11:13:30 EDT 2005


On Sunday 07 August 2005 3:30 pm, David Hampton wrote:
> On Sun, 2005-08-07 at 13:55 +0100, Neil Williams wrote:
> > In sixtp-utils.c, we currently have:
> >
> > #ifndef HAVE_STRPTIME
> > #include "strptime.h"
> > #endif
> > #ifndef HAVE_LOCALTIME_R
> > #include "localtime_r.h"
> > #endif
> > and files in lib/libc:
> > libc-missing-noop.c  localtime_r.c  localtime_r.h  Makefile.am 
> > scm_strptime.c strptime.c  strptime.h
> > 
> > instead of
> > #include <time.h>
> >
> > What is the reason for this?
>
> Its there to provide the strptime() and localtime_r() functions for any
> system that don't provide them as part of libc.  This is an autotools
> semi-standard for insuring that a required function exists on all
> systems the program is compiled on.  The native function will be used
> whereever it can be found, and the program private function will be used
> only as a fallback.

I guessed as much, hence my main question:

> > Do we still need it?
>
> Don't know.  I don't know what system it was originally added for, and I
> haven't run across a system where these functions had to be compiled.
> Doesn't mean there still isn't one.

Perhaps some of the package maintainers on the list could provide an answer - 
currently I'll have to work with <time.h> and cross this particular bridge 
only when it is time to fold CashUtil into the full GnuCash source tree (at 
which time it'll probably be covered by the GnuCash automake magic anyway). 
However, CashUtil, QSF and QOF use <time.h> in multiple areas without any 
recourse to lib/libc - I guess we'll find out when these come to be ported to 
a wider range of platforms. I've already got #ifdef handling for some MacOSX 
vagaries but <time.h>, strptime and localtime (if not localtime_r) are used 
without difficulty.

In the meantime, it joins a list of anomalies in the GnuCash v2 XML backend 
which also includes the GConf settings in gnc-backend-file.c for file 
compression and retention days. I may incorporate GConf into CashUtil in due 
course as CashUtil is likely to use a system of configurable defaults.

Can someone confirm that GConf is as readily available as Glib and libxml2?
(i.e. are there likely to be any systems that could run Glib that could NOT 
run GConf?)

-- 

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20050807/9f0736d6/attachment-0001.bin


More information about the gnucash-devel mailing list