[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS shishi/gl
From: |
shishi-commit |
Subject: |
CVS shishi/gl |
Date: |
Tue, 05 Oct 2004 20:54:42 +0200 |
Update of /home/cvs/shishi/gl
In directory dopio:/tmp/cvs-serv17010/gl
Modified Files:
Makefile.am error.c getdate.y getndelim2.c getpass.c
getsubopt.c progname.h vasnprintf.h xalloc.h xmalloc.c
Removed Files:
xstrdup.c
Log Message:
Gnulib update.
Fix callers.
--- /home/cvs/shishi/gl/Makefile.am 2004/09/17 14:10:15 1.44
+++ /home/cvs/shishi/gl/Makefile.am 2004/10/05 18:54:40 1.45
@@ -10,7 +10,7 @@
# Generated by gnulib-tool.
#
# Invoked as: gnulib-tool --import
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl
--m4-base=gl/m4 --libtool alloca allocsa error extensions getdate getdomainname
gethostname getline getopt getpass getsubopt gettext gettime gettimeofday
mktime progname readlink realloc restrict setenv stdbool strcase strchrnul
strdup strndup strnlen timegm time_r timespec unlocked-io vasnprintf vasprintf
xalloc xgetdomainname xgethostname xreadlink xsize xstrndup
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl
--m4-base=gl/m4 --libtool alloca alloca-opt allocsa error extensions getdate
getdomainname gethostname getline getopt getpass getsubopt gettext gettime
gettimeofday mktime progname readlink realloc restrict setenv stdbool strcase
strchrnul strdup strndup strnlen timegm time_r timespec vasnprintf vasprintf
xalloc xgetdomainname xgethostname xreadlink xsize xstrndup
AUTOMAKE_OPTIONS = 1.8 gnits
@@ -37,6 +37,17 @@
MOSTLYCLEANFILES += alloca.h alloca.h-t
libgnu_la_LIBADD += @ALLOCA@
+BUILT_SOURCES += $(ALLOCA_H)
+EXTRA_DIST += alloca_.h
+
+# We need the following in order to create an <alloca.h> when the system
+# doesn't have one that works with the given compiler.
+all-local $(libgnu_la_OBJECTS): $(ALLOCA_H)
+alloca.h: alloca_.h
+ cp $(srcdir)/alloca_.h address@hidden
+ mv address@hidden $@
+MOSTLYCLEANFILES += alloca.h alloca.h-t
+
libgnu_la_SOURCES += allocsa.h allocsa.c
@@ -105,13 +116,11 @@
libgnu_la_SOURCES += timespec.h
-libgnu_la_SOURCES += unlocked-io.h
-
libgnu_la_SOURCES += printf-args.h printf-parse.h vasnprintf.h
libgnu_la_SOURCES += vasprintf.h
-libgnu_la_SOURCES += xalloc.h xmalloc.c xstrdup.c
+libgnu_la_SOURCES += xalloc.h xmalloc.c
libgnu_la_SOURCES += xgetdomainname.h xgetdomainname.c
--- /home/cvs/shishi/gl/error.c 2004/08/07 14:06:59 1.6
+++ /home/cvs/shishi/gl/error.c 2004/10/05 18:54:41 1.7
@@ -40,7 +40,7 @@
# define mbsrtowcs __mbsrtowcs
#endif
-#if !_LIBC
+#if USE_UNLOCKED_IO
# include "unlocked-io.h"
#endif
--- /home/cvs/shishi/gl/getdate.y 2004/08/07 14:06:59 1.5
+++ /home/cvs/shishi/gl/getdate.y 2004/10/05 18:54:41 1.6
@@ -77,7 +77,9 @@
#include <string.h>
-#include "unlocked-io.h"
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
# define __attribute__(x)
--- /home/cvs/shishi/gl/getndelim2.c 2004/07/02 14:05:56 1.4
+++ /home/cvs/shishi/gl/getndelim2.c 2004/10/05 18:54:41 1.5
@@ -29,7 +29,9 @@
#include <stdlib.h>
#include <stddef.h>
-#include "unlocked-io.h"
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
#include <limits.h>
#if HAVE_INTTYPES_H
--- /home/cvs/shishi/gl/getpass.c 2004/09/02 19:43:29 1.1
+++ /home/cvs/shishi/gl/getpass.c 2004/10/05 18:54:41 1.2
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2001, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
@@ -55,7 +55,7 @@
#if _LIBC
# define flockfile(s) _IO_flockfile (s)
# define funlockfile(s) _IO_funlockfile (s)
-#else
+#elif USE_UNLOCKED_IO
# include "unlocked-io.h"
#endif
--- /home/cvs/shishi/gl/getsubopt.c 2004/08/07 14:31:58 1.2
+++ /home/cvs/shishi/gl/getsubopt.c 2004/10/05 18:54:41 1.3
@@ -3,20 +3,19 @@
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <address@hidden>, 1996.
- 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.
+ 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.
- The GNU C Library is distributed in the hope that it will be useful,
+ 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
- Lesser General Public License for more details.
+ 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 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. */
+ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdlib.h>
#include <string.h>
--- /home/cvs/shishi/gl/progname.h 2004/09/17 11:46:35 1.6
+++ /home/cvs/shishi/gl/progname.h 2004/10/05 18:54:41 1.7
@@ -16,8 +16,8 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#ifndef PROGNAME_H
-#define PROGNAME_H
+#ifndef _PROGNAME_H
+#define _PROGNAME_H
/* Programs using this file should do the following in main():
set_program_name (argv[0]);
@@ -41,10 +41,26 @@
path separators. */
extern const char *get_short_program_name (void);
+#if ENABLE_RELOCATABLE
+
+/* Set program_name, based on argv[0], and original installation prefix and
+ directory, for relocatability. */
+extern void set_program_name_and_installdir (const char *argv0,
+ const char *orig_installprefix,
+ const char *orig_installdir);
+#define set_program_name(ARG0) \
+ set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR)
+
+/* Return the full pathname of the current executable, based on the earlier
+ call to set_program_name_and_installdir. Return NULL if unknown. */
+extern char *get_full_program_name (void);
+
+#endif
+
#ifdef __cplusplus
}
#endif
-#endif /* PROGNAME_H */
+#endif /* _PROGNAME_H */
--- /home/cvs/shishi/gl/vasnprintf.h 2003/08/22 17:48:49 1.2
+++ /home/cvs/shishi/gl/vasnprintf.h 2004/10/05 18:54:41 1.3
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 2002-2003 Free Software Foundation, Inc.
+ Copyright (C) 2002-2004 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
@@ -47,7 +47,24 @@
If successful, return the address of the string (this may be = RESULTBUF
if no dynamic memory allocation was necessary) and set *LENGTHP to the
number of resulting bytes, excluding the trailing NUL. Upon error, set
- errno and return NULL. */
+ errno and return NULL.
+
+ When dynamic memory allocation occurs, the preallocated buffer is left
+ alone (with possibly modified contents). This makes it possible to use
+ a statically allocated or stack-allocated buffer, like this:
+
+ char buf[100];
+ size_t len = sizeof (buf);
+ char *output = vasnprintf (buf, &len, format, args);
+ if (output == NULL)
+ ... error handling ...;
+ else
+ {
+ ... use the output string ...;
+ if (output != buf)
+ free (output);
+ }
+ */
extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format,
...)
__attribute__ ((__format__ (__printf__, 3, 4)));
extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char
*format, va_list args)
--- /home/cvs/shishi/gl/xalloc.h 2004/08/10 08:36:11 1.7
+++ /home/cvs/shishi/gl/xalloc.h 2004/10/05 18:54:41 1.8
@@ -53,8 +53,8 @@
void *xnrealloc (void *p, size_t n, size_t s);
void *x2realloc (void *p, size_t *pn);
void *x2nrealloc (void *p, size_t *pn, size_t s);
-void *xclone (void const *p, size_t s);
-char *xstrdup (const char *str);
+void *xmemdup (void const *p, size_t s);
+char *xstrdup (char const *str);
/* Return 1 if an array of N objects, each of size S, cannot exist due
to size arithmetic overflow. S must be positive and N must be
@@ -71,17 +71,6 @@
# define xalloc_oversized(n, s) \
((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n))
-/* These macros are deprecated; they will go away soon, and are retained
- temporarily only to ease conversion to the functions described above. */
-# define CCLONE(p, n) xclone (p, (n) * sizeof *(p))
-# define CLONE(p) xclone (p, sizeof *(p))
-# define NEW(type, var) type *var = xmalloc (sizeof (type))
-# define XCALLOC(type, n) xcalloc (n, sizeof (type))
-# define XMALLOC(type, n) xnmalloc (n, sizeof (type))
-# define XREALLOC(p, type, n) xnrealloc (p, n, sizeof (type))
-# define XFREE(p) free (p)
-
-
# ifdef __cplusplus
}
# endif
--- /home/cvs/shishi/gl/xmalloc.c 2004/08/10 08:36:11 1.8
+++ /home/cvs/shishi/gl/xmalloc.c 2004/10/05 18:54:41 1.9
@@ -211,11 +211,19 @@
}
/* Clone an object P of size S, with error checking. There's no need
- for xnclone (P, N, S), since xclone (P, N * S) works without any
+ for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any
need for an arithmetic overflow check. */
void *
-xclone (void const *p, size_t s)
+xmemdup (void const *p, size_t s)
{
return memcpy (xmalloc (s), p, s);
}
+
+/* Clone STRING. */
+
+char *
+xstrdup (char const *string)
+{
+ return xmemdup (string, strlen (string) + 1);
+}
- CVS shishi/gl,
shishi-commit <=