cvs-cvs
[Top][All Lists]
Advanced

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

[Cvs-cvs] ccvs/lib .cvsignore ChangeLog Makefile.am Makef...


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/lib .cvsignore ChangeLog Makefile.am Makef...
Date: Fri, 30 Jun 2006 01:58:56 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Derek Robert Price <dprice>     06/06/30 01:58:56

Modified files:
        lib            : .cvsignore ChangeLog Makefile.am 
                         Makefile.gnulib Makefile.in getaddrinfo.c 
                         getaddrinfo.h strftime.c 
Added files:
        lib            : stat_.h 

Log message:
        * .cvsignore: Add stat.h.
        * stat_.h: New file from GNULIB.
        * getaddrinfo.c, getaddrinfo.h, strftime.c, Makefile.gnulib: Update from
        GNULIB.
        * Makefile.am: Update to match Makefile.gnulib.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/.cvsignore?cvsroot=cvs&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/ChangeLog?cvsroot=cvs&r1=1.523&r2=1.524
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/Makefile.am?cvsroot=cvs&r1=1.114&r2=1.115
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/Makefile.gnulib?cvsroot=cvs&r1=1.77&r2=1.78
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/Makefile.in?cvsroot=cvs&r1=1.214&r2=1.215
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/getaddrinfo.c?cvsroot=cvs&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/getaddrinfo.h?cvsroot=cvs&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/strftime.c?cvsroot=cvs&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/ccvs/lib/stat_.h?cvsroot=cvs&rev=1.1

Patches:
Index: .cvsignore
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/.cvsignore,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- .cvsignore  11 May 2005 19:52:56 -0000      1.13
+++ .cvsignore  30 Jun 2006 01:58:56 -0000      1.14
@@ -11,6 +11,7 @@
 fnmatch.h
 glob.h
 getopt.h
+stat.h
 stdbool.h
 stdint.h
 getdate

Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/ChangeLog,v
retrieving revision 1.523
retrieving revision 1.524
diff -u -b -r1.523 -r1.524
--- ChangeLog   29 Jun 2006 12:13:26 -0000      1.523
+++ ChangeLog   30 Jun 2006 01:58:56 -0000      1.524
@@ -1,8 +1,9 @@
 2006-06-29  Derek Price  <address@hidden>
 
-       * inet_ntop.c, inet_ntop.h, wcwidth.h: New files from GNULIB.
-       * getaddrinfo.c, getaddrinfo.h, mbchar.h, Makefile.gnulib: Update from
-       GNULIB.
+       * .cvsignore: Add stat.h.
+       * inet_ntop.c, inet_ntop.h, stat_.h, wcwidth.h: New files from GNULIB.
+       * getaddrinfo.c, getaddrinfo.h, mbchar.h, strftime.c, Makefile.gnulib:
+       Update from GNULIB.
        * Makefile.am: Update to match Makefile.gnulib.
 
 2006-06-27  Mark D. Baushke  <address@hidden>

Index: Makefile.am
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/Makefile.am,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -b -r1.114 -r1.115
--- Makefile.am 29 Jun 2006 12:13:26 -0000      1.114
+++ Makefile.am 30 Jun 2006 01:58:56 -0000      1.115
@@ -412,6 +412,23 @@
 
 ## end   gnulib module sys_socket
 
+## begin gnulib module sys_stat
+
+BUILT_SOURCES += $(SYS_STAT_H)
+EXTRA_DIST += stat_.h
+
+# We need the following in order to create <sys/stat.h> when the system
+# has one that is incomplete.
+sys/stat.h: stat_.h
+       test -d sys || mkdir sys
+       sed -e 's|@''FULL_PATH_SYS_STAT_H''@|$(FULL_PATH_SYS_STAT_H)|g' \
+           < $(srcdir)/stat_.h > address@hidden
+       mv address@hidden $@
+MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
+MOSTLYCLEANDIRS += sys
+
+## end   gnulib module sys_stat
+
 ## begin gnulib module unistd
 
 BUILT_SOURCES += $(UNISTD_H)

Index: Makefile.gnulib
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/Makefile.gnulib,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -b -r1.77 -r1.78
--- Makefile.gnulib     29 Jun 2006 12:13:26 -0000      1.77
+++ Makefile.gnulib     30 Jun 2006 01:58:56 -0000      1.78
@@ -354,6 +354,23 @@
 
 ## end   gnulib module sys_socket
 
+## begin gnulib module sys_stat
+
+BUILT_SOURCES += $(SYS_STAT_H)
+EXTRA_DIST += stat_.h
+
+# We need the following in order to create <sys/stat.h> when the system
+# has one that is incomplete.
+sys/stat.h: stat_.h
+       test -d sys || mkdir sys
+       sed -e 's|@''FULL_PATH_SYS_STAT_H''@|$(FULL_PATH_SYS_STAT_H)|g' \
+           < $(srcdir)/stat_.h > address@hidden
+       mv address@hidden $@
+MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
+MOSTLYCLEANDIRS += sys
+
+## end   gnulib module sys_stat
+
 ## begin gnulib module unistd
 
 BUILT_SOURCES += $(UNISTD_H)

Index: Makefile.in
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/Makefile.in,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -b -r1.214 -r1.215
--- Makefile.in 29 Jun 2006 12:13:26 -0000      1.214
+++ Makefile.in 30 Jun 2006 01:58:56 -0000      1.215
@@ -147,7 +147,8 @@
        $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strtoull.m4 \
        $(top_srcdir)/m4/strtoumax.m4 \
        $(top_srcdir)/m4/sunos57-select.m4 \
-       $(top_srcdir)/m4/sys_socket_h.m4 $(top_srcdir)/m4/time_r.m4 \
+       $(top_srcdir)/m4/sys_socket_h.m4 \
+       $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/time_r.m4 \
        $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/tm_gmtoff.m4 \
        $(top_srcdir)/m4/tzset.m4 $(top_srcdir)/m4/uintmax_t.m4 \
        $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/unistd-safer.m4 \
@@ -262,6 +263,7 @@
 FNMATCH_H = @FNMATCH_H@
 FULL_PATH_INTTYPES_H = @FULL_PATH_INTTYPES_H@
 FULL_PATH_STDINT_H = @FULL_PATH_STDINT_H@
+FULL_PATH_SYS_STAT_H = @FULL_PATH_SYS_STAT_H@
 GETOPT_H = @GETOPT_H@
 GLOB_H = @GLOB_H@
 GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
@@ -372,6 +374,7 @@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
 SYS_SOCKET_H = @SYS_SOCKET_H@
+SYS_STAT_H = @SYS_STAT_H@
 TEXI2DVI = @TEXI2DVI@
 UNISTD_H = @UNISTD_H@
 USE_NLS = @USE_NLS@
@@ -443,12 +446,13 @@
        xgethostname.h xgethostname.c xsize.h
 libcvs_a_LIBADD = @LIBOBJS@ @ALLOCA@
 BUILT_SOURCES = $(ALLOCA_H) $(FNMATCH_H) getdate.c $(GETOPT_H) \
-       $(GLOB_H) $(STDBOOL_H) $(STDINT_H) $(SYS_SOCKET_H) $(UNISTD_H)
+       $(GLOB_H) $(STDBOOL_H) $(STDINT_H) $(SYS_SOCKET_H) \
+       $(SYS_STAT_H) $(UNISTD_H)
 MOSTLYCLEANFILES = alloca.h alloca.h-t fnmatch.h fnmatch.h-t \
        getdate-expected getdate-got getdate.diff getopt.h getopt.h-t \
        glob.h glob.h-t stdbool.h stdbool.h-t stdint.h stdint.h-t \
-       sys/socket.h sys/socket.h-t unistd.h
-MOSTLYCLEANDIRS = sys
+       sys/socket.h sys/socket.h-t sys/stat.h sys/stat.h-t unistd.h
+MOSTLYCLEANDIRS = sys sys
 DISTCLEANFILES = getdate.log
 MAINTAINERCLEANFILES = getdate.c
 
@@ -466,7 +470,7 @@
        libcvs.dep libcvs.dsp libcvs.mak test-getdate.sh alloca_.h \
        allocsa.valgrind fnmatch_.h fnmatch_loop.c getdate.c \
        getndelim2.h getndelim2.c getopt_.h getopt_int.h intprops.h \
-       stdbool_.h stdint_.h socket_.h
+       stdbool_.h stdint_.h socket_.h stat_.h
 getdate_SOURCES = error.c getdate.y progname.c
 getdate_CPPFLAGS = -DTEST
 getdate_LDADD = \
@@ -1071,6 +1075,14 @@
        cp $(srcdir)/socket_.h address@hidden
        mv address@hidden $@
 
+# We need the following in order to create <sys/stat.h> when the system
+# has one that is incomplete.
+sys/stat.h: stat_.h
+       test -d sys || mkdir sys
+       sed -e 's|@''FULL_PATH_SYS_STAT_H''@|$(FULL_PATH_SYS_STAT_H)|g' \
+           < $(srcdir)/stat_.h > address@hidden
+       mv address@hidden $@
+
 # We need the following in order to create an empty placeholder for
 # <unistd.h> when the system doesn't have one.
 unistd.h:

Index: getaddrinfo.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/getaddrinfo.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- getaddrinfo.c       29 Jun 2006 12:13:26 -0000      1.7
+++ getaddrinfo.c       30 Jun 2006 01:58:56 -0000      1.8
@@ -40,11 +40,15 @@
 
 #include "strdup.h"
 
-#ifdef _WIN32
-typedef void WSAAPI (*freeaddrinfo_func) (struct addrinfo*);
+#if defined _WIN32 || defined __WIN32__
+# define WIN32_NATIVE
+#endif
+
+#ifdef WIN32_NATIVE
 typedef int WSAAPI (*getaddrinfo_func) (const char*, const char*,
                                        const struct addrinfo*,
                                        struct addrinfo**);
+typedef void WSAAPI (*freeaddrinfo_func) (struct addrinfo*);
 typedef int WSAAPI (*getnameinfo_func) (const struct sockaddr*,
                                        socklen_t, char*, DWORD,
                                        char*, DWORD, int);
@@ -53,7 +57,8 @@
 static freeaddrinfo_func freeaddrinfo_ptr = NULL;
 static getnameinfo_func getnameinfo_ptr = NULL;
 
-int use_win32_p (void)
+static int
+use_win32_p (void)
 {
   static int done = 0;
   HMODULE h;
@@ -128,7 +133,7 @@
   };
 #endif
 
-#ifdef _WIN32
+#ifdef WIN32_NATIVE
   if (use_win32_p ())
     return getaddrinfo_ptr (nodename, servname, hints, res);
 #endif
@@ -162,8 +167,10 @@
       if (!se)
        {
          char *c;
+         if (!(*servname >= '0' && *servname <= '9))
+           return EAI_NONAME;
          port = strtoul (servname, &c, 10);
-         if (*c)
+         if (*c || port > 0xffff)
            return EAI_NONAME;
          port = htons (port);
        }
@@ -285,7 +292,7 @@
 void
 freeaddrinfo (struct addrinfo *ai)
 {
-#ifdef _WIN32
+#ifdef WIN32_NATIVE
   if (use_win32_p ())
     return freeaddrinfo_ptr (ai);
 #endif
@@ -307,7 +314,7 @@
                char *restrict service, socklen_t servicelen,
                int flags)
 {
-#if _WIN32
+#if WIN32_NATIVE
   if (use_win32_p ())
     return getnameinfo_ptr (sa, salen, node, nodelen,
                            service, servicelen, flags);
@@ -347,7 +354,6 @@
 #if HAVE_IPV4
        case AF_INET:
          if (!inet_ntop (AF_INET,
-                         (const void *)
                          &(((const struct sockaddr_in *) sa)->sin_addr),
                          node, nodelen))
            return EAI_SYSTEM;
@@ -357,7 +363,6 @@
 #if HAVE_IPV6
        case AF_INET6:
          if (!inet_ntop (AF_INET6,
-                         (const void *)
                          &(((const struct sockaddr_in6 *) sa)->sin6_addr),
                          node, nodelen))
            return EAI_SYSTEM;

Index: getaddrinfo.h
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/getaddrinfo.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- getaddrinfo.h       29 Jun 2006 12:13:26 -0000      1.8
+++ getaddrinfo.h       30 Jun 2006 01:58:56 -0000      1.9
@@ -134,7 +134,7 @@
 # if !HAVE_DECL_GETNAMEINFO
 /* Convert socket address to printable node and service names.
    For more details, see the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/gai_strerror.html>.  */
+   <http://www.opengroup.org/susv3xsh/getnameinfo.html>.  */
 extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
                       char *restrict node, socklen_t nodelen,
                       char *restrict service, socklen_t servicelen,

Index: strftime.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/lib/strftime.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- strftime.c  25 Jan 2006 12:53:38 -0000      1.11
+++ strftime.c  30 Jun 2006 01:58:56 -0000      1.12
@@ -387,21 +387,6 @@
 }
 
 
-#if !(defined _NL_CURRENT || HAVE_STRFTIME)
-static CHAR_T const weekday_name[][10] =
-  {
-    L_("Sunday"), L_("Monday"), L_("Tuesday"), L_("Wednesday"),
-    L_("Thursday"), L_("Friday"), L_("Saturday")
-  };
-static CHAR_T const month_name[][10] =
-  {
-    L_("January"), L_("February"), L_("March"), L_("April"), L_("May"),
-    L_("June"), L_("July"), L_("August"), L_("September"), L_("October"),
-    L_("November"), L_("December")
-  };
-#endif
-
-
 /* When compiling this file, GNU applications can #define my_strftime
    to a symbol (typically nstrftime) to get an extended strftime with
    extra arguments UT and NS.  Emacs is a special case for now, but
@@ -473,18 +458,6 @@
 # define aw_len STRLEN (a_wkday)
 # define am_len STRLEN (a_month)
 # define ap_len STRLEN (ampm)
-#else
-# if !HAVE_STRFTIME
-#  define f_wkday (weekday_name[tp->tm_wday])
-#  define f_month (month_name[tp->tm_mon])
-#  define a_wkday f_wkday
-#  define a_month f_month
-#  define ampm (L_("AMPM") + 2 * (tp->tm_hour > 11))
-
-  size_t aw_len = 3;
-  size_t am_len = 3;
-  size_t ap_len = 2;
-# endif
 #endif
   const char *zone;
   size_t i = 0;
@@ -745,7 +718,7 @@
              to_uppcase = true;
              to_lowcase = false;
            }
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
          cpy (aw_len, a_wkday);
          break;
 #else
@@ -760,7 +733,7 @@
              to_uppcase = true;
              to_lowcase = false;
            }
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
          cpy (STRLEN (f_wkday), f_wkday);
          break;
 #else
@@ -776,7 +749,7 @@
            }
          if (modifier != 0)
            goto bad_format;
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
          cpy (am_len, a_month);
          break;
 #else
@@ -791,7 +764,7 @@
              to_uppcase = true;
              to_lowcase = false;
            }
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
          cpy (STRLEN (f_month), f_month);
          break;
 #else
@@ -809,11 +782,7 @@
                     != '\0')))
            subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT));
 #else
-# if HAVE_STRFTIME
          goto underlying_strftime;
-# else
-         subfmt = L_("%a %b %e %H:%M:%S %Y");
-# endif
 #endif
 
        subformat:
@@ -829,7 +798,7 @@
          }
          break;
 
-#if HAVE_STRFTIME && ! (defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY)
+#if !(defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY)
        underlying_strftime:
          {
            /* The relevant information is available only via the
@@ -880,9 +849,7 @@
                  break;
                }
 #else
-# if HAVE_STRFTIME
              goto underlying_strftime;
-# endif
 #endif
            }
 
@@ -903,11 +870,7 @@
            subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT));
          goto subformat;
 #else
-# if HAVE_STRFTIME
          goto underlying_strftime;
-# else
-         /* Fall through.  */
-# endif
 #endif
        case L_('D'):
          if (modifier != 0)
@@ -972,9 +935,7 @@
                    }
                }
 #else
-# if HAVE_STRFTIME
              goto underlying_strftime;
-# endif
 #endif
            }
 
@@ -1122,7 +1083,7 @@
 
        case L_('P'):
          to_lowcase = true;
-#if !defined _NL_CURRENT && HAVE_STRFTIME
+#ifndef _NL_CURRENT
          format_char = L_('p');
 #endif
          /* FALLTHROUGH */
@@ -1133,7 +1094,7 @@
              to_uppcase = false;
              to_lowcase = true;
            }
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
          cpy (ap_len, ampm);
          break;
 #else
@@ -1145,16 +1106,14 @@
          goto subformat;
 
        case L_('r'):
-#if !defined _NL_CURRENT && HAVE_STRFTIME
-         goto underlying_strftime;
-#else
-# ifdef _NL_CURRENT
+#ifdef _NL_CURRENT
          if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME,
                                                       NLW(T_FMT_AMPM)))
              == L_('\0'))
-# endif
            subfmt = L_("%I:%M:%S %p");
          goto subformat;
+#else
+         goto underlying_strftime;
 #endif
 
        case L_('S'):
@@ -1201,11 +1160,7 @@
            subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT));
          goto subformat;
 #else
-# if HAVE_STRFTIME
          goto underlying_strftime;
-# else
-         /* Fall through.  */
-# endif
 #endif
        case L_('T'):
          subfmt = L_("%H:%M:%S");
@@ -1309,9 +1264,7 @@
                  goto subformat;
                }
 #else
-# if HAVE_STRFTIME
              goto underlying_strftime;
-# endif
 #endif
            }
          if (modifier == L_('O'))
@@ -1332,9 +1285,7 @@
                                 + delta * era->absolute_direction));
                }
 #else
-# if HAVE_STRFTIME
              goto underlying_strftime;
-# endif
 #endif
            }
 

Index: stat_.h
===================================================================
RCS file: stat_.h
diff -N stat_.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ stat_.h     30 Jun 2006 01:58:56 -0000      1.1
@@ -0,0 +1,42 @@
+/* Provide a complete sys/stat header file.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   Written by Eric Blake.
+
+   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
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program 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 General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _gl_SYS_STAT_H
+#define _gl_SYS_STAT_H
+
+/* This file is supposed to be used on platforms where <sys/stat.h> is
+   incomplete.  It is intended to provide definitions and prototypes
+   needed by an application.  Start with what the system provides.  */
+#include @FULL_PATH_SYS_STAT_H@
+
+/* mingw does not support symlinks, therefore it does not have lstat.  But
+   without links, stat does just fine.  */
+#if ! HAVE_FUNC_LSTAT
+# define lstat stat
+#endif
+
+/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
+   Additionally, it declares _mkdir (and depending on compile flags, an
+   alias mkdir), only in the nonstandard io.h.  */
+#if ! HAVE_DECL_MKDIR && HAVE_IO_H
+# include <io.h>
+static int rpl_mkdir (char const *name, mode_t mode) { return _mkdir (name); }
+# define mkdir rpl_mkdir
+#endif
+
+#endif /* _gl_SYS_STAT_H */




reply via email to

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