bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `nstrftime ()' prototype


From: Jim Meyering
Subject: Re: `nstrftime ()' prototype
Date: Sun, 31 Aug 2008 17:35:58 +0200

address@hidden (Ludovic Courtès) wrote:
> address@hidden (Ludovic Courtès) writes:
>
>> I'm trying to fix a portability bug related to `strftime(3)' [0].  The
>> `strftime' module doesn't provide `strftime ()' as one would expect but
>> instead provides `nstrftime ()', with additional arguments:
>> int ut, int ns.  What are these arguments about?
>
> I just remembered I didn't get an answer to the above question.  :-)
>
> (Since I'm too lazy I think I'd rather use `nstrftime ()' than write a
> new module providing `strftime ()'.)

Here's some long-overdue documentation:

>From 4bb481aef2793a2cd25d61113d58da42af2bf8a8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 31 Aug 2008 17:34:24 +0200
Subject: [PATCH] * lib/strftime.h: Add comments describing the two added 
arguments.

---
 ChangeLog      |    2 ++
 lib/strftime.h |   10 ++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 99ab461..4592840 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2008-08-31  Jim Meyering  <address@hidden>

+       * lib/strftime.h: Add comments describing the two added arguments.
+
        remove duplicate #include directives
        * lib/chdir-long.c [TEST_CHDIR]: Remove duplicate #include <stdio.h>.
        * lib/putenv.c: Remove duplicate #include <stdlib.h>.
diff --git a/lib/strftime.h b/lib/strftime.h
index ae9cc6b..c3c183e 100644
--- a/lib/strftime.h
+++ b/lib/strftime.h
@@ -1,6 +1,6 @@
 /* declarations for strftime.c

-   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2008 Free Software Foundation, Inc.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -17,4 +17,10 @@

 #include <time.h>

-size_t nstrftime (char *, size_t, char const *, struct tm const *, int, int);
+/* Just like strftime, but with two more arguments:
+   POSIX requires that strftime use the local timezone information.
+   When __UTC is nonzero and tm->tm_zone is NULL or the empty string,
+   use UTC instead.  Use __NS as the number of nanoseconds in the
+   %N directive.  */
+size_t nstrftime (char *, size_t, char const *, struct tm const *,
+                 int __utc, int __ns);
--
1.6.0.1.157.g7df43




reply via email to

[Prev in Thread] Current Thread [Next in Thread]