about summary refs log tree commit diff
path: root/time
diff options
context:
space:
mode:
Diffstat (limited to 'time')
-rw-r--r--time/Makefile8
-rw-r--r--time/Versions9
-rw-r--r--time/strftime_l.c22
-rw-r--r--time/time.h25
-rw-r--r--time/wcsftime_l.c22
5 files changed, 80 insertions, 6 deletions
diff --git a/time/Makefile b/time/Makefile
index f60dee0e28..5e55e3539f 100644
--- a/time/Makefile
+++ b/time/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1991-1999,2000,01,02 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -24,12 +24,12 @@ subdir	:= time
 headers	:= time.h sys/time.h sys/timeb.h bits/time.h
 
 routines := offtime asctime clock ctime ctime_r difftime \
-	    gmtime localtime mktime strftime time	 \
+	    gmtime localtime mktime time		 \
 	    gettimeofday settimeofday adjtime tzset	 \
 	    tzfile getitimer setitimer			 \
 	    stime dysize timegm ftime			 \
-	    strptime getdate wcsftime
-
+	    strptime getdate				 \
+	    strftime wcsftime strftime_l wcsftime_l
 distribute := datemsk
 
 tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
diff --git a/time/Versions b/time/Versions
index f3bbb4df8b..616da7edc2 100644
--- a/time/Versions
+++ b/time/Versions
@@ -50,4 +50,13 @@ libc {
     # w*
     wcsftime;
   }
+  GLIBC_2.3 {
+    # s*
+    strftime_l;
+    # w*
+    wcsftime_l;
+
+    # these internal names are used by libstdc++
+    __strftime_l; __wcsftime_l;
+  }
 }
diff --git a/time/strftime_l.c b/time/strftime_l.c
new file mode 100644
index 0000000000..c6ecada4ce
--- /dev/null
+++ b/time/strftime_l.c
@@ -0,0 +1,22 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#define USE_IN_EXTENDED_LOCALE_MODEL 1
+#include <strftime.c>
+
+weak_alias (__strftime_l, strftime_l)
diff --git a/time/time.h b/time/time.h
index 117bf7b88f..dd7ce8dec5 100644
--- a/time/time.h
+++ b/time/time.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1999,2000,01,02 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -188,6 +188,28 @@ extern char *strptime (__const char *__restrict __s,
      __THROW;
 # endif
 
+# ifdef __USE_GNU
+/* Similar to the two functions above but take the information from
+   the provided locale and not the global locale.  */
+# include <xlocale.h>
+
+extern size_t __strftime_l (char *__restrict __s, size_t __maxsize,
+			    __const char *__restrict __format,
+			    __const struct tm *__restrict __tp,
+			    __locale_t __loc) __THROW;
+extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
+			  __const char *__restrict __format,
+			  __const struct tm *__restrict __tp,
+			  __locale_t __loc) __THROW;
+
+extern char *__strptime_l (__const char *__restrict __s,
+			   __const char *__restrict __fmt, struct tm *__tp,
+			   __locale_t __loc) __THROW;
+extern char *strptime_l (__const char *__restrict __s,
+			 __const char *__restrict __fmt, struct tm *__tp,
+			 __locale_t __loc) __THROW;
+# endif
+
 
 /* Return the `struct tm' representation of *TIMER
    in Universal Coordinated Time (aka Greenwich Mean Time).  */
@@ -358,7 +380,6 @@ extern int getdate_r (__const char *__restrict __string,
 		      struct tm *__restrict __resbufp) __THROW;
 # endif
 
-
 __END_DECLS
 
 #endif /* <time.h> included.  */
diff --git a/time/wcsftime_l.c b/time/wcsftime_l.c
new file mode 100644
index 0000000000..969289710c
--- /dev/null
+++ b/time/wcsftime_l.c
@@ -0,0 +1,22 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#define USE_IN_EXTENDED_LOCALE_MODEL 1
+#include <wcsftime.c>
+
+weak_alias (__wcsftime_l, wcsftime_l)