summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gnulib-local/ChangeLog13
-rw-r--r--gnulib-local/Makefile.am8
-rw-r--r--gnulib-local/lib/getline.c56
-rw-r--r--gnulib-local/lib/getline.h39
-rw-r--r--gnulib-local/lib/getndelim2.c121
-rw-r--r--gnulib-local/lib/getndelim2.h42
-rw-r--r--gnulib-local/m4/getline.m477
-rw-r--r--gnulib-local/m4/getndelim2.m420
-rw-r--r--gnulib-local/modules/getline26
-rw-r--r--gnulib-local/modules/getndelim227
10 files changed, 13 insertions, 416 deletions
diff --git a/gnulib-local/ChangeLog b/gnulib-local/ChangeLog
index 6e2c751..1ccb625 100644
--- a/gnulib-local/ChangeLog
+++ b/gnulib-local/ChangeLog
@@ -1,3 +1,16 @@
+2006-10-16 Bruno Haible <bruno@clisp.org>
+
+ Use newer modules from gnulib.
+ * lib/getline.h: Remove file.
+ * lib/getline.c: Remove file.
+ * m4/getline.m4: Remove file.
+ * modules/getline: Remove file.
+ * lib/getndelim2.h: Remove file.
+ * lib/getndelim2.c: Remove file.
+ * m4/getndelim2.m4: Remove file.
+ * modules/getndelim2: Remove file.
+ * Makefile.am (EXTRA_DIST): Remove them.
+
2006-10-13 Bruno Haible <bruno@clisp.org>
* modules/exitfail.diff: Update.
diff --git a/gnulib-local/Makefile.am b/gnulib-local/Makefile.am
index ede8589..8aad338 100644
--- a/gnulib-local/Makefile.am
+++ b/gnulib-local/Makefile.am
@@ -45,10 +45,6 @@ lib/fnmatch_loop.c.diff \
lib/fstrcmp.c \
lib/fstrcmp.h \
lib/gen-lbrkprop.c \
-lib/getline.c \
-lib/getline.h \
-lib/getndelim2.c \
-lib/getndelim2.h \
lib/getopt_.h.diff \
lib/gettext.h \
lib/hash.c \
@@ -80,8 +76,6 @@ m4/ChangeLog.0 \
m4/ChangeLog.1 \
m4/exitfail.m4.diff \
m4/gcj.m4 \
-m4/getline.m4 \
-m4/getndelim2.m4 \
m4/hard-locale.m4.diff \
m4/java.m4 \
m4/quotearg.m4.diff \
@@ -100,8 +94,6 @@ modules/fnmatch.diff \
modules/fstrcmp \
modules/gcj \
modules/gen-lbrkprop \
-modules/getline \
-modules/getndelim2 \
modules/gettext-runtime-misc \
modules/gettext-tools-misc \
modules/hash \
diff --git a/gnulib-local/lib/getline.c b/gnulib-local/lib/getline.c
deleted file mode 100644
index 9b188ff..0000000
--- a/gnulib-local/lib/getline.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* getline.c -- Replacement for GNU C library function getline
-
- Copyright (C) 1993, 1996-1998, 2000, 2003, 2005-2006 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
- 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. */
-
-/* Written by Jan Brittenson, bson@gnu.ai.mit.edu. */
-
-#include <config.h>
-
-/* Specification. */
-#include "getline.h"
-
-#include <stddef.h>
-#include <stdio.h>
-
-/* Get ssize_t. */
-#include <sys/types.h>
-
-#if defined __GNU_LIBRARY__ && HAVE_GETDELIM
-
-ssize_t
-getline (char **lineptr, size_t *linesize, FILE *stream)
-{
- return getdelim (lineptr, linesize, '\n', stream);
-}
-
-#else /* ! have getdelim */
-
-# include "getndelim2.h"
-
-ssize_t
-getline (char **lineptr, size_t *linesize, FILE *stream)
-{
- return getndelim2 (lineptr, linesize, (size_t)(-1), stream, '\n', 0, 0);
-}
-
-ssize_t
-getdelim (char **lineptr, size_t *linesize, int delimiter, FILE *stream)
-{
- return getndelim2 (lineptr, linesize, (size_t)(-1), stream, delimiter, 0, 0);
-}
-#endif
diff --git a/gnulib-local/lib/getline.h b/gnulib-local/lib/getline.h
deleted file mode 100644
index eaacd4e..0000000
--- a/gnulib-local/lib/getline.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Replacement for GNU C library function getline
-
- Copyright (C) 1995, 1997, 1999, 2000, 2001, 2002, 2003 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
-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 GETLINE_H_
-# define GETLINE_H_ 1
-
-# include <stddef.h>
-# include <stdio.h>
-
-/* Get ssize_t. */
-# include <sys/types.h>
-
-/* glibc2 has these functions declared in <stdio.h>. Avoid redeclarations. */
-# if __GLIBC__ < 2
-
-extern ssize_t getline (char **_lineptr, size_t *_linesize, FILE *_stream);
-
-extern ssize_t getdelim (char **_lineptr, size_t *_linesize, int _delimiter,
- FILE *_stream);
-
-# endif
-
-#endif /* not GETLINE_H_ */
diff --git a/gnulib-local/lib/getndelim2.c b/gnulib-local/lib/getndelim2.c
deleted file mode 100644
index a96da2e..0000000
--- a/gnulib-local/lib/getndelim2.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* getndelim2 - Read a line from a stream, stopping at one of 2 delimiters,
- with bounded memory allocation.
-
- Copyright (C) 1993, 1996-1998, 2000, 2003, 2005-2006 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
- 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. */
-
-/* Originally written by Jan Brittenson, bson@gnu.ai.mit.edu. */
-
-#include <config.h>
-
-/* Specification. */
-#include "getndelim2.h"
-
-#include <stdlib.h>
-
-#include "unlocked-io.h"
-
-/* Always add at least this many bytes when extending the buffer. */
-#define MIN_CHUNK 64
-
-ssize_t
-getndelim2 (char **lineptr, size_t *linesize, size_t nmax,
- FILE *stream, int delim1, int delim2, size_t offset)
-{
- size_t nbytes_avail; /* Allocated but unused chars in *LINEPTR. */
- char *read_pos; /* Where we're reading into *LINEPTR. */
-
- if (!lineptr || !linesize || !nmax || !stream)
- return -1;
-
- if (!*lineptr)
- {
- size_t newlinesize = MIN_CHUNK;
-
- if (newlinesize > nmax)
- newlinesize = nmax;
-
- *linesize = newlinesize;
- *lineptr = malloc (*linesize);
- if (!*lineptr)
- return -1;
- }
-
- if (*linesize < offset)
- return -1;
-
- nbytes_avail = *linesize - offset;
- read_pos = *lineptr + offset;
-
- if (nbytes_avail == 0 && *linesize >= nmax)
- return -1;
-
- for (;;)
- {
- /* Here always *lineptr + *linesize == read_pos + nbytes_avail. */
-
- register int c = getc (stream);
-
- /* We always want at least one char left in the buffer, since we
- always (unless we get an error while reading the first char)
- NUL-terminate the line buffer. */
-
- if (nbytes_avail < 2 && *linesize < nmax)
- {
- size_t newlinesize =
- (*linesize > MIN_CHUNK ? 2 * *linesize : *linesize + MIN_CHUNK);
-
- if (newlinesize > nmax)
- newlinesize = nmax;
-
- if (newlinesize > *linesize)
- {
- *linesize = newlinesize;
- nbytes_avail = *linesize + *lineptr - read_pos;
- *lineptr = realloc (*lineptr, *linesize);
- if (!*lineptr)
- return -1;
- read_pos = *linesize - nbytes_avail + *lineptr;
- }
- }
-
- if (c == EOF || ferror (stream))
- {
- /* Return partial line, if any. */
- if (read_pos == *lineptr)
- return -1;
- else
- break;
- }
-
- if (nbytes_avail >= 2)
- {
- *read_pos++ = c;
- nbytes_avail--;
- }
-
- if (c == delim1 || (delim2 && c == delim2))
- /* Return the line. */
- break;
- }
-
- /* Done - NUL terminate and return the number of chars read.
- At this point we know that nbytes_avail >= 1. */
- *read_pos = '\0';
-
- return read_pos - (*lineptr + offset);
-}
diff --git a/gnulib-local/lib/getndelim2.h b/gnulib-local/lib/getndelim2.h
deleted file mode 100644
index dcc9b07..0000000
--- a/gnulib-local/lib/getndelim2.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* getndelim2 - Read a line from a stream, stopping at one of 2 delimiters,
- with bounded memory allocation.
-
- Copyright (C) 2003 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
- 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 GETNDELIM2_H
-#define GETNDELIM2_H 1
-
-#include <stddef.h>
-#include <stdio.h>
-
-/* Get ssize_t. */
-#include <sys/types.h>
-
-/* Read up to (and including) a delimiter DELIM1 from STREAM into *LINEPTR
- + OFFSET (and NUL-terminate it). If DELIM2 is non-zero, then read up
- and including the first occurrence of DELIM1 or DELIM2. *LINEPTR is
- a pointer returned from malloc (or NULL), pointing to *LINESIZE bytes of
- space. It is realloc'd as necessary. Reallocation is limited to
- NMAX bytes; if the line is longer than that, the extra bytes are read but
- thrown away.
- Return the number of bytes read and stored at *LINEPTR + OFFSET (not
- including the NUL terminator), or -1 on error or EOF. */
-extern ssize_t getndelim2 (char **lineptr, size_t *linesize, size_t nmax,
- FILE *stream, int delim1, int delim2,
- size_t offset);
-
-#endif /* GETNDELIM2_H */
diff --git a/gnulib-local/m4/getline.m4 b/gnulib-local/m4/getline.m4
deleted file mode 100644
index 4cacb7f..0000000
--- a/gnulib-local/m4/getline.m4
+++ /dev/null
@@ -1,77 +0,0 @@
-# getline.m4 serial 10
-
-dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006 Free Software
-dnl Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_PREREQ(2.52)
-
-dnl See if there's a working, system-supplied version of the getline function.
-dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
-dnl have a function by that name in -linet that doesn't have anything
-dnl to do with the function we need.
-AC_DEFUN([AM_FUNC_GETLINE],
-[
- dnl Persuade glibc <stdio.h> to declare getline() and getdelim().
- AC_REQUIRE([AC_GNU_SOURCE])
-
- am_getline_needs_run_time_check=no
- AC_CHECK_FUNC(getline,
- dnl Found it in some library. Verify that it works.
- am_getline_needs_run_time_check=yes,
- am_cv_func_working_getline=no)
- if test $am_getline_needs_run_time_check = yes; then
- AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
- [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
- AC_TRY_RUN([
-# include <stdio.h>
-# include <stdlib.h>
-# include <string.h>
- int main ()
- { /* Based on a test program from Karl Heuer. */
- char *line = NULL;
- size_t siz = 0;
- int len;
- FILE *in = fopen ("./conftest.data", "r");
- if (!in)
- return 1;
- len = getline (&line, &siz, in);
- exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
- }
- ], am_cv_func_working_getline=yes dnl The library version works.
- , am_cv_func_working_getline=no dnl The library version does NOT work.
- , dnl We're cross compiling. Assume it works on glibc2 systems.
- [AC_EGREP_CPP([Lucky GNU user],
- [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
- Lucky GNU user
- #endif
-#endif
- ],
- [am_cv_func_working_getline=yes],
- [am_cv_func_working_getline=no])]
- )])
- fi
-
- if test $am_cv_func_working_getline = no; then
- dnl We must choose a different name for our function, since on ELF systems
- dnl a broken getline() in libc.so would override our getline() in
- dnl libgettextlib.so.
- AC_DEFINE([getline], [gnu_getline],
- [Define to a replacement function name for getline().])
- AC_LIBOBJ(getline)
- AC_LIBOBJ(getndelim2)
- gl_PREREQ_GETLINE
- gl_PREREQ_GETNDELIM2
- fi
-])
-
-# Prerequisites of lib/getline.c.
-AC_DEFUN([gl_PREREQ_GETLINE],
-[
- AC_CHECK_FUNCS(getdelim)
-])
diff --git a/gnulib-local/m4/getndelim2.m4 b/gnulib-local/m4/getndelim2.m4
deleted file mode 100644
index ac539c6..0000000
--- a/gnulib-local/m4/getndelim2.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-# getndelim2.m4 serial 1
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_GETNDELIM2],
-[
- AC_LIBOBJ(getndelim2)
- gl_PREREQ_GETNDELIM2
-])
-
-# Prerequisites of lib/getndelim2.h and lib/getndelim2.c.
-AC_DEFUN([gl_PREREQ_GETNDELIM2],
-[
- dnl Prerequisites of lib/getndelim2.h.
- AC_REQUIRE([gt_TYPE_SSIZE_T])
- dnl Prerequisites of lib/getndelim2.c.
- AC_REQUIRE([AC_HEADER_STDC])
-])
diff --git a/gnulib-local/modules/getline b/gnulib-local/modules/getline
deleted file mode 100644
index 6dc7f80..0000000
--- a/gnulib-local/modules/getline
+++ /dev/null
@@ -1,26 +0,0 @@
-Description:
-Read a line from a stream.
-
-Files:
-lib/getline.h
-lib/getline.c
-m4/getline.m4
-
-Depends-on:
-getndelim2
-
-configure.ac:
-AM_FUNC_GETLINE
-
-Makefile.am:
-EXTRA_DIST += getline.h getline.c
-
-Include:
-"getline.h"
-
-License:
-GPL
-
-Maintainer:
-Bruno Haible
-
diff --git a/gnulib-local/modules/getndelim2 b/gnulib-local/modules/getndelim2
deleted file mode 100644
index 574183f..0000000
--- a/gnulib-local/modules/getndelim2
+++ /dev/null
@@ -1,27 +0,0 @@
-Description:
-Read a line from a stream, stopping at one of 2 delimiters, with bounded
-memory allocation.
-
-Files:
-lib/getndelim2.h
-lib/getndelim2.c
-m4/getndelim2.m4
-
-Depends-on:
-unlocked-io
-
-configure.ac:
-gl_GETNDELIM2
-
-Makefile.am:
-EXTRA_DIST += getndelim2.h getndelim2.c
-
-Include:
-"getndelim2.h"
-
-License:
-GPL
-
-Maintainer:
-Bruno Haible
-