]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Split system.h into many small include files: binary-io.h exit.h liballoca.h
authorBruno Haible <bruno@clisp.org>
Wed, 2 Jan 2002 11:05:00 +0000 (11:05 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 22:29:09 +0000 (00:29 +0200)
pathname.h stpcpy.h stpncpy.h strcase.h xgetcwd.h.

73 files changed:
lib/ChangeLog
lib/Makefile.am
lib/argmatch.c
lib/binary-io.h [new file with mode: 0644]
lib/concatpath.c
lib/copy-file.c
lib/execute.c
lib/exit.h [new file with mode: 0644]
lib/findprog.c
lib/javacomp.c
lib/javaexec.c
lib/liballoca.h [new file with mode: 0644]
lib/linebreak.c
lib/linebreak.h
lib/minmax.h
lib/pathname.h [new file with mode: 0644]
lib/pipe-bidi.c
lib/pipe-in.c
lib/pipe-out.c
lib/setenv.c
lib/stpcpy.h [new file with mode: 0644]
lib/stpncpy.h [new file with mode: 0644]
lib/strcase.h [new file with mode: 0644]
lib/system.h [deleted file]
lib/wait-process.c
lib/xerror.c
lib/xgetcwd.h [new file with mode: 0644]
lib/xmalloc.c
src/ChangeLog
src/dir-list.c
src/file-list.c
src/format-java.c
src/format-lisp.c
src/gettext.c
src/hostname.c
src/msgattrib.c
src/msgcat.c
src/msgcmp.c
src/msgcomm.c
src/msgconv.c
src/msgen.c
src/msgexec.c
src/msgfilter.c
src/msgfmt.c
src/msggrep.c
src/msginit.c
src/msgl-cat.c
src/msgl-charset.c
src/msgl-iconv.c
src/msgmerge.c
src/msgunfmt.c
src/msguniq.c
src/ngettext.c
src/open-po.c
src/po-charset.c
src/po-gram-gen.y
src/po-hash-gen.y
src/po-lex.c
src/read-java.c
src/read-mo.c
src/urlget.c
src/write-java.c
src/write-mo.c
src/write-po.c
src/x-c.c
src/x-librep.c
src/x-lisp.c
src/x-rst.c
src/x-ycp.c
src/xgettext.c
src/xgettext.h
tests/ChangeLog
tests/tstngettext.c

index e32ea71d7085cdd3de21078b204a21209637087c..a62960f63d875ff2a1538a1c3f75e09810cc3a4d 100644 (file)
@@ -1,3 +1,48 @@
+2001-12-22  Bruno Haible  <bruno@clisp.org>
+
+       * binary-io.h: New file, extracted from system.h.
+       * exit.h: New file, extracted from system.h.
+       * liballoca.h: New file, extracted from system.h.
+       * pathname.h: New file, extracted from system.h.
+       * stpcpy.h: New file, extracted from system.h.
+       * stpncpy.h: New file, extracted from system.h.
+       * strcase.h: New file, extracted from system.h.
+       * xgetcwd.h: New file, extracted from system.h.
+       * system.h: Remove file.
+       * Makefile.am (libgettextlib_la_SOURCES): Remove xgetcwd.c.
+       (libgettextlib_la_HEADER): Add binary-io.h, exit.h, liballoca.h,
+       pathname.h. Remove system.h.
+       (LIBADD_HEADER): Add stpcpy.h, stpncpy.h, strcase.h.
+       (UNUSED_SOURCE): Add xgetcwd.c.
+       (UNUSED_HEADER): Add xgetcwd.h.
+       * argmatch.c: Include exit.h instead of <stdlib.h>.
+       (EXIT_FAILURE): Remove fallback definition.
+       * concatpath.c: Include pathname.h, <string.h>, stpcpy.h instead of
+       system.h.
+       * copy-file.c: Include <unistd.h>, binary-io.h, exit.h instead of
+       system.h.
+       (O_BINARY): Remove fallback definition.
+       * execute.c: Include exit.h.
+       (EXIT_FAILURE): Remove fallback definition.
+       * findprog.c: Include pathname.h instead of system.h.
+       * javacomp.c: Include liballoca.h. Remove alloca() declaration stuff.
+       * javaexec.c: Likewise.
+       * setenv.c: Likewise.
+       * linebreak.h: Include <stddef.h> instead of <stdlib.h>.
+       * linebreak.c: Include <stdlib.h> instead of <stddef.h>.
+       * pipe-bidi.c: Include exit.h.
+       (EXIT_FAILURE): Remove fallback definition.
+       * pipe-in.c: Include exit.h.
+       (EXIT_FAILURE): Remove fallback definition.
+       * pipe-out.c: Include exit.h.
+       (EXIT_FAILURE): Remove fallback definition.
+       * wait-process.c: Include exit.h.
+       (EXIT_FAILURE): Remove fallback definition.
+       * xerror.c: Include exit.h.
+       (EXIT_FAILURE): Remove fallback definition.
+       * xmalloc.c: Include exit.h.
+       (EXIT_FAILURE): Remove fallback definition.
+
 2001-12-21  Bruno Haible  <bruno@clisp.org>
 
        * minmax.h: New file, extracted from system.h.
index a72fe859ba9056f36d15f26bcdc0a407a609e6c7..f43075ad66acb96f913c39c0455f035127b04360 100644 (file)
@@ -28,13 +28,14 @@ c-ctype.c concatpath.c copy-file.c execute.c findprog.c fstrcmp.c \
 full-write.c gcd.c getopt.c getopt1.c hash.c javacomp.c javaexec.c \
 linebreak.c localcharset.c mbswidth.c obstack.c pipe-bidi.c pipe-in.c \
 pipe-out.c progname.c safe-read.c sh-quote.c tmpdir.c wait-process.c xerror.c \
-xgetcwd.c xmalloc.c xstrdup.c
+xmalloc.c xstrdup.c
 
-libgettextlib_la_HEADER = argmatch.h backupfile.h basename.h c-ctype.h \
-copy-file.h execute.h findprog.h fstrcmp.h full-write.h gcd.h getopt.h hash.h \
-javacomp.h javaexec.h lbrkprop.h linebreak.h mbswidth.h minmax.h obstack.h \
-pathmax.h pipe.h progname.h safe-read.h sh-quote.h system.h tmpdir.h \
-utf8-ucs4.h utf16-ucs4.h wait-process.h xerror.h xmalloc.h
+libgettextlib_la_HEADER = argmatch.h backupfile.h basename.h binary-io.h \
+c-ctype.h copy-file.h execute.h exit.h findprog.h fstrcmp.h full-write.h \
+gcd.h getopt.h hash.h javacomp.h javaexec.h lbrkprop.h liballoca.h \
+linebreak.h mbswidth.h minmax.h obstack.h pathmax.h pathname.h pipe.h \
+progname.h safe-read.h sh-quote.h tmpdir.h utf8-ucs4.h utf16-ucs4.h \
+wait-process.h xerror.h xmalloc.h
 
 # Sources that are compiled only on platforms that lack the functions.
 
@@ -42,14 +43,14 @@ LIBADD_SOURCE = alloca.c error.c getline.c memset.c mkdtemp.c pfnmatch.c \
 setenv.c stpcpy.c stpncpy.c strcasecmp.c strcspn.c strncasecmp.c strpbrk.c \
 strstr.c strtol.c strtoul.c vasprintf.c
 
-LIBADD_HEADER = error.h getline.h mkdtemp.h pfnmatch.h setenv.h strpbrk.h \
-strstr.h
+LIBADD_HEADER = error.h getline.h mkdtemp.h pfnmatch.h setenv.h stpcpy.h \
+stpncpy.h strcase.h strpbrk.h strstr.h
 
 # Unused sources.
 
-UNUSED_SOURCE = memmove.c
+UNUSED_SOURCE = memmove.c xgetcwd.c
 
-UNUSED_HEADER =
+UNUSED_HEADER = xgetcwd.h
 
 # How to build libgettextlib.la.
 
index da664efc927074b1ec9e2a94eb6b1a93f11b01d8..f6ff44f0967d455bd85200cb5942a63ffe2bf6b8 100644 (file)
@@ -21,7 +21,6 @@
 #include "argmatch.h"
 
 #include <stdio.h>
-#include <stdlib.h>
 #ifdef STDC_HEADERS
 # include <string.h>
 #endif
 #endif
 
 #include "error.h"
-
-/* The following test is to work around the gross typo in
-   systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE
-   is defined to 0, not 1.  */
-#if !EXIT_FAILURE
-# undef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
+#include "exit.h"
 
 /* Non failing version of argmatch call this function after failing. */
 #ifndef ARGMATCH_DIE
diff --git a/lib/binary-io.h b/lib/binary-io.h
new file mode 100644 (file)
index 0000000..b10e546
--- /dev/null
@@ -0,0 +1,55 @@
+/* Binary mode I/O.
+   Copyright (C) 2001 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _BINARY_H
+#define _BINARY_H
+
+#include <fcntl.h>
+/* For systems that distinguish between text and binary I/O.
+   O_BINARY is usually declared in <fcntl.h>. */
+#if !defined O_BINARY && defined _O_BINARY
+  /* For MSC-compatible compilers.  */
+# define O_BINARY _O_BINARY
+# define O_TEXT _O_TEXT
+#endif
+#ifdef __BEOS__
+  /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect.  */
+# undef O_BINARY
+# undef O_TEXT
+#endif
+#if O_BINARY
+# if !(defined(__EMX__) || defined(__DJGPP__))
+#  define setmode _setmode
+#  define fileno _fileno
+# endif
+# ifdef __DJGPP__
+#  include <io.h> /* declares setmode() */
+#  include <unistd.h> /* declares isatty() */
+#  /* Avoid putting stdin/stdout in binary mode if it is connected to the
+#     console, because that would make it impossible for the user to
+#     interrupt the program through Ctrl-C or Ctrl-Break.  */
+#  define SET_BINARY(fd) (!isatty(fd) ? (setmode(fd,O_BINARY), 0) : 0)
+# else
+#  define SET_BINARY(fd) setmode(fd,O_BINARY)
+# endif
+#else
+  /* On reasonable systems, binary I/O is the default.  */
+# define O_BINARY 0
+# define SET_BINARY(fd) /* nothing */
+#endif
+
+#endif /* _BINARY_H */
index 1d494f9926d07104081f79ada895543cf98635c7..88c2864f84df9d11fac3425f1d98977cd300b2a8 100644 (file)
 #endif
 
 /* Specification.  */
-#include "system.h"
+#include "pathname.h"
+
+#include <string.h>
 
 #include "xmalloc.h"
+#include "stpcpy.h"
 
 /* Concatenate a directory pathname, a relative pathname and an optional
    suffix.  The directory may end with the directory separator.  The second
index 3ac67ac4454ab8422f752328df982a504de2e9a4..07697ab2d13e8232b4134428e9681083fb5eb6d9 100644 (file)
 #include <fcntl.h>
 #include <sys/stat.h>
 
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
 #if HAVE_UTIME || HAVE_UTIMES
 # include <utime.h>
 #endif
 
 #include "error.h"
 #include "full-write.h"
-#include "system.h"
+#include "binary-io.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
 
-/* On reasonable systems, binary I/O is the default.  */
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
-
 void
 copy_file (src_filename, dest_filename)
      const char *src_filename;
index 0b5e7bf69133ccf9e6e5f21ec4f750925b9eadfc..6b11c7f009f1a0d76af4a265fac586dc0100b59f 100644 (file)
 #endif
 
 #include "error.h"
+#include "exit.h"
 #include "wait-process.h"
 #include "gettext.h"
 
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
 #ifndef STDIN_FILENO
 # define STDIN_FILENO 0
 #endif
diff --git a/lib/exit.h b/lib/exit.h
new file mode 100644 (file)
index 0000000..4e8d465
--- /dev/null
@@ -0,0 +1,32 @@
+/* exit() function.
+   Copyright (C) 1995, 2001 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _EXIT_H
+#define _EXIT_H
+
+/* Get exit() declaration.  */
+#include <stdlib.h>
+
+/* Some systems do not define EXIT_*, even with STDC_HEADERS.  */
+#ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+#endif
+#ifndef EXIT_FAILURE
+# define EXIT_FAILURE 1
+#endif
+
+#endif /* _EXIT_H */
index 601376824eaa7d369f20bf6b4d560faea37441a1..571ed4740be709dd480335b32cff21a06bdb6385 100644 (file)
@@ -32,7 +32,7 @@
 #endif
 
 #include "xmalloc.h"
-#include "system.h"
+#include "pathname.h"
 
 
 const char *
index 53c77697ebf92d6e3b42826a25cf69478cc7172c..5f1f51fc8d5122891e65174edafb666ef332fe98 100644 (file)
@@ -19,6 +19,7 @@
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
+#include "liballoca.h"
 
 /* Specification.  */
 #include "javacomp.h"
 #include "error.h"
 #include "gettext.h"
 
-#ifdef __GNUC__
-# ifndef alloca
-#  define alloca __builtin_alloca
-# endif
-#else
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
-# else
-#  ifdef _AIX
- #pragma alloca
-#  else
-#   ifdef __hpux /* This section must match that of bison generated files. */
-#    ifdef __cplusplus
-extern "C" void *alloca (unsigned int);
-#    else /* not __cplusplus */
-void *alloca ();
-#    endif /* not __cplusplus */
-#   else /* not __hpux */
-#    ifndef alloca
-char *alloca ();
-#    endif
-#   endif /* __hpux */
-#  endif
-# endif
-#endif
-
 #define _(str) gettext (str)
 
 
index b21516e29e9f45cb6b8f9938fcf63bbb8c35b1b4..d2a595e2920d8f17a5467856123c7f00fa9a1352 100644 (file)
@@ -19,6 +19,7 @@
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
+#include "liballoca.h"
 
 /* Specification.  */
 #include "javaexec.h"
 #include "error.h"
 #include "gettext.h"
 
-#ifdef __GNUC__
-# ifndef alloca
-#  define alloca __builtin_alloca
-# endif
-#else
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
-# else
-#  ifdef _AIX
- #pragma alloca
-#  else
-#   ifdef __hpux /* This section must match that of bison generated files. */
-#    ifdef __cplusplus
-extern "C" void *alloca (unsigned int);
-#    else /* not __cplusplus */
-void *alloca ();
-#    endif /* not __cplusplus */
-#   else /* not __hpux */
-#    ifndef alloca
-char *alloca ();
-#    endif
-#   endif /* __hpux */
-#  endif
-# endif
-#endif
-
 #define _(str) gettext (str)
 
 
diff --git a/lib/liballoca.h b/lib/liballoca.h
new file mode 100644 (file)
index 0000000..4a4276c
--- /dev/null
@@ -0,0 +1,56 @@
+/* Memory allocation on the stack.
+   Copyright (C) 1995, 1999, 2001 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+/* When this file is included, it may be preceded only by preprocessor
+   declarations.  Thanks to AIX.  Therefore we include it right after
+   "config.h", not later.  */
+
+#ifndef _LIBALLOCA_H
+#define _LIBALLOCA_H
+
+#ifdef __GNUC__
+# ifndef alloca
+#  define alloca __builtin_alloca
+# endif
+#else
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  alloca _alloca
+# else
+#  if HAVE_ALLOCA_H
+#   include <alloca.h>
+#  else
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifdef __hpux /* This section must match that of bison generated files. */
+#     ifdef __cplusplus
+extern "C" void *alloca (unsigned int);
+#     else /* not __cplusplus */
+void *alloca ();
+#     endif /* not __cplusplus */
+#    else /* not __hpux */
+#     ifndef alloca
+char *alloca ();
+#     endif
+#    endif /* __hpux */
+#   endif
+#  endif
+# endif
+#endif
+
+#endif /* _LIBALLOCA_H */
index 7afbee60202732013e974159a401fb10596117f7..02f4ae76c46acebd07273249a5f3e61a6b00958a 100644 (file)
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Specification.  */
 #include "linebreak.h"
 
-#include <stddef.h>
+#include <stdlib.h>
 #include <string.h>
 #include "c-ctype.h"
 
index f45e80e1984fd5ad3628accb81699e140bc82a90..59b7371872f196cb7cf9e4df9817883fa1cfd273 100644 (file)
@@ -27,7 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 # endif
 #endif
 
-#include <stdlib.h>
+/* Get size_t.  */
+#include <stddef.h>
 
 
 /* Display width.  */
index c4d2ad29ee0d6d32b1e55aba6cd17e0450f85f3f..b26174dc22cd300454da5c68ac6d537f7e9dd468 100644 (file)
@@ -1,5 +1,5 @@
 /* MIN, MAX macros.
-   Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1998, 2001 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
diff --git a/lib/pathname.h b/lib/pathname.h
new file mode 100644 (file)
index 0000000..d2a4c75
--- /dev/null
@@ -0,0 +1,59 @@
+/* Pathname support.
+   Copyright (C) 2001 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _PATHNAME_H
+#define _PATHNAME_H
+
+#ifndef PARAMS
+# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
+#  define PARAMS(args) args
+# else
+#  define PARAMS(args) ()
+# endif
+#endif
+
+/* Pathname support.
+   ISSLASH(C)           tests whether C is a directory separator character.
+   IS_ABSOLUTE_PATH(P)  tests whether P is an absolute path.  If it is not,
+                        it may be concatenated to a directory pathname.
+   IS_PATH_WITH_DIR(P)  tests whether P contains a directory specification.
+ */
+#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
+  /* Win32, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+# define HAS_DEVICE(P) \
+    ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
+     && (P)[1] == ':')
+# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
+# define IS_PATH_WITH_DIR(P) \
+    (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
+# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
+#else
+  /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
+# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
+# define FILESYSTEM_PREFIX_LEN(P) 0
+#endif
+
+/* Concatenate a directory pathname, a relative pathname and an optional
+   suffix.  Return a freshly allocated pathname.  */
+extern char *concatenated_pathname PARAMS ((const char *directory,
+                                           const char *filename,
+                                           const char *suffix));
+
+#endif /* _PATHNAME_H */
index a6fa72c2f02bd81e68dc001232df1dc8ad86f4aa..28c1b31c3d5368e24d045bae87085ed4ac6a4c94 100644 (file)
 #endif
 
 #include "error.h"
+#include "exit.h"
 #include "gettext.h"
 
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
 #ifndef STDIN_FILENO
 # define STDIN_FILENO 0
 #endif
index 1d24b9dbd37e43e7e8ba919c7493880a18d02ada..00380bff7f5795cfd8621a9dec3abb536b216ce8 100644 (file)
 #endif
 
 #include "error.h"
+#include "exit.h"
 #include "gettext.h"
 
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
 #ifndef STDIN_FILENO
 # define STDIN_FILENO 0
 #endif
index a54fc2c2a9ddf86592a287529716fab4497a7009..3ee8137a05ddc6675ad07c068ca975e0420b8e2f 100644 (file)
 #endif
 
 #include "error.h"
+#include "exit.h"
 #include "gettext.h"
 
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
 #ifndef STDIN_FILENO
 # define STDIN_FILENO 0
 #endif
index c35458e409367dd51b3c54163b5d216e3ac89eca..9653604de9cff09b4cb551eaf2d279b5e8d96679 100644 (file)
 #if HAVE_CONFIG_H
 # include <config.h>
 #endif
-
-#ifdef __GNUC__
-# ifndef alloca
-#  define alloca __builtin_alloca
-# endif
-#else
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
-# else
-#  ifdef _AIX
- #pragma alloca
-#  else
-#   ifdef __hpux /* This section must match that of bison generated files. */
-#    ifdef __cplusplus
-extern "C" void *alloca (unsigned int);
-#    else /* not __cplusplus */
-void *alloca ();
-#    endif /* not __cplusplus */
-#   else /* not __hpux */
-#    ifndef alloca
-char *alloca ();
-#    endif
-#   endif /* __hpux */
-#  endif
-# endif
-#endif
+#include "liballoca.h"
 
 #include <errno.h>
 #if !_LIBC
diff --git a/lib/stpcpy.h b/lib/stpcpy.h
new file mode 100644 (file)
index 0000000..ce8fe0e
--- /dev/null
@@ -0,0 +1,40 @@
+/* String copying.
+   Copyright (C) 1995, 2001 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _STPCPY_H
+#define _STPCPY_H
+
+#ifndef PARAMS
+# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
+#  define PARAMS(args) args
+# else
+#  define PARAMS(args) ()
+# endif
+#endif
+
+#if HAVE_STPCPY
+
+/* Get stpcpy() declaration.  */
+#include <string.h>
+
+#else
+
+extern char *stpcpy PARAMS ((char *__dst, const char *__src));
+
+#endif
+
+#endif /* _STPCPY_H */
diff --git a/lib/stpncpy.h b/lib/stpncpy.h
new file mode 100644 (file)
index 0000000..0c4df53
--- /dev/null
@@ -0,0 +1,42 @@
+/* String copying.
+   Copyright (C) 1995, 2001 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _STPNCPY_H
+#define _STPNCPY_H
+
+#ifndef PARAMS
+# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
+#  define PARAMS(args) args
+# else
+#  define PARAMS(args) ()
+# endif
+#endif
+
+#if HAVE_STPNCPY
+
+/* Get stpncpy() declaration.  */
+#include <string.h>
+
+#else
+
+#include <stddef.h>
+
+extern char *stpncpy PARAMS ((char *__dst, const char *__src, size_t __n));
+
+#endif
+
+#endif /* _STPNCPY_H */
diff --git a/lib/strcase.h b/lib/strcase.h
new file mode 100644 (file)
index 0000000..be2d0dd
--- /dev/null
@@ -0,0 +1,35 @@
+/* Case-insensitive string comparison functions.
+   Copyright (C) 1995-1996, 2001 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _STRCASE_H
+#define _STRCASE_H
+
+#include <stddef.h>
+
+#ifndef PARAMS
+# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
+#  define PARAMS(args) args
+# else
+#  define PARAMS(args) ()
+# endif
+#endif
+
+extern int strcasecmp PARAMS ((const char *__s1, const char *__s2));
+extern int strncasecmp PARAMS ((const char *__s1, const char *__s2,
+                               size_t __n));
+
+#endif /* _STRCASE_H */
diff --git a/lib/system.h b/lib/system.h
deleted file mode 100644 (file)
index 637ed0f..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/* Header for GNU gettext libiberty
-   Copyright (C) 1995-1997, 2000, 2001 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#ifndef _SYSTEM_H
-#define _SYSTEM_H 1
-
-#ifndef PARAMS
-# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
-#  define PARAMS(args) args
-# else
-#  define PARAMS(args) ()
-# endif
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-
-#if defined STDC_HEADERS
-# include <stdlib.h>
-#else
-# ifdef HAVE_MALLOC_H
-#  include <malloc.h>
-# endif
-unsigned long strtoul ();
-#endif
-
-/* Wrapper functions with error checking for standard functions.  */
-extern char *xgetcwd PARAMS ((void));
-extern char *stpcpy PARAMS ((char *__dst, const char *__src));
-extern char *stpncpy PARAMS ((char *__dst, const char *__src, size_t __n));
-extern int strcasecmp PARAMS ((const char *__s1, const char *__s2));
-extern int strncasecmp PARAMS ((const char *__s1, const char *__s2,
-                               size_t __n));
-
-#include <string.h>
-#if !STDC_HEADERS && HAVE_MEMORY_H
-# include <memory.h>
-#endif
-#if !HAVE_MEMCPY
-# ifndef memcpy
-#  define memcpy(D, S, N) bcopy ((S), (D), (N))
-# endif
-#endif
-
-#ifdef __GNUC__
-# ifndef alloca
-#  define alloca __builtin_alloca
-# endif
-#else
-# if HAVE_ALLOCA_H
-#  include <alloca.h>
-# else
-#  ifdef _AIX
- #pragma alloca
-#  else
-#   ifdef __hpux /* This section must match that of bison generated files. */
-#    ifdef __cplusplus
-extern "C" void *alloca (unsigned int);
-#    else /* not __cplusplus */
-void *alloca ();
-#    endif /* not __cplusplus */
-#   else /* not __hpux */
-#    ifndef alloca
-char *alloca ();
-#    endif
-#   endif /* __hpux */
-#  endif
-# endif
-#endif
-
-/* Some systems do not define EXIT_*, even with STDC_HEADERS.  */
-#ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-#endif
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
-
-/* Pathname support.
-   ISSLASH(C)           tests whether C is a directory separator character.
-   IS_ABSOLUTE_PATH(P)  tests whether P is an absolute path.  If it is not,
-                        it may be concatenated to a directory pathname.
-   IS_PATH_WITH_DIR(P)  tests whether P contains a directory specification.
- */
-#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
-  /* Win32, OS/2, DOS */
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-# define HAS_DEVICE(P) \
-    ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
-     && (P)[1] == ':')
-# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
-# define IS_PATH_WITH_DIR(P) \
-    (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
-# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
-#else
-  /* Unix */
-# define ISSLASH(C) ((C) == '/')
-# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
-# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
-# define FILESYSTEM_PREFIX_LEN(P) 0
-#endif
-
-/* Concatenate a directory pathname, a relative pathname and an optional
-   suffix.  Return a freshly allocated pathname.  */
-extern char *concatenated_pathname PARAMS ((const char *directory,
-                                           const char *filename,
-                                           const char *suffix));
-
-
-#include <fcntl.h>
-/* For systems that distinguish between text and binary I/O.
-   O_BINARY is usually declared in <fcntl.h>. */
-#if !defined O_BINARY && defined _O_BINARY
-  /* For MSC-compatible compilers.  */
-# define O_BINARY _O_BINARY
-# define O_TEXT _O_TEXT
-#endif
-#ifdef __BEOS__
-  /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect.  */
-# undef O_BINARY
-# undef O_TEXT
-#endif
-#if O_BINARY
-# if !(defined(__EMX__) || defined(__DJGPP__))
-#  define setmode _setmode
-#  define fileno _fileno
-# endif
-# ifdef __DJGPP__
-#  include <io.h> /* declares setmode() */
-#  include <unistd.h> /* declares isatty() */
-#  /* Avoid putting stdin/stdout in binary mode if it is connected to the
-#     console, because that would make it impossible for the user to
-#     interrupt the program through Ctrl-C or Ctrl-Break.  */
-#  define SET_BINARY(fd) (!isatty(fd) ? (setmode(fd,O_BINARY), 0) : 0)
-# else
-#  define SET_BINARY(fd) setmode(fd,O_BINARY)
-# endif
-#else
-# define SET_BINARY(fd) /* nothing */
-#endif
-
-#endif
index 2b2dd98a8544943abcdd8791180af791d679c91a..6946ebc97a8dc919322109f6c711ead31c23d631 100644 (file)
 #endif
 
 #include "error.h"
+#include "exit.h"
 #include "gettext.h"
 
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
 #define _(str) gettext (str)
 
 
index 1ea6d1afb3b88d1b4d19aba21a4abc91afada8d1..349bb734e661eb5ebe01caefd766148cd19a897a 100644 (file)
 
 #include "error.h"
 #include "progname.h"
+#include "exit.h"
 #include "mbswidth.h"
 #include "gettext.h"
 
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
 #define _(str) gettext (str)
 
 #if __STDC__
diff --git a/lib/xgetcwd.h b/lib/xgetcwd.h
new file mode 100644 (file)
index 0000000..2f6df8a
--- /dev/null
@@ -0,0 +1,27 @@
+/* xgetcwd -- return current directory with unlimited length
+   Copyright (C) 1995, 2001 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef PARAMS
+# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES
+#  define PARAMS(args) args
+# else
+#  define PARAMS(args) ()
+# endif
+#endif
+
+/* Wrapper function with error checking for standard function.  */
+extern char *xgetcwd PARAMS ((void));
index 367e9effe14337845243f57cc5ed9c35323bd565..d7fa812792f31bb7138fc336f8a159ab4bfd174a 100644 (file)
 #include <stdlib.h>
 
 #include "error.h"
+#include "exit.h"
 #include "gettext.h"
 
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
 #define _(str) gettext (str)
 
 
index a6c506dff4fdcdc1c69438252e168fb79f1666bf..1b38169833d28ffac70e288dd34888fba8c15032 100644 (file)
@@ -1,3 +1,66 @@
+2001-12-22  Bruno Haible  <bruno@clisp.org>
+
+       * dir-list.c: Include <stddef.h> instead of <stdlib.h>.
+       * xgettext.h: Likewise.
+       * file-list.c: Include exit.h instead of system.h.
+       * gettext.c: Likewise.
+       * hostname.c: Likewise.
+       * msgattrib.c: Likewise.
+       * msgcat.c: Likewise.
+       * msgcomm.c: Likewise.
+       * msgconv.c: Likewise.
+       * msgexec.c: Likewise.
+       * msgunfmt.c: Likewise.
+       * msguniq.c: Likewise.
+       * ngettext.c: Likewise.
+       * read-java.c: Likewise.
+       * x-ycp.c: Likewise.
+       * msgcmp.c: Include exit.h instead of system.h. Don't include
+       str-list.h.
+       * msgfilter.c: Likewise.
+       * msgen.c: Include exit.h instead of system.h. Don't include xmalloc.h.
+       * msgfmt.c: Include exit.h, stpcpy.h instead of system.h. Don't
+       include <errno.h>, getline.h.
+       * msggrep.c: Include exit.h instead of system.h. Don't include
+       <fcntl.h>.
+       * msginit.c: Include liballoca.h, <limits.h>, exit.h, pathname.h
+       instead of system.h.
+       * msgl-cat.c: Include liballoca.h, exit.h instead of system.h.
+       Include <stddef.h> instead of <stdlib.h>.
+       * msgl-charset.c: Likewise.
+       * msgl-iconv.c: Include liballoca.h, exit.h instead of system.h.
+       * write-po.c: Likewise.
+       * msgmerge.c: Include liballoca.h, exit.h, strcase.h, stpcpy.h,
+       stpncpy.h instead of system.h.
+       * format-java.c: Include liballoca.h.
+       * format-lisp.c: Don't include system.h.
+       * open-po.c: Include pathname.h, xmalloc.h instead of system.h.
+       Don't include <sys/types.h>, error.h.
+       * po-charset.c: Include liballoca.h, string.h, strcase.h instead of
+       system.h. Don't include error.h. Include progname.h.
+       (program_name): Remove declaration.
+       * po-gram-gen.y: Include <string.h>.
+       * po-hash-gen.y: Include <string.h>.
+       * po-lex.c: Include exit.h instead of system.h. Don't include
+       <sys/types.h>.
+       * read-mo.c: Include binary-io.h, exit.h instead of system.h.
+       Include <stddef.h> instead of <stdlib.h>.
+       * urlget.c: Include <unistd.h>, binary-io.h, exit.h instead of
+       system.h.
+       (O_BINARY): Remove fallback definition.
+       * write-java.c: Include liballoca.h, pathname.h instead of system.h.
+       * write-mo.c: Include liballoca.h, binary-io.h, exit.h instead of
+       system.h. Don't include msgfmt.h.
+       * x-c.c: Include exit.h instead of system.h. Don't include <ctype.h>.
+       * x-librep.c: Include exit.h instead of system.h. Include hash.h.
+       * x-lisp.c: Likewise.
+       * x-rst.c: Include exit.h instead of system.h. Include <stddef.h>
+       instead of <stdlib.h>.
+       * xgettext.c: Include <string.h>, exit.h, pathname.h, strcase.h,
+       stpcpy.h instead of system.h. Include str-list.h. Don't include
+       <sys/param.h>, <pwd.h>, <sys/types.h>, <unistd.h>, getline.h.
+       (getpwuid): Remove declaration.
+
 2001-12-21  Bruno Haible  <bruno@clisp.org>
 
        * format-lisp.c: Include minmax.h.
index 9761ffa2b687a4566c686896b6bc259ef8eec6b8..851b8524b121bd58f26bd3f21e73a29cefe4c661 100644 (file)
@@ -25,9 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Specification.  */
 #include "dir-list.h"
 
-#include <stdlib.h>
+#include <stddef.h>
 
-#include "system.h"
 #include "str-list.h"
 
 static string_list_ty *directory /* = NULL */;
index 9711ceddc12ed6a0281fa250ce538dc1d93c1db8..2c9a007c18efea7ce3878796e3c33222fa87f3bb 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "str-list.h"
 #include "error.h"
-#include "system.h"
+#include "exit.h"
 #include "getline.h"
 #include "gettext.h"
 
index 2f5bd3cc42354fdb1e5e7bc0cd3dcfaeed1c9f8c..dc076806075e732752211a48a8dd803c16de5e77 100644 (file)
@@ -19,6 +19,7 @@
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
+#include "liballoca.h"
 
 #include <stdbool.h>
 #include <stdlib.h>
index 58c4b8f1eea3c9710d2cfb7761cec7e1ef851f2f..deba63c20a6f0376b439edf02722ecb79d28946b 100644 (file)
@@ -28,7 +28,6 @@
 #include "gcd.h"
 #include "xmalloc.h"
 #include "minmax.h"
-#include "system.h"
 #include "error.h"
 #include "progname.h"
 #include "gettext.h"
index b604f2ee715704b501c4130a4881601cb0dbebd0..29b7dbb7456e591312bd7df16fa48e58d2931352 100644 (file)
@@ -29,7 +29,7 @@
 #include "error.h"
 #include "basename.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
 
 #ifdef TESTS
 # define HAVE_SETLOCALE 1
index 8d21a819b94bdeb359e94b6fe414181b08cb4848..7208f53b765c23bdfa46a6f0e1e176da46c16288 100644 (file)
@@ -74,7 +74,7 @@
 #include "progname.h"
 #include "basename.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
index 300cc142522b09df417ee423f4e405e687b9405c..870312f980e73cd7f940d5ebe5bb3d0c9330898e 100644 (file)
@@ -34,7 +34,7 @@
 #include "message.h"
 #include "read-po.h"
 #include "write-po.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
index 19fb0fa56b8ea6a6e83d40dec41d3a8913a117b8..2324dcb2cf87f5040f23b0b506d237a6a9280163 100644 (file)
@@ -37,7 +37,7 @@
 #include "read-po.h"
 #include "write-po.h"
 #include "msgl-cat.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
index 0d3dc458f7ccaa9d0852b46d6742afce32bf6ac9..834374c4ca180870cb645f492750d59ebba9b36b 100644 (file)
 #include "progname.h"
 #include "basename.h"
 #include "message.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 #include "po.h"
-#include "str-list.h"
 
 #define _(str) gettext (str)
 
index 4e759d9c5ee6fd07cc4497452d0259ca9758a757..e38963ef0609818cd5f9fd4e18c8f624950b7ac0 100644 (file)
@@ -37,7 +37,7 @@
 #include "read-po.h"
 #include "write-po.h"
 #include "msgl-cat.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 
index 7ef8dcf6f8c093debaa2cf4158ce0e0a0f7d330b..e345ce7cfb2b4494defc762081124d7a18b591e3 100644 (file)
@@ -34,7 +34,7 @@
 #include "read-po.h"
 #include "write-po.h"
 #include "msgl-iconv.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
index 7f3eeebd7ad6aff172635886fa96072d509fbcb5..ab3241b436b5366685d6b90574d3d8c0c328d98f 100644 (file)
@@ -34,8 +34,7 @@
 #include "read-po.h"
 #include "msgl-english.h"
 #include "write-po.h"
-#include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
index 54716d368572ed3b6139f6d66d44054f1d739093..7dbdae91f66af3d637396654e1c1858e12ad9ce4 100644 (file)
@@ -41,7 +41,7 @@
 #include "message.h"
 #include "read-po.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
 #include "full-write.h"
 #include "findprog.h"
 #include "pipe.h"
index 225518ac8ba7c17ebdc0135db00ebb4d178f21e0..5cca360167b0035e5af6c2107d15c76cca5063e4 100644 (file)
 #include "message.h"
 #include "read-po.h"
 #include "write-po.h"
-#include "str-list.h"
 #include "msgl-charset.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
 #include "findprog.h"
 #include "pipe.h"
 #include "wait-process.h"
index 23e5798e08bebde2a442576f1a6f8dff5748e7e1..669f1bb1fc81c7febcdf076dc8ac449c9535babb 100644 (file)
@@ -21,7 +21,6 @@
 #endif
 
 #include <ctype.h>
-#include <errno.h>
 #include <getopt.h>
 #include <limits.h>
 #include <setjmp.h>
 #include "progname.h"
 #include "basename.h"
 #include "xerror.h"
-#include "getline.h"
 #include "format.h"
 #include "xmalloc.h"
 #include "plural-exp.h"
 #include "strstr.h"
-#include "system.h"
+#include "stpcpy.h"
+#include "exit.h"
 #include "msgfmt.h"
 #include "write-mo.h"
 #include "write-java.h"
index ec356d8ec7b98b486787f6704717c8772017e1ae..d9013a53ed9d7f852313b4c660c9707ee00c26b9 100644 (file)
@@ -22,7 +22,6 @@
 #endif
 
 #include <errno.h>
-#include <fcntl.h>
 #include <getopt.h>
 #include <limits.h>
 #include <locale.h>
@@ -46,7 +45,7 @@
 #include "str-list.h"
 #include "msgl-charset.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
 #include "full-write.h"
 #include "findprog.h"
 #include "pipe.h"
index 3d2f562f013ba244821d90fd8434d15f85fcd7e5..f999765d5a3481af27fc8698bd57655d6c3fc736 100644 (file)
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
+#include "liballoca.h"
 
 #include <errno.h>
 #include <getopt.h>
+#include <limits.h>
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -73,7 +75,8 @@
 #include "po-charset.h"
 #include "po-time.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
+#include "pathname.h"
 #include "xerror.h"
 #include "msgl-english.h"
 #include "pipe.h"
index 8bc0883eb7a7ec1e76873cecd661d0c6501a8f0c..c0a23b98e7fbe8fb6dbd14c1461db321afda993d 100644 (file)
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
+#include "liballoca.h"
 
 /* Specification.  */
 #include "msgl-cat.h"
 
 #include <stdbool.h>
-#include <stdlib.h>
+#include <stddef.h>
 #include <string.h>
 
 #include "error.h"
@@ -39,7 +40,7 @@
 #include "xmalloc.h"
 #include "strstr.h"
 #include "basename.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
index b77e0bcece618df2b3d8a1c788b1d2958edc7ef7..850ddc8018e7f1a813ac105acb7d30702e88f221 100644 (file)
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
+#include "liballoca.h"
 
 /* Specification.  */
 #include "msgl-charset.h"
 
-#include <stdlib.h>
+#include <stddef.h>
 #include <string.h>
 
 #include "po-charset.h"
@@ -34,7 +35,7 @@
 #include "xerror.h"
 #include "message.h"
 #include "strstr.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
index 32b1f13311493c700ff7ddf1b990423c33f0d363..06b857f9370653cc3b78242ea7c10de71f76c322 100644 (file)
@@ -20,6 +20,7 @@
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
+#include "liballoca.h"
 
 /* Specification.  */
 #include "msgl-iconv.h"
@@ -40,7 +41,7 @@
 #include "msgl-ascii.h"
 #include "xmalloc.h"
 #include "strstr.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
index 0ec4e1e9ff4efe3a5bfab68aae0cfcce16c53c7c..19b1433a39aaae2403f7af3d79d7fd4218f5eb62 100644 (file)
@@ -19,6 +19,7 @@
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
+#include "liballoca.h"
 
 #include <getopt.h>
 #include <limits.h>
 #include "format.h"
 #include "xmalloc.h"
 #include "strstr.h"
-#include "system.h"
+#include "exit.h"
+#include "strcase.h"
+#include "stpcpy.h"
+#include "stpncpy.h"
 #include "po.h"
 #include "msgl-equal.h"
 #include "plural-exp.h"
index caa940525f1ac1d38d2d9f34987515bf27c94f95..9d40a6a710eda27adac70feaa60954365f90553e 100644 (file)
@@ -29,7 +29,7 @@
 #include "error.h"
 #include "progname.h"
 #include "basename.h"
-#include "system.h"
+#include "exit.h"
 #include "message.h"
 #include "msgunfmt.h"
 #include "read-mo.h"
index 11a05ffa19d67c9fa3c099e1385f56264e2452c6..b84941c3c2395b7ea082052c2a92c47f04b9ca6b 100644 (file)
@@ -36,7 +36,7 @@
 #include "read-po.h"
 #include "write-po.h"
 #include "msgl-cat.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
index 4df8e93b7ff42f84896c567fd65793bd1338f604..3cec8281ff228b23ce6a9f7a7b5dc0e26773b865 100644 (file)
@@ -29,7 +29,7 @@
 #include "error.h"
 #include "basename.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
 
 #include "gettext.h"
 
index 6612fd345a6264d0fce263902e5d323aafcb170f..8d2e10d9d2c0a24bfdc7c33622100adaa7ffa041 100644 (file)
@@ -25,26 +25,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include <errno.h>
 #include <stdio.h>
-#include <sys/types.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "dir-list.h"
-#include "error.h"
-#include "system.h"
-
+#include "pathname.h"
+#include "xmalloc.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
 
-#ifndef errno
-extern int errno;
-#endif
-
-/* Prototypes for helper functions.  Needed to ensure compiler checking of
-   function argument counts despite of K&R C function definition syntax.  */
-extern char *xstrdup PARAMS ((const char *string));
-
 /* This macro is used to determine the number of elements in an erray.  */
 #define SIZEOF(a) (sizeof(a)/sizeof(a[0]))
 
index 1d6573fef3755e66c56201c5fd7e60690bcc42c6..4e25d6ed926339b301c156fdbd05cefc21cfd97c 100644 (file)
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
+#include "liballoca.h"
 
 /* Specification.  */
 #include "po-charset.h"
 
 #include <stdlib.h>
+#include <string.h>
 
-#include "error.h"
 #include "xerror.h"
 #include "basename.h"
+#include "progname.h"
 #include "strstr.h"
-#include "system.h"
+#include "strcase.h"
 #include "gettext.h"
 
-extern const char *program_name;
-
 #define _(str) gettext (str)
 
 #define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
index 5efd51a6e6f6bc153cdd78033482b0f66f4a91f1..3b484d448e4eb9f8ebd459bb4c09669a01ec7c84 100644 (file)
@@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "str-list.h"
 #include "po-lex.h"
index 7afac284dc3723881fe5629c31bcec8c5f1c32fe..bbb391ca61dd8f607ff970a609fc53c46a7de2dc 100644 (file)
@@ -36,6 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "xmalloc.h"
 #include "po.h"
index 6191f34f73112d0caf124127c1ae049e2474e8d1..98a6eca3f8924de6a714783ccf4ebada482367b4 100644 (file)
@@ -31,7 +31,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/types.h>
 
 #if HAVE_ICONV
 # include <iconv.h>
 # define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
 #endif
 
-#include "str-list.h"
 #include "po-charset.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
 #include "error.h"
 #include "open-po.h"
+
+#include "str-list.h"
 #include "po-gram-gen2.h"
 
 #if HAVE_ICONV
index 8b46089eb35ea757e9a4da6d5d7b775ec93ecb2f..6ca86a698c81c3cd1846a99c0d792a68018ea81b 100644 (file)
@@ -34,7 +34,7 @@
 #include "wait-process.h"
 #include "read-po.h"
 #include "error.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
index 7b4c4542a5628388471686e7f901c7af3dc34fd9..dffe573a18a624359a81cb39eebc51ca9909699e 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <errno.h>
 #include <stdio.h>
-#include <stdlib.h>
+#include <stddef.h>
 #include <string.h>
 
 /* This include file describes the main part of binary .mo format.  */
@@ -33,7 +33,8 @@
 
 #include "error.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "binary-io.h"
+#include "exit.h"
 #include "message.h"
 #include "gettext.h"
 
index 7f1e618fd2991b636763745880638803e29c3bd5..6d18392c57608836ad811d9d0727027f264a15d3 100644 (file)
 #include <stdlib.h>
 #include <locale.h>
 
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
 #include "error.h"
 #include "progname.h"
 #include "basename.h"
 #include "full-write.h"
 #include "execute.h"
 #include "javaexec.h"
-#include "system.h"
+#include "exit.h"
+#include "binary-io.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
 
-/* On reasonable systems, binary I/O is the default.  */
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
-
 #ifndef STDOUT_FILENO 
 # define STDOUT_FILENO 1
 #endif
index dc238e589133ffcf5921b54c846e996171f4fa26..21a244a2c8d40ed2d3292a86d8eec3855ba95389 100644 (file)
@@ -19,6 +19,7 @@
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
+#include "liballoca.h"
 
 /* Specification.  */
 #include "write-java.h"
@@ -72,7 +73,7 @@
 #include "plural-exp.h"
 #include "po-charset.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "pathname.h"
 #include "tmpdir.h"
 #include "utf8-ucs4.h"
 #include "gettext.h"
index 7d1fc6b44637bf6d91568a0e6a14f761361505cc..a4b6d9c1bce7ca535998b79ec8b451fa370cbc5d 100644 (file)
@@ -24,6 +24,7 @@
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
+#include "liballoca.h"
 
 /* Specification.  */
 #include "write-mo.h"
@@ -35,8 +36,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "msgfmt.h"
-
 /* These two include files describe the binary .mo format.  */
 #include "gmo.h"
 #include "hash-string.h"
@@ -44,7 +43,8 @@
 #include "error.h"
 #include "hash.h"
 #include "message.h"
-#include "system.h"
+#include "binary-io.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
index e1ca1b25279e91dc6ceb3fc2a605658fb5919c54..7f30e30927fec3f90235cbfc8e8625c7c875cfc9 100644 (file)
@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
+#include "liballoca.h"
 
 /* Specification.  */
 #include "write-po.h"
@@ -39,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "msgl-ascii.h"
 #include "xmalloc.h"
 #include "strstr.h"
-#include "system.h"
+#include "exit.h"
 #include "error.h"
 #include "xerror.h"
 #include "gettext.h"
index 074ce0550a207e3b0d096145e82365a4fdf04abd..4b1cee112b7d2d954ea2578a570fb8bfccdc6c7d 100644 (file)
--- a/src/x-c.c
+++ b/src/x-c.c
@@ -21,7 +21,6 @@
 # include "config.h"
 #endif
 
-#include <ctype.h>
 #include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
@@ -34,7 +33,7 @@
 #include "error.h"
 #include "progname.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
 #include "hash.h"
 #include "gettext.h"
 
index a00a18652a023605bf0e5f0d192d21a08eed41b4..2de5a5c6badf5175f7343bf031c13605a99c703d 100644 (file)
@@ -33,7 +33,8 @@
 #include "xgettext.h"
 #include "error.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
+#include "hash.h"
 #include "gettext.h"
 
 #define _(s) gettext(s)
index 03d338234f572c00a60e6db059f1e381c34d9e9a..59644ff8b0a216255d7aceeec14c0f9528e2718e 100644 (file)
@@ -32,7 +32,8 @@
 #include "xgettext.h"
 #include "error.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
+#include "hash.h"
 #include "gettext.h"
 
 #define _(s) gettext(s)
index 8a0a92a084100a3acff3944c2e4af4f522bc6d37..cd1ac8618e49f5d0b0f9203c72199c44ddba8542 100644 (file)
@@ -24,7 +24,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <stdio.h>
-#include <stdlib.h>
+#include <stddef.h>
 
 #include "message.h"
 #include "x-rst.h"
@@ -32,7 +32,7 @@
 #include "error.h"
 #include "progname.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(s) gettext(s)
index cea6463348261d9e98cded29887899d389ec5c80..7fb0088dbf933e4e10fe0faa16943d8591b3583b 100644 (file)
@@ -33,7 +33,7 @@
 #include "xgettext.h"
 #include "error.h"
 #include "xmalloc.h"
-#include "system.h"
+#include "exit.h"
 #include "gettext.h"
 
 #define _(s) gettext(s)
index eef07c68151849631d835f7a92f294c07e5e3537..4d02d8272cc2e3c90621a25892f3998d0cf0ba7f 100644 (file)
 #include <ctype.h>
 #include <errno.h>
 #include <getopt.h>
-#include <sys/param.h>
-#include <pwd.h>
 #include <stdio.h>
 #include <time.h>
-#include <sys/types.h>
 #include <stdlib.h>
 #include <stdbool.h>
+#include <string.h>
 #include <locale.h>
 #include <limits.h>
 
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
 #include "xgettext.h"
 #include "dir-list.h"
 #include "file-list.h"
+#include "str-list.h"
 #include "error.h"
 #include "progname.h"
 #include "basename.h"
 #include "xerror.h"
-#include "getline.h"
 #include "xmalloc.h"
 #include "strstr.h"
 #include "xerror.h"
-#include "system.h"
+#include "exit.h"
+#include "pathname.h"
+#include "strcase.h"
+#include "stpcpy.h"
 #include "po.h"
 #include "message.h"
 #include "po-time.h"
 #include "format.h"
 #include "gettext.h"
 
-#ifndef _POSIX_VERSION
-struct passwd *getpwuid ();
-#endif
-
 /* A convenience macro.  I don't like writing gettext() every time.  */
 #define _(str) gettext (str)
 
index c384fc1f2957fcd7e390febfc0f357a130bc25e1..f8649b2c8dce90c6ba05a5920703d4b0e7f34084 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef _XGETTEXT_H
 #define _XGETTEXT_H
 
-#include <stdlib.h>
+#include <stddef.h>
 #include "message.h"
 #include "pos.h"
 
index a478edf31119dd3e172edb5fa1cea501f006497b..02300851f9fe1338bfb52c2c90c326db7e3fcb83 100644 (file)
@@ -1,3 +1,7 @@
+2001-12-22  Bruno Haible  <bruno@clisp.org>
+
+       * tstngettext.c: Include exit.h instead of system.h.
+
 2001-12-21  Bruno Haible  <bruno@clisp.org>
 
        * msgfilter-1: Avoid failure on HP-UX, due to strange 'fold' program.
index 526b346e75344399822cae7f46dfcc67862b7e84..49ceea708cfcdb38f76a124ae3c7a9d067dbc428 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "error.h"
 #include "basename.h"
-#include "system.h"
+#include "exit.h"
 
 #define HAVE_SETLOCALE 1
 /* Make sure we use the included libintl, not the system's one. */