changeset 8048:005cc63d6763

New module 'strptime'. Initial fixes.
author Bruno Haible <bruno@clisp.org>
date Mon, 29 Jan 2007 17:33:12 +0000
parents 4926328afe92
children 93b9f2a87f93
files ChangeLog MODULES.html.sh lib/strptime.h modules/strptime
diffstat 4 files changed, 20 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-01-29  Bruno Haible  <bruno@clisp.org>
+
+	* MODULES.html.sh (Support for systems lacking POSIX:2001): Add
+	strptime.
+	* modules/strptime (Depends-on): Add stdbool.
+	* lib/strptime.h: Include <time.h> always. Add comments.
+
 2007-01-29  Yoann Vandoorselaere  <yoann@prelude-ids.org>
 
 	* modules/strptime: New file.
--- a/MODULES.html.sh
+++ b/MODULES.html.sh
@@ -1959,6 +1959,7 @@
   func_module rmdir
   func_module sigprocmask
   func_module ssize_t
+  func_module strptime
   func_module strtok_r
   func_module sys_stat
   func_module sys_time
--- a/lib/strptime.h
+++ b/lib/strptime.h
@@ -1,5 +1,5 @@
-/* Searching in a string.
-   Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc.
+/* Convert a string representation of time to a tm structure.
+   Copyright (C) 2001-2003, 2005, 2007 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
@@ -18,10 +18,12 @@
 #ifndef GNULIB_STRPTIME_H_
 #define GNULIB_STRPTIME_H_
 
-#if HAVE_STRPTIME
-# include <time.h>
-#else
-extern char *strptime(const char *s, const char *format, struct tm *tm);
+#include <time.h>
+
+#if ! HAVE_STRPTIME
+/* See the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/strptime.html>.  */
+extern char *strptime (const char *s, const char *format, struct tm *tm);
 #endif
 
-#endif
+#endif /* GNULIB_STRPTIME_H_ */
--- a/modules/strptime
+++ b/modules/strptime
@@ -1,15 +1,16 @@
 Description:
-convert a string representation of time to a time tm structure
+Convert a string representation of time to a tm structure.
 
 Files:
+lib/strptime.h
 lib/strptime.c
-lib/strptime.h
 m4/strptime.m4
 
 Depends-on:
 sys_time
 string
 strcase
+stdbool
 
 configure.ac:
 gl_FUNC_STRPTIME