diff options
Diffstat (limited to 'gl')
-rw-r--r-- | gl/charset.alias | 5 | ||||
-rw-r--r-- | gl/configmake.h | 25 | ||||
-rw-r--r-- | gl/math.h | 442 | ||||
-rw-r--r-- | gl/ref-add.sed | 10 | ||||
-rw-r--r-- | gl/ref-del.sed | 5 | ||||
-rw-r--r-- | gl/stdio.h | 411 | ||||
-rw-r--r-- | gl/stdlib.h | 237 | ||||
-rw-r--r-- | gl/string.h | 598 | ||||
-rw-r--r-- | gl/unistd.h | 321 |
9 files changed, 0 insertions, 2054 deletions
diff --git a/gl/charset.alias b/gl/charset.alias deleted file mode 100644 index d9501e2b..00000000 --- a/gl/charset.alias +++ /dev/null @@ -1,5 +0,0 @@ -# This file contains a table of character encoding aliases, -# suitable for operating system 'linux-gnu'. -# It was automatically generated from config.charset. -# Packages using this file: -ISO_646.IRV:1983 ASCII diff --git a/gl/configmake.h b/gl/configmake.h deleted file mode 100644 index f73bc381..00000000 --- a/gl/configmake.h +++ /dev/null @@ -1,25 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -#define PREFIX "/usr/local/nagios" -#define EXEC_PREFIX "/usr/local/nagios" -#define BINDIR "/usr/local/nagios/bin" -#define SBINDIR "/usr/local/nagios/sbin" -#define LIBEXECDIR "/usr/local/nagios/libexec" -#define DATAROOTDIR "/usr/local/nagios/share" -#define DATADIR "/usr/local/nagios/share" -#define SYSCONFDIR "/usr/local/nagios/etc" -#define SHAREDSTATEDIR "/usr/local/nagios/com" -#define LOCALSTATEDIR "/usr/local/nagios/var" -#define INCLUDEDIR "/usr/local/nagios/include" -#define OLDINCLUDEDIR "/usr/include" -#define DOCDIR "/usr/local/nagios/share/doc/nagios-plugins" -#define INFODIR "/usr/local/nagios/share/info" -#define HTMLDIR "/usr/local/nagios/share/doc/nagios-plugins" -#define DVIDIR "/usr/local/nagios/share/doc/nagios-plugins" -#define PDFDIR "/usr/local/nagios/share/doc/nagios-plugins" -#define PSDIR "/usr/local/nagios/share/doc/nagios-plugins" -#define LIBDIR "/usr/local/nagios/lib" -#define LOCALEDIR "/usr/local/nagios/share/locale" -#define MANDIR "/usr/local/nagios/share/man" -#define PKGDATADIR "/usr/local/nagios/share/nagios-plugins" -#define PKGINCLUDEDIR "/usr/local/nagios/include/nagios-plugins" -#define PKGLIBDIR "/usr/local/nagios/lib/nagios-plugins" diff --git a/gl/math.h b/gl/math.h deleted file mode 100644 index 9db986e0..00000000 --- a/gl/math.h +++ /dev/null @@ -1,442 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* A GNU-like <math.h>. - - Copyright (C) 2002-2003, 2007 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. */ - -#ifndef _GL_MATH_H - -/* The include_next requires a split double-inclusion guard. */ -#include_next <math.h> - -#ifndef _GL_MATH_H -#define _GL_MATH_H - - -/* The definition of GL_LINK_WARNING is copied here. */ -/* GL_LINK_WARNING("literal string") arranges to emit the literal string as - a linker warning on most glibc systems. - We use a linker warning rather than a preprocessor warning, because - #warning cannot be used inside macros. */ -#ifndef GL_LINK_WARNING - /* This works on platforms with GNU ld and ELF object format. - Testing __GLIBC__ is sufficient for asserting that GNU ld is in use. - Testing __ELF__ guarantees the ELF object format. - Testing __GNUC__ is necessary for the compound expression syntax. */ -# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__ -# define GL_LINK_WARNING(message) \ - GL_LINK_WARNING1 (__FILE__, __LINE__, message) -# define GL_LINK_WARNING1(file, line, message) \ - GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */ -# define GL_LINK_WARNING2(file, line, message) \ - GL_LINK_WARNING3 (file ":" #line ": warning: " message) -# define GL_LINK_WARNING3(message) \ - ({ static const char warning[sizeof (message)] \ - __attribute__ ((__unused__, \ - __section__ (".gnu.warning"), \ - __aligned__ (1))) \ - = message "\n"; \ - (void)0; \ - }) -# else -# define GL_LINK_WARNING(message) ((void) 0) -# endif -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Write x as - x = mantissa * 2^exp - where - If x finite and nonzero: 0.5 <= |mantissa| < 1.0. - If x is zero: mantissa = x, exp = 0. - If x is infinite or NaN: mantissa = x, exp unspecified. - Store exp in *EXPPTR and return mantissa. */ -#if 0 -# if 0 -# define frexp rpl_frexp -extern double frexp (double x, int *expptr); -# endif -#elif defined GNULIB_POSIXCHECK -# undef frexp -# define frexp(x,e) \ - (GL_LINK_WARNING ("frexp is unportable - " \ - "use gnulib module frexp for portability"), \ - frexp (x, e)) -#endif - - -#if 0 || !1 -extern long double acosl (long double x); -#endif -#if !0 && defined GNULIB_POSIXCHECK -# undef acosl -# define acosl(x) \ - (GL_LINK_WARNING ("acosl is unportable - " \ - "use gnulib module mathl for portability"), \ - acosl (x)) -#endif - - -#if 0 || !1 -extern long double asinl (long double x); -#endif -#if !0 && defined GNULIB_POSIXCHECK -# undef asinl -# define asinl(x) \ - (GL_LINK_WARNING ("asinl is unportable - " \ - "use gnulib module mathl for portability"), \ - asinl (x)) -#endif - - -#if 0 || !1 -extern long double atanl (long double x); -#endif -#if !0 && defined GNULIB_POSIXCHECK -# undef atanl -# define atanl(x) \ - (GL_LINK_WARNING ("atanl is unportable - " \ - "use gnulib module mathl for portability"), \ - atanl (x)) -#endif - - -#if 0 -# if 0 -# define ceilf rpl_ceilf -extern float ceilf (float x); -# endif -#elif defined GNULIB_POSIXCHECK -# undef ceilf -# define ceilf(x) \ - (GL_LINK_WARNING ("ceilf is unportable - " \ - "use gnulib module ceilf for portability"), \ - ceilf (x)) -#endif - -#if 0 -# if 0 -# define ceill rpl_ceill -extern long double ceill (long double x); -# endif -#elif defined GNULIB_POSIXCHECK -# undef ceill -# define ceill(x) \ - (GL_LINK_WARNING ("ceill is unportable - " \ - "use gnulib module ceill for portability"), \ - ceill (x)) -#endif - - -#if 0 || !1 -extern long double cosl (long double x); -#endif -#if !0 && defined GNULIB_POSIXCHECK -# undef cosl -# define cosl(x) \ - (GL_LINK_WARNING ("cosl is unportable - " \ - "use gnulib module mathl for portability"), \ - cosl (x)) -#endif - - -#if 0 || !1 -extern long double expl (long double x); -#endif -#if !0 && defined GNULIB_POSIXCHECK -# undef expl -# define expl(x) \ - (GL_LINK_WARNING ("expl is unportable - " \ - "use gnulib module mathl for portability"), \ - expl (x)) -#endif - - -#if 1 -# if 0 -# define floorf rpl_floorf -extern float floorf (float x); -# endif -#elif defined GNULIB_POSIXCHECK -# undef floorf -# define floorf(x) \ - (GL_LINK_WARNING ("floorf is unportable - " \ - "use gnulib module floorf for portability"), \ - floorf (x)) -#endif - -#if 0 -# if 0 -# define floorl rpl_floorl -extern long double floorl (long double x); -# endif -#elif defined GNULIB_POSIXCHECK -# undef floorl -# define floorl(x) \ - (GL_LINK_WARNING ("floorl is unportable - " \ - "use gnulib module floorl for portability"), \ - floorl (x)) -#endif - - -/* Write x as - x = mantissa * 2^exp - where - If x finite and nonzero: 0.5 <= |mantissa| < 1.0. - If x is zero: mantissa = x, exp = 0. - If x is infinite or NaN: mantissa = x, exp unspecified. - Store exp in *EXPPTR and return mantissa. */ -#if 0 && 0 -# define frexpl rpl_frexpl -#endif -#if (0 && 0) || !1 -extern long double frexpl (long double x, int *expptr); -#endif -#if !0 && defined GNULIB_POSIXCHECK -# undef frexpl -# define frexpl(x,e) \ - (GL_LINK_WARNING ("frexpl is unportable - " \ - "use gnulib module frexpl for portability"), \ - frexpl (x, e)) -#endif - - -/* Return x * 2^exp. */ -#if 0 && 0 -# define ldexpl rpl_ldexpl -#endif -#if (0 && 0) || !1 -extern long double ldexpl (long double x, int exp); -#endif -#if !0 && defined GNULIB_POSIXCHECK -# undef ldexpl -# define ldexpl(x,e) \ - (GL_LINK_WARNING ("ldexpl is unportable - " \ - "use gnulib module ldexpl for portability"), \ - ldexpl (x, e)) -#endif - - -#if 0 || !1 -extern long double logl (long double x); -#endif -#if !0 && defined GNULIB_POSIXCHECK -# undef logl -# define logl(x) \ - (GL_LINK_WARNING ("logl is unportable - " \ - "use gnulib module mathl for portability"), \ - logl (x)) -#endif - - -#if 0 -# if 0 -# undef roundf -# define roundf rpl_roundf -extern float roundf (float x); -# endif -#elif defined GNULIB_POSIXCHECK -# undef roundf -# define roundf(x) \ - (GL_LINK_WARNING ("roundf is unportable - " \ - "use gnulib module roundf for portability"), \ - roundf (x)) -#endif - -#if 0 -# if 0 -# undef round -# define round rpl_round -extern double round (double x); -# endif -#elif defined GNULIB_POSIXCHECK -# undef round -# define round(x) \ - (GL_LINK_WARNING ("round is unportable - " \ - "use gnulib module round for portability"), \ - round (x)) -#endif - -#if 0 -# if 0 -# undef roundl -# define roundl rpl_roundl -extern long double roundl (long double x); -# endif -#elif defined GNULIB_POSIXCHECK -# undef roundl -# define roundl(x) \ - (GL_LINK_WARNING ("roundl is unportable - " \ - "use gnulib module roundl for portability"), \ - roundl (x)) -#endif - - -#if 0 || !1 -extern long double sinl (long double x); -#endif -#if !0 && defined GNULIB_POSIXCHECK -# undef sinl -# define sinl(x) \ - (GL_LINK_WARNING ("sinl is unportable - " \ - "use gnulib module mathl for portability"), \ - sinl (x)) -#endif - - -#if 0 || !1 -extern long double sqrtl (long double x); -#endif -#if !0 && defined GNULIB_POSIXCHECK -# undef sqrtl -# define sqrtl(x) \ - (GL_LINK_WARNING ("sqrtl is unportable - " \ - "use gnulib module mathl for portability"), \ - sqrtl (x)) -#endif - - -#if 0 || !1 -extern long double tanl (long double x); -#endif -#if !0 && defined GNULIB_POSIXCHECK -# undef tanl -# define tanl(x) \ - (GL_LINK_WARNING ("tanl is unportable - " \ - "use gnulib module mathl for portability"), \ - tanl (x)) -#endif - - -#if 0 -# if !1 -# define truncf rpl_truncf -extern float truncf (float x); -# endif -#elif defined GNULIB_POSIXCHECK -# undef truncf -# define truncf(x) \ - (GL_LINK_WARNING ("truncf is unportable - " \ - "use gnulib module truncf for portability"), \ - truncf (x)) -#endif - -#if 0 -# if !1 -# define trunc rpl_trunc -extern double trunc (double x); -# endif -#elif defined GNULIB_POSIXCHECK -# undef trunc -# define trunc(x) \ - (GL_LINK_WARNING ("trunc is unportable - " \ - "use gnulib module trunc for portability"), \ - trunc (x)) -#endif - -#if 0 -# if !1 -# define truncl rpl_truncl -extern long double truncl (long double x); -# endif -#elif defined GNULIB_POSIXCHECK -# undef truncl -# define truncl(x) \ - (GL_LINK_WARNING ("truncl is unportable - " \ - "use gnulib module truncl for portability"), \ - truncl (x)) -#endif - - -#if 0 -# if 0 -extern int gl_isfinitef (float x); -extern int gl_isfinited (double x); -extern int gl_isfinitel (long double x); -# undef isfinite -# define isfinite(x) \ - (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \ - sizeof (x) == sizeof (double) ? gl_isfinited (x) : \ - gl_isfinitef (x)) -# endif -#elif defined GNULIB_POSIXCHECK - /* How to override a macro? */ -#endif - - -#if 0 -# if 0 -# undef signbit - /* GCC 4.0 and newer provides three built-ins for signbit. */ -# define signbit(x) \ - (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ - sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ - __builtin_signbitf (x)) -# endif -# if 0 -# undef signbit -extern int gl_signbitf (float arg); -extern int gl_signbitd (double arg); -extern int gl_signbitl (long double arg); -# if __GNUC__ >= 2 && !__STRICT_ANSI__ -# if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT -# define gl_signbitf(arg) \ - ({ union { float _value; \ - unsigned int _word[(sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \ - } _m; \ - _m._value = (arg); \ - (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1; \ - }) -# endif -# if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT -# define gl_signbitd(arg) \ - ({ union { double _value; \ - unsigned int _word[(sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \ - } _m; \ - _m._value = (arg); \ - (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1; \ - }) -# endif -# if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT -# define gl_signbitl(arg) \ - ({ union { long double _value; \ - unsigned int _word[(sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \ - } _m; \ - _m._value = (arg); \ - (_m._word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1; \ - }) -# endif -# endif -# define signbit(x) \ - (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \ - sizeof (x) == sizeof (double) ? gl_signbitd (x) : \ - gl_signbitf (x)) -# endif -#elif defined GNULIB_POSIXCHECK - /* How to override a macro? */ -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _GL_MATH_H */ -#endif /* _GL_MATH_H */ diff --git a/gl/ref-add.sed b/gl/ref-add.sed deleted file mode 100644 index 3ac991fe..00000000 --- a/gl/ref-add.sed +++ /dev/null @@ -1,10 +0,0 @@ -/^# Packages using this file: / { - s/# Packages using this file:// - ta - :a - s/ nagios-plugins / nagios-plugins / - tb - s/ $/ nagios-plugins / - :b - s/^/# Packages using this file:/ -} diff --git a/gl/ref-del.sed b/gl/ref-del.sed deleted file mode 100644 index a48fdb77..00000000 --- a/gl/ref-del.sed +++ /dev/null @@ -1,5 +0,0 @@ -/^# Packages using this file: / { - s/# Packages using this file:// - s/ nagios-plugins / / - s/^/# Packages using this file:/ -} diff --git a/gl/stdio.h b/gl/stdio.h deleted file mode 100644 index f09ee831..00000000 --- a/gl/stdio.h +++ /dev/null @@ -1,411 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* A GNU-like <stdio.h>. - - Copyright (C) 2004, 2007-2008 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 3, 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. */ - -#if defined __need_FILE || defined __need___FILE -/* Special invocation convention inside glibc header files. */ - -#include_next <stdio.h> - -#else -/* Normal invocation convention. */ - -#ifndef _GL_STDIO_H - -/* The include_next requires a split double-inclusion guard. */ -#include_next <stdio.h> - -#ifndef _GL_STDIO_H -#define _GL_STDIO_H - -#include <stdarg.h> -#include <stddef.h> - -#if (0 && 0) \ - || (0 && 0) \ - || (0 && !1) \ - || (0 && (!1 || 0)) -/* Get off_t and ssize_t. */ -# include <sys/types.h> -#endif - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) -# define __format__ format -# define __printf__ printf -# endif -#endif - - -/* The definition of GL_LINK_WARNING is copied here. */ -/* GL_LINK_WARNING("literal string") arranges to emit the literal string as - a linker warning on most glibc systems. - We use a linker warning rather than a preprocessor warning, because - #warning cannot be used inside macros. */ -#ifndef GL_LINK_WARNING - /* This works on platforms with GNU ld and ELF object format. - Testing __GLIBC__ is sufficient for asserting that GNU ld is in use. - Testing __ELF__ guarantees the ELF object format. - Testing __GNUC__ is necessary for the compound expression syntax. */ -# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__ -# define GL_LINK_WARNING(message) \ - GL_LINK_WARNING1 (__FILE__, __LINE__, message) -# define GL_LINK_WARNING1(file, line, message) \ - GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */ -# define GL_LINK_WARNING2(file, line, message) \ - GL_LINK_WARNING3 (file ":" #line ": warning: " message) -# define GL_LINK_WARNING3(message) \ - ({ static const char warning[sizeof (message)] \ - __attribute__ ((__unused__, \ - __section__ (".gnu.warning"), \ - __aligned__ (1))) \ - = message "\n"; \ - (void)0; \ - }) -# else -# define GL_LINK_WARNING(message) ((void) 0) -# endif -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -#if 0 -# if 0 -# define fprintf rpl_fprintf -extern int fprintf (FILE *fp, const char *format, ...) - __attribute__ ((__format__ (__printf__, 2, 3))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef fprintf -# define fprintf \ - (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \ - "use gnulib module fprintf-posix for portable " \ - "POSIX compliance"), \ - fprintf) -#endif - -#if 0 -# if 0 -# define vfprintf rpl_vfprintf -extern int vfprintf (FILE *fp, const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 2, 0))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef vfprintf -# define vfprintf(s,f,a) \ - (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \ - "use gnulib module vfprintf-posix for portable " \ - "POSIX compliance"), \ - vfprintf (s, f, a)) -#endif - -#if 0 -# if 0 -/* Don't break __attribute__((format(printf,M,N))). */ -# define printf __printf__ -extern int printf (const char *format, ...) - __attribute__ ((__format__ (__printf__, 1, 2))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef printf -# define printf \ - (GL_LINK_WARNING ("printf is not always POSIX compliant - " \ - "use gnulib module printf-posix for portable " \ - "POSIX compliance"), \ - printf) -/* Don't break __attribute__((format(printf,M,N))). */ -# define format(kind,m,n) format (__##kind##__, m, n) -# define __format__(kind,m,n) __format__ (__##kind##__, m, n) -# define ____printf____ __printf__ -# define ____scanf____ __scanf__ -# define ____strftime____ __strftime__ -# define ____strfmon____ __strfmon__ -#endif - -#if 0 -# if 0 -# define vprintf rpl_vprintf -extern int vprintf (const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 1, 0))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef vprintf -# define vprintf(f,a) \ - (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \ - "use gnulib module vprintf-posix for portable " \ - "POSIX compliance"), \ - vprintf (f, a)) -#endif - -#if 1 -# if 0 -# define snprintf rpl_snprintf -# endif -# if 0 || !1 -extern int snprintf (char *str, size_t size, const char *format, ...) - __attribute__ ((__format__ (__printf__, 3, 4))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef snprintf -# define snprintf \ - (GL_LINK_WARNING ("snprintf is unportable - " \ - "use gnulib module snprintf for portability"), \ - snprintf) -#endif - -#if 1 -# if 0 -# define vsnprintf rpl_vsnprintf -# endif -# if 0 || !1 -extern int vsnprintf (char *str, size_t size, const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 3, 0))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef vsnprintf -# define vsnprintf(b,s,f,a) \ - (GL_LINK_WARNING ("vsnprintf is unportable - " \ - "use gnulib module vsnprintf for portability"), \ - vsnprintf (b, s, f, a)) -#endif - -#if 0 -# if 0 -# define sprintf rpl_sprintf -extern int sprintf (char *str, const char *format, ...) - __attribute__ ((__format__ (__printf__, 2, 3))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef sprintf -# define sprintf \ - (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \ - "use gnulib module sprintf-posix for portable " \ - "POSIX compliance"), \ - sprintf) -#endif - -#if 0 -# if 0 -# define vsprintf rpl_vsprintf -extern int vsprintf (char *str, const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 2, 0))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef vsprintf -# define vsprintf(b,f,a) \ - (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \ - "use gnulib module vsprintf-posix for portable " \ - "POSIX compliance"), \ - vsprintf (b, f, a)) -#endif - -#if 1 -# if 0 -# define asprintf rpl_asprintf -# define vasprintf rpl_vasprintf -# endif -# if 0 || !1 - /* Write formatted output to a string dynamically allocated with malloc(). - If the memory allocation succeeds, store the address of the string in - *RESULT and return the number of resulting bytes, excluding the trailing - NUL. Upon memory allocation error, or some other error, return -1. */ - extern int asprintf (char **result, const char *format, ...) - __attribute__ ((__format__ (__printf__, 2, 3))); - extern int vasprintf (char **result, const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 2, 0))); -# endif -#endif - -#if 0 -# if 0 -# define fopen rpl_fopen -extern FILE * fopen (const char *filename, const char *mode); -# endif -#elif defined GNULIB_POSIXCHECK -# undef fopen -# define fopen(f,m) \ - (GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \ - "use gnulib module fopen for portability"), \ - fopen (f, m)) -#endif - -#if 0 -# if 0 -# define freopen rpl_freopen -extern FILE * freopen (const char *filename, const char *mode, FILE *stream); -# endif -#elif defined GNULIB_POSIXCHECK -# undef freopen -# define freopen(f,m,s) \ - (GL_LINK_WARNING ("freopen on Win32 platforms is not POSIX compatible - " \ - "use gnulib module freopen for portability"), \ - freopen (f, m, s)) -#endif - -#if 0 -# if 0 -/* Provide fseek, fseeko functions that are aware of a preceding - fflush(), and which detect pipes. */ -# define fseeko rpl_fseeko -extern int fseeko (FILE *fp, off_t offset, int whence); -# define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence) -# endif -#elif defined GNULIB_POSIXCHECK -# undef fseeko -# define fseeko(f,o,w) \ - (GL_LINK_WARNING ("fseeko is unportable - " \ - "use gnulib module fseeko for portability"), \ - fseeko (f, o, w)) -#endif - -#if 0 && 0 -extern int rpl_fseek (FILE *fp, long offset, int whence); -# undef fseek -# if defined GNULIB_POSIXCHECK -# define fseek(f,o,w) \ - (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \ - "on 32-bit platforms - " \ - "use fseeko function for handling of large files"), \ - rpl_fseek (f, o, w)) -# else -# define fseek rpl_fseek -# endif -#elif defined GNULIB_POSIXCHECK -# ifndef fseek -# define fseek(f,o,w) \ - (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \ - "on 32-bit platforms - " \ - "use fseeko function for handling of large files"), \ - fseek (f, o, w)) -# endif -#endif - -#if 0 -# if 0 -# define ftello rpl_ftello -extern off_t ftello (FILE *fp); -# define ftell(fp) ftello (fp) -# endif -#elif defined GNULIB_POSIXCHECK -# undef ftello -# define ftello(f) \ - (GL_LINK_WARNING ("ftello is unportable - " \ - "use gnulib module ftello for portability"), \ - ftello (f)) -#endif - -#if 0 && 0 -extern long rpl_ftell (FILE *fp); -# undef ftell -# if GNULIB_POSIXCHECK -# define ftell(f) \ - (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \ - "on 32-bit platforms - " \ - "use ftello function for handling of large files"), \ - rpl_ftell (f)) -# else -# define ftell rpl_ftell -# endif -#elif defined GNULIB_POSIXCHECK -# ifndef ftell -# define ftell(f) \ - (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \ - "on 32-bit platforms - " \ - "use ftello function for handling of large files"), \ - ftell (f)) -# endif -#endif - -#if 0 -# if 0 -# define fflush rpl_fflush - /* Flush all pending data on STREAM according to POSIX rules. Both - output and seekable input streams are supported. - Note! LOSS OF DATA can occur if fflush is applied on an input stream - that is _not_seekable_ or on an update stream that is _not_seekable_ - and in which the most recent operation was input. Seekability can - be tested with lseek(fileno(fp),0,SEEK_CUR). */ - extern int fflush (FILE *gl_stream); -# endif -#elif defined GNULIB_POSIXCHECK -# undef fflush -# define fflush(f) \ - (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \ - "use gnulib module fflush for portable " \ - "POSIX compliance"), \ - fflush (f)) -#endif - -#if 0 -# if !1 -/* Read input, up to (and including) the next occurrence of DELIMITER, from - STREAM, store it in *LINEPTR (and NUL-terminate it). - *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE - bytes of space. It is realloc'd as necessary. - Return the number of bytes read and stored at *LINEPTR (not including the - NUL terminator), or -1 on error or EOF. */ -extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter, - FILE *stream); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getdelim -# define getdelim(l, s, d, f) \ - (GL_LINK_WARNING ("getdelim is unportable - " \ - "use gnulib module getdelim for portability"), \ - getdelim (l, s, d, f)) -#endif - -#if 0 -# if 0 -# undef getline -# define getline rpl_getline -# endif -# if !1 || 0 -/* Read a line, up to (and including) the next newline, from STREAM, store it - in *LINEPTR (and NUL-terminate it). - *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE - bytes of space. It is realloc'd as necessary. - Return the number of bytes read and stored at *LINEPTR (not including the - NUL terminator), or -1 on error or EOF. */ -extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getline -# define getline(l, s, f) \ - (GL_LINK_WARNING ("getline is unportable - " \ - "use gnulib module getline for portability"), \ - getline (l, s, f)) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _GL_STDIO_H */ -#endif /* _GL_STDIO_H */ -#endif diff --git a/gl/stdlib.h b/gl/stdlib.h deleted file mode 100644 index 86da899f..00000000 --- a/gl/stdlib.h +++ /dev/null @@ -1,237 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* A GNU-like <stdlib.h>. - - Copyright (C) 1995, 2001-2004, 2006-2007 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. */ - -#if defined __need_malloc_and_calloc -/* Special invocation convention inside glibc header files. */ - -#include_next <stdlib.h> - -#else -/* Normal invocation convention. */ - -#ifndef _GL_STDLIB_H - -/* The include_next requires a split double-inclusion guard. */ -#include_next <stdlib.h> - -#ifndef _GL_STDLIB_H -#define _GL_STDLIB_H - - -/* The definition of GL_LINK_WARNING is copied here. */ -/* GL_LINK_WARNING("literal string") arranges to emit the literal string as - a linker warning on most glibc systems. - We use a linker warning rather than a preprocessor warning, because - #warning cannot be used inside macros. */ -#ifndef GL_LINK_WARNING - /* This works on platforms with GNU ld and ELF object format. - Testing __GLIBC__ is sufficient for asserting that GNU ld is in use. - Testing __ELF__ guarantees the ELF object format. - Testing __GNUC__ is necessary for the compound expression syntax. */ -# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__ -# define GL_LINK_WARNING(message) \ - GL_LINK_WARNING1 (__FILE__, __LINE__, message) -# define GL_LINK_WARNING1(file, line, message) \ - GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */ -# define GL_LINK_WARNING2(file, line, message) \ - GL_LINK_WARNING3 (file ":" #line ": warning: " message) -# define GL_LINK_WARNING3(message) \ - ({ static const char warning[sizeof (message)] \ - __attribute__ ((__unused__, \ - __section__ (".gnu.warning"), \ - __aligned__ (1))) \ - = message "\n"; \ - (void)0; \ - }) -# else -# define GL_LINK_WARNING(message) ((void) 0) -# endif -#endif - - -/* Some systems do not define EXIT_*, despite otherwise supporting C89. */ -#ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -#endif -/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere - with proper operation of xargs. */ -#ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 -#elif EXIT_FAILURE != 1 -# undef EXIT_FAILURE -# define EXIT_FAILURE 1 -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -#if 1 -# if !1 -# undef malloc -# define malloc rpl_malloc -extern void * malloc (size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef malloc -# define malloc(s) \ - (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \ - "use gnulib module malloc-posix for portability"), \ - malloc (s)) -#endif - - -#if 0 -# if !1 -# undef realloc -# define realloc rpl_realloc -extern void * realloc (void *ptr, size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef realloc -# define realloc(p,s) \ - (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \ - "use gnulib module realloc-posix for portability"), \ - realloc (p, s)) -#endif - - -#if 0 -# if !1 -# undef calloc -# define calloc rpl_calloc -extern void * calloc (size_t nmemb, size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef calloc -# define calloc(n,s) \ - (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \ - "use gnulib module calloc-posix for portability"), \ - calloc (n, s)) -#endif - - -#if 0 -/* Assuming *OPTIONP is a comma separated list of elements of the form - "token" or "token=value", getsubopt parses the first of these elements. - If the first element refers to a "token" that is member of the given - NULL-terminated array of tokens: - - It replaces the comma with a NUL byte, updates *OPTIONP to point past - the first option and the comma, sets *VALUEP to the value of the - element (or NULL if it doesn't contain an "=" sign), - - It returns the index of the "token" in the given array of tokens. - Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. - For more details see the POSIX:2001 specification. - http://www.opengroup.org/susv3xsh/getsubopt.html */ -# if !1 -extern int getsubopt (char **optionp, char *const *tokens, char **valuep); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getsubopt -# define getsubopt(o,t,v) \ - (GL_LINK_WARNING ("getsubopt is unportable - " \ - "use gnulib module getsubopt for portability"), \ - getsubopt (o, t, v)) -#endif - - -#if 0 -# if !1 -/* Create a unique temporary directory from TEMPLATE. - The last six characters of TEMPLATE must be "XXXXXX"; - they are replaced with a string that makes the directory name unique. - Returns TEMPLATE, or a null pointer if it cannot get a unique name. - The directory is created mode 700. */ -extern char * mkdtemp (char * /*template*/); -# endif -#elif defined GNULIB_POSIXCHECK -# undef mkdtemp -# define mkdtemp(t) \ - (GL_LINK_WARNING ("mkdtemp is unportable - " \ - "use gnulib module mkdtemp for portability"), \ - mkdtemp (t)) -#endif - - -#if 0 -# if 0 -/* Create a unique temporary file from TEMPLATE. - The last six characters of TEMPLATE must be "XXXXXX"; - they are replaced with a string that makes the file name unique. - The file is then created, ensuring it didn't exist before. - The file is created read-write (mask at least 0600 & ~umask), but it may be - world-readable and world-writable (mask 0666 & ~umask), depending on the - implementation. - Returns the open file descriptor if successful, otherwise -1 and errno - set. */ -# define mkstemp rpl_mkstemp -extern int mkstemp (char * /*template*/); -# else -/* On MacOS X 10.3, only <unistd.h> declares mkstemp. */ -# include <unistd.h> -# endif -#elif defined GNULIB_POSIXCHECK -# undef mkstemp -# define mkstemp(t) \ - (GL_LINK_WARNING ("mkstemp is unportable - " \ - "use gnulib module mkstemp for portability"), \ - mkstemp (t)) -#endif - - -#if 0 -# if 0 -# undef putenv -# define putenv rpl_putenv -extern int putenv (char *string); -# endif -#endif - - -#if 0 -# if !1 -/* Set NAME to VALUE in the environment. - If REPLACE is nonzero, overwrite an existing value. */ -extern int setenv (const char *name, const char *value, int replace); -# endif -#endif - - -#if 0 -# if 1 -# if 0 -/* On some systems, unsetenv() returns void. - This is the case for MacOS X 10.3, FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */ -# define unsetenv(name) ((unsetenv)(name), 0) -# endif -# else -/* Remove the variable NAME from the environment. */ -extern int unsetenv (const char *name); -# endif -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _GL_STDLIB_H */ -#endif /* _GL_STDLIB_H */ -#endif diff --git a/gl/string.h b/gl/string.h deleted file mode 100644 index e5bcef55..00000000 --- a/gl/string.h +++ /dev/null @@ -1,598 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* A GNU-like <string.h>. - - Copyright (C) 1995-1996, 2001-2008 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 3, 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_STRING_H - -/* The include_next requires a split double-inclusion guard. */ -#include_next <string.h> - -#ifndef _GL_STRING_H -#define _GL_STRING_H - - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define __attribute__(Spec) /* empty */ -# endif -/* The attribute __pure__ was added in gcc 2.96. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) -# define __pure__ /* empty */ -# endif -#endif - - -/* The definition of GL_LINK_WARNING is copied here. */ -/* GL_LINK_WARNING("literal string") arranges to emit the literal string as - a linker warning on most glibc systems. - We use a linker warning rather than a preprocessor warning, because - #warning cannot be used inside macros. */ -#ifndef GL_LINK_WARNING - /* This works on platforms with GNU ld and ELF object format. - Testing __GLIBC__ is sufficient for asserting that GNU ld is in use. - Testing __ELF__ guarantees the ELF object format. - Testing __GNUC__ is necessary for the compound expression syntax. */ -# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__ -# define GL_LINK_WARNING(message) \ - GL_LINK_WARNING1 (__FILE__, __LINE__, message) -# define GL_LINK_WARNING1(file, line, message) \ - GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */ -# define GL_LINK_WARNING2(file, line, message) \ - GL_LINK_WARNING3 (file ":" #line ": warning: " message) -# define GL_LINK_WARNING3(message) \ - ({ static const char warning[sizeof (message)] \ - __attribute__ ((__unused__, \ - __section__ (".gnu.warning"), \ - __aligned__ (1))) \ - = message "\n"; \ - (void)0; \ - }) -# else -# define GL_LINK_WARNING(message) ((void) 0) -# endif -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Return the first occurrence of NEEDLE in HAYSTACK. */ -#if 0 -# if 0 -# define memmem rpl_memmem -# endif -# if ! 1 || 0 -extern void *memmem (void const *__haystack, size_t __haystack_len, - void const *__needle, size_t __needle_len) - __attribute__ ((__pure__)); -# endif -#elif defined GNULIB_POSIXCHECK -# undef memmem -# define memmem(a,al,b,bl) \ - (GL_LINK_WARNING ("memmem is unportable and often quadratic - " \ - "use gnulib module memmem-simple for portability, " \ - "and module memmem for speed" ), \ - memmem (a, al, b, bl)) -#endif - -/* Copy N bytes of SRC to DEST, return pointer to bytes after the - last written byte. */ -#if 0 -# if ! 1 -extern void *mempcpy (void *restrict __dest, void const *restrict __src, - size_t __n); -# endif -#elif defined GNULIB_POSIXCHECK -# undef mempcpy -# define mempcpy(a,b,n) \ - (GL_LINK_WARNING ("mempcpy is unportable - " \ - "use gnulib module mempcpy for portability"), \ - mempcpy (a, b, n)) -#endif - -/* Search backwards through a block for a byte (specified as an int). */ -#if 0 -# if ! 1 -extern void *memrchr (void const *, int, size_t) - __attribute__ ((__pure__)); -# endif -#elif defined GNULIB_POSIXCHECK -# undef memrchr -# define memrchr(a,b,c) \ - (GL_LINK_WARNING ("memrchr is unportable - " \ - "use gnulib module memrchr for portability"), \ - memrchr (a, b, c)) -#endif - -/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ -#if 0 -# if ! 1 -extern char *stpcpy (char *restrict __dst, char const *restrict __src); -# endif -#elif defined GNULIB_POSIXCHECK -# undef stpcpy -# define stpcpy(a,b) \ - (GL_LINK_WARNING ("stpcpy is unportable - " \ - "use gnulib module stpcpy for portability"), \ - stpcpy (a, b)) -#endif - -/* Copy no more than N bytes of SRC to DST, returning a pointer past the - last non-NUL byte written into DST. */ -#if 0 -# if ! 1 -# define stpncpy gnu_stpncpy -extern char *stpncpy (char *restrict __dst, char const *restrict __src, - size_t __n); -# endif -#elif defined GNULIB_POSIXCHECK -# undef stpncpy -# define stpncpy(a,b,n) \ - (GL_LINK_WARNING ("stpncpy is unportable - " \ - "use gnulib module stpncpy for portability"), \ - stpncpy (a, b, n)) -#endif - -#if defined GNULIB_POSIXCHECK -/* strchr() does not work with multibyte strings if the locale encoding is - GB18030 and the character to be searched is a digit. */ -# undef strchr -# define strchr(s,c) \ - (GL_LINK_WARNING ("strchr cannot work correctly on character strings " \ - "in some multibyte locales - " \ - "use mbschr if you care about internationalization"), \ - strchr (s, c)) -#endif - -/* Find the first occurrence of C in S or the final NUL byte. */ -#if 0 -# if ! 1 -extern char *strchrnul (char const *__s, int __c_in) - __attribute__ ((__pure__)); -# endif -#elif defined GNULIB_POSIXCHECK -# undef strchrnul -# define strchrnul(a,b) \ - (GL_LINK_WARNING ("strchrnul is unportable - " \ - "use gnulib module strchrnul for portability"), \ - strchrnul (a, b)) -#endif - -/* Duplicate S, returning an identical malloc'd string. */ -#if 1 -# if ! 1 && ! defined strdup -extern char *strdup (char const *__s); -# endif -#elif defined GNULIB_POSIXCHECK -# undef strdup -# define strdup(a) \ - (GL_LINK_WARNING ("strdup is unportable - " \ - "use gnulib module strdup for portability"), \ - strdup (a)) -#endif - -/* Return a newly allocated copy of at most N bytes of STRING. */ -#if 1 -# if ! 1 -# undef strndup -# define strndup rpl_strndup -# endif -# if ! 1 || ! 1 -extern char *strndup (char const *__string, size_t __n); -# endif -#elif defined GNULIB_POSIXCHECK -# undef strndup -# define strndup(a,n) \ - (GL_LINK_WARNING ("strndup is unportable - " \ - "use gnulib module strndup for portability"), \ - strndup (a, n)) -#endif - -/* Find the length (number of bytes) of STRING, but scan at most - MAXLEN bytes. If no '\0' terminator is found in that many bytes, - return MAXLEN. */ -#if 1 -# if ! 1 -extern size_t strnlen (char const *__string, size_t __maxlen) - __attribute__ ((__pure__)); -# endif -#elif defined GNULIB_POSIXCHECK -# undef strnlen -# define strnlen(a,n) \ - (GL_LINK_WARNING ("strnlen is unportable - " \ - "use gnulib module strnlen for portability"), \ - strnlen (a, n)) -#endif - -#if defined GNULIB_POSIXCHECK -/* strcspn() assumes the second argument is a list of single-byte characters. - Even in this simple case, it does not work with multibyte strings if the - locale encoding is GB18030 and one of the characters to be searched is a - digit. */ -# undef strcspn -# define strcspn(s,a) \ - (GL_LINK_WARNING ("strcspn cannot work correctly on character strings " \ - "in multibyte locales - " \ - "use mbscspn if you care about internationalization"), \ - strcspn (s, a)) -#endif - -/* Find the first occurrence in S of any character in ACCEPT. */ -#if 0 -# if ! 1 -extern char *strpbrk (char const *__s, char const *__accept) - __attribute__ ((__pure__)); -# endif -# if defined GNULIB_POSIXCHECK -/* strpbrk() assumes the second argument is a list of single-byte characters. - Even in this simple case, it does not work with multibyte strings if the - locale encoding is GB18030 and one of the characters to be searched is a - digit. */ -# undef strpbrk -# define strpbrk(s,a) \ - (GL_LINK_WARNING ("strpbrk cannot work correctly on character strings " \ - "in multibyte locales - " \ - "use mbspbrk if you care about internationalization"), \ - strpbrk (s, a)) -# endif -#elif defined GNULIB_POSIXCHECK -# undef strpbrk -# define strpbrk(s,a) \ - (GL_LINK_WARNING ("strpbrk is unportable - " \ - "use gnulib module strpbrk for portability"), \ - strpbrk (s, a)) -#endif - -#if defined GNULIB_POSIXCHECK -/* strspn() assumes the second argument is a list of single-byte characters. - Even in this simple case, it cannot work with multibyte strings. */ -# undef strspn -# define strspn(s,a) \ - (GL_LINK_WARNING ("strspn cannot work correctly on character strings " \ - "in multibyte locales - " \ - "use mbsspn if you care about internationalization"), \ - strspn (s, a)) -#endif - -#if defined GNULIB_POSIXCHECK -/* strrchr() does not work with multibyte strings if the locale encoding is - GB18030 and the character to be searched is a digit. */ -# undef strrchr -# define strrchr(s,c) \ - (GL_LINK_WARNING ("strrchr cannot work correctly on character strings " \ - "in some multibyte locales - " \ - "use mbsrchr if you care about internationalization"), \ - strrchr (s, c)) -#endif - -/* Search the next delimiter (char listed in DELIM) starting at *STRINGP. - If one is found, overwrite it with a NUL, and advance *STRINGP - to point to the next char after it. Otherwise, set *STRINGP to NULL. - If *STRINGP was already NULL, nothing happens. - Return the old value of *STRINGP. - - This is a variant of strtok() that is multithread-safe and supports - empty fields. - - Caveat: It modifies the original string. - Caveat: These functions cannot be used on constant strings. - Caveat: The identity of the delimiting character is lost. - Caveat: It doesn't work with multibyte strings unless all of the delimiter - characters are ASCII characters < 0x30. - - See also strtok_r(). */ -#if 0 -# if ! 1 -extern char *strsep (char **restrict __stringp, char const *restrict __delim); -# endif -# if defined GNULIB_POSIXCHECK -# undef strsep -# define strsep(s,d) \ - (GL_LINK_WARNING ("strsep cannot work correctly on character strings " \ - "in multibyte locales - " \ - "use mbssep if you care about internationalization"), \ - strsep (s, d)) -# endif -#elif defined GNULIB_POSIXCHECK -# undef strsep -# define strsep(s,d) \ - (GL_LINK_WARNING ("strsep is unportable - " \ - "use gnulib module strsep for portability"), \ - strsep (s, d)) -#endif - -#if 0 -# if 0 -# define strstr rpl_strstr -char *strstr (const char *haystack, const char *needle) - __attribute__ ((__pure__)); -# endif -#elif defined GNULIB_POSIXCHECK -/* strstr() does not work with multibyte strings if the locale encoding is - different from UTF-8: - POSIX says that it operates on "strings", and "string" in POSIX is defined - as a sequence of bytes, not of characters. */ -# undef strstr -# define strstr(a,b) \ - (GL_LINK_WARNING ("strstr is quadratic on many systems, and cannot " \ - "work correctly on character strings in most " \ - "multibyte locales - " \ - "use mbsstr if you care about internationalization, " \ - "or use strstr if you care about speed"), \ - strstr (a, b)) -#endif - -/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive - comparison. */ -#if 0 -# if 0 -# define strcasestr rpl_strcasestr -# endif -# if ! 1 || 0 -extern char *strcasestr (const char *haystack, const char *needle) - __attribute__ ((__pure__)); -# endif -#elif defined GNULIB_POSIXCHECK -/* strcasestr() does not work with multibyte strings: - It is a glibc extension, and glibc implements it only for unibyte - locales. */ -# undef strcasestr -# define strcasestr(a,b) \ - (GL_LINK_WARNING ("strcasestr does work correctly on character strings " \ - "in multibyte locales - " \ - "use mbscasestr if you care about " \ - "internationalization, or use c-strcasestr if you want " \ - "a locale independent function"), \ - strcasestr (a, b)) -#endif - -/* Parse S into tokens separated by characters in DELIM. - If S is NULL, the saved pointer in SAVE_PTR is used as - the next starting point. For example: - char s[] = "-abc-=-def"; - char *sp; - x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def" - x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL - x = strtok_r(NULL, "=", &sp); // x = NULL - // s = "abc\0-def\0" - - This is a variant of strtok() that is multithread-safe. - - For the POSIX documentation for this function, see: - http://www.opengroup.org/susv3xsh/strtok.html - - Caveat: It modifies the original string. - Caveat: These functions cannot be used on constant strings. - Caveat: The identity of the delimiting character is lost. - Caveat: It doesn't work with multibyte strings unless all of the delimiter - characters are ASCII characters < 0x30. - - See also strsep(). */ -#if 0 -# if ! 1 -extern char *strtok_r (char *restrict s, char const *restrict delim, - char **restrict save_ptr); -# endif -# if defined GNULIB_POSIXCHECK -# undef strtok_r -# define strtok_r(s,d,p) \ - (GL_LINK_WARNING ("strtok_r cannot work correctly on character strings " \ - "in multibyte locales - " \ - "use mbstok_r if you care about internationalization"), \ - strtok_r (s, d, p)) -# endif -#elif defined GNULIB_POSIXCHECK -# undef strtok_r -# define strtok_r(s,d,p) \ - (GL_LINK_WARNING ("strtok_r is unportable - " \ - "use gnulib module strtok_r for portability"), \ - strtok_r (s, d, p)) -#endif - - -/* The following functions are not specified by POSIX. They are gnulib - extensions. */ - -#if 0 -/* Return the number of multibyte characters in the character string STRING. - This considers multibyte characters, unlike strlen, which counts bytes. */ -extern size_t mbslen (const char *string); -#endif - -#if 0 -/* Return the number of multibyte characters in the character string starting - at STRING and ending at STRING + LEN. */ -extern size_t mbsnlen (const char *string, size_t len); -#endif - -#if 0 -/* Locate the first single-byte character C in the character string STRING, - and return a pointer to it. Return NULL if C is not found in STRING. - Unlike strchr(), this function works correctly in multibyte locales with - encodings such as GB18030. */ -# define mbschr rpl_mbschr /* avoid collision with HP-UX function */ -extern char * mbschr (const char *string, int c); -#endif - -#if 0 -/* Locate the last single-byte character C in the character string STRING, - and return a pointer to it. Return NULL if C is not found in STRING. - Unlike strrchr(), this function works correctly in multibyte locales with - encodings such as GB18030. */ -# define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */ -extern char * mbsrchr (const char *string, int c); -#endif - -#if 0 -/* Find the first occurrence of the character string NEEDLE in the character - string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK. - Unlike strstr(), this function works correctly in multibyte locales with - encodings different from UTF-8. */ -extern char * mbsstr (const char *haystack, const char *needle); -#endif - -#if 0 -/* Compare the character strings S1 and S2, ignoring case, returning less than, - equal to or greater than zero if S1 is lexicographically less than, equal to - or greater than S2. - Note: This function may, in multibyte locales, return 0 for strings of - different lengths! - Unlike strcasecmp(), this function works correctly in multibyte locales. */ -extern int mbscasecmp (const char *s1, const char *s2); -#endif - -#if 0 -/* Compare the initial segment of the character string S1 consisting of at most - N characters with the initial segment of the character string S2 consisting - of at most N characters, ignoring case, returning less than, equal to or - greater than zero if the initial segment of S1 is lexicographically less - than, equal to or greater than the initial segment of S2. - Note: This function may, in multibyte locales, return 0 for initial segments - of different lengths! - Unlike strncasecmp(), this function works correctly in multibyte locales. - But beware that N is not a byte count but a character count! */ -extern int mbsncasecmp (const char *s1, const char *s2, size_t n); -#endif - -#if 0 -/* Compare the initial segment of the character string STRING consisting of - at most mbslen (PREFIX) characters with the character string PREFIX, - ignoring case, returning less than, equal to or greater than zero if this - initial segment is lexicographically less than, equal to or greater than - PREFIX. - Note: This function may, in multibyte locales, return 0 if STRING is of - smaller length than PREFIX! - Unlike strncasecmp(), this function works correctly in multibyte - locales. */ -extern char * mbspcasecmp (const char *string, const char *prefix); -#endif - -#if 0 -/* Find the first occurrence of the character string NEEDLE in the character - string HAYSTACK, using case-insensitive comparison. - Note: This function may, in multibyte locales, return success even if - strlen (haystack) < strlen (needle) ! - Unlike strcasestr(), this function works correctly in multibyte locales. */ -extern char * mbscasestr (const char *haystack, const char *needle); -#endif - -#if 0 -/* Find the first occurrence in the character string STRING of any character - in the character string ACCEPT. Return the number of bytes from the - beginning of the string to this occurrence, or to the end of the string - if none exists. - Unlike strcspn(), this function works correctly in multibyte locales. */ -extern size_t mbscspn (const char *string, const char *accept); -#endif - -#if 0 -/* Find the first occurrence in the character string STRING of any character - in the character string ACCEPT. Return the pointer to it, or NULL if none - exists. - Unlike strpbrk(), this function works correctly in multibyte locales. */ -# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */ -extern char * mbspbrk (const char *string, const char *accept); -#endif - -#if 0 -/* Find the first occurrence in the character string STRING of any character - not in the character string REJECT. Return the number of bytes from the - beginning of the string to this occurrence, or to the end of the string - if none exists. - Unlike strspn(), this function works correctly in multibyte locales. */ -extern size_t mbsspn (const char *string, const char *reject); -#endif - -#if 0 -/* Search the next delimiter (multibyte character listed in the character - string DELIM) starting at the character string *STRINGP. - If one is found, overwrite it with a NUL, and advance *STRINGP to point - to the next multibyte character after it. Otherwise, set *STRINGP to NULL. - If *STRINGP was already NULL, nothing happens. - Return the old value of *STRINGP. - - This is a variant of mbstok_r() that supports empty fields. - - Caveat: It modifies the original string. - Caveat: These functions cannot be used on constant strings. - Caveat: The identity of the delimiting character is lost. - - See also mbstok_r(). */ -extern char * mbssep (char **stringp, const char *delim); -#endif - -#if 0 -/* Parse the character string STRING into tokens separated by characters in - the character string DELIM. - If STRING is NULL, the saved pointer in SAVE_PTR is used as - the next starting point. For example: - char s[] = "-abc-=-def"; - char *sp; - x = mbstok_r(s, "-", &sp); // x = "abc", sp = "=-def" - x = mbstok_r(NULL, "-=", &sp); // x = "def", sp = NULL - x = mbstok_r(NULL, "=", &sp); // x = NULL - // s = "abc\0-def\0" - - Caveat: It modifies the original string. - Caveat: These functions cannot be used on constant strings. - Caveat: The identity of the delimiting character is lost. - - See also mbssep(). */ -extern char * mbstok_r (char *string, const char *delim, char **save_ptr); -#endif - -/* Map any int, typically from errno, into an error message. */ -#if 1 -# if 0 -# undef strerror -# define strerror rpl_strerror -extern char *strerror (int); -# endif -#elif defined GNULIB_POSIXCHECK -# undef strerror -# define strerror(e) \ - (GL_LINK_WARNING ("strerror is unportable - " \ - "use gnulib module strerror to guarantee non-NULL result"), \ - strerror (e)) -#endif - -#if 0 -# if 0 -# define strsignal rpl_strsignal -# endif -# if ! 1 || 0 -extern char *strsignal (int __sig); -# endif -#elif defined GNULIB_POSIXCHECK -# undef strsignal -# define strsignal(a) \ - (GL_LINK_WARNING ("strsignal is unportable - " \ - "use gnulib module strsignal for portability"), \ - strsignal (a)) -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _GL_STRING_H */ -#endif /* _GL_STRING_H */ diff --git a/gl/unistd.h b/gl/unistd.h deleted file mode 100644 index e72a5d9a..00000000 --- a/gl/unistd.h +++ /dev/null @@ -1,321 +0,0 @@ -/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -/* Substitute for and wrapper around <unistd.h>. - Copyright (C) 2004-2007 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 3, 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_UNISTD_H - -/* The include_next requires a split double-inclusion guard. */ -#if 1 -# include_next <unistd.h> -#endif - -#ifndef _GL_UNISTD_H -#define _GL_UNISTD_H - -/* mingw doesn't define the SEEK_* macros in <unistd.h>. */ -#if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) -# include <stdio.h> -#endif - -/* mingw fails to declare _exit in <unistd.h>. */ -#include <stdlib.h> - -/* The definition of GL_LINK_WARNING is copied here. */ - - -/* Declare overridden functions. */ - -#ifdef __cplusplus -extern "C" { -#endif - - -#if 0 -# if 0 -# ifndef REPLACE_CHOWN -# define REPLACE_CHOWN 1 -# endif -# if REPLACE_CHOWN -/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE - to GID (if GID is not -1). Follow symbolic links. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - <http://www.opengroup.org/susv3xsh/chown.html>. */ -# define chown rpl_chown -extern int chown (const char *file, uid_t uid, gid_t gid); -# endif -# endif -#elif defined GNULIB_POSIXCHECK -# undef chown -# define chown(f,u,g) \ - (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \ - "doesn't treat a uid or gid of -1 on some systems - " \ - "use gnulib module chown for portability"), \ - chown (f, u, g)) -#endif - - -#if 0 -# if !1 -/* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if - NEWFD = OLDFD, otherwise close NEWFD first if it is open. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - <http://www.opengroup.org/susv3xsh/dup2.html>. */ -extern int dup2 (int oldfd, int newfd); -# endif -#elif defined GNULIB_POSIXCHECK -# undef dup2 -# define dup2(o,n) \ - (GL_LINK_WARNING ("dup2 is unportable - " \ - "use gnulib module dup2 for portability"), \ - dup2 (o, n)) -#endif - - -#if 0 -# if 0 - -/* Change the process' current working directory to the directory on which - the given file descriptor is open. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - <http://www.opengroup.org/susv3xsh/fchdir.html>. */ -extern int fchdir (int /*fd*/); - -# define close rpl_close -extern int close (int); -# define dup rpl_dup -extern int dup (int); -# define dup2 rpl_dup2 -extern int dup2 (int, int); - -# endif -#elif defined GNULIB_POSIXCHECK -# undef fchdir -# define fchdir(f) \ - (GL_LINK_WARNING ("fchdir is unportable - " \ - "use gnulib module fchdir for portability"), \ - fchdir (f)) -#endif - - -#if 0 -# if !1 -/* Change the size of the file to which FD is opened to become equal to LENGTH. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - <http://www.opengroup.org/susv3xsh/ftruncate.html>. */ -extern int ftruncate (int fd, off_t length); -# endif -#elif defined GNULIB_POSIXCHECK -# undef ftruncate -# define ftruncate(f,l) \ - (GL_LINK_WARNING ("ftruncate is unportable - " \ - "use gnulib module ftruncate for portability"), \ - ftruncate (f, l)) -#endif - - -#if 0 -/* Include the headers that might declare getcwd so that they will not - cause confusion if included after this file. */ -# include <stdlib.h> -# if 0 -/* Get the name of the current working directory, and put it in SIZE bytes - of BUF. - Return BUF if successful, or NULL if the directory couldn't be determined - or SIZE was too small. - See the POSIX:2001 specification - <http://www.opengroup.org/susv3xsh/getcwd.html>. - Additionally, the gnulib module 'getcwd' guarantees the following GNU - extension: If BUF is NULL, an array is allocated with 'malloc'; the array - is SIZE bytes long, unless SIZE == 0, in which case it is as big as - necessary. */ -# define getcwd rpl_getcwd -extern char * getcwd (char *buf, size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getcwd -# define getcwd(b,s) \ - (GL_LINK_WARNING ("getcwd is unportable - " \ - "use gnulib module getcwd for portability"), \ - getcwd (b, s)) -#endif - - -#if 0 -/* Copies the user's login name to NAME. - The array pointed to by NAME has room for SIZE bytes. - - Returns 0 if successful. Upon error, an error number is returned, or -1 in - the case that the login name cannot be found but no specific error is - provided (this case is hopefully rare but is left open by the POSIX spec). - - See <http://www.opengroup.org/susv3xsh/getlogin.html>. - */ -# if !1 -# include <stddef.h> -extern int getlogin_r (char *name, size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getlogin_r -# define getlogin_r(n,s) \ - (GL_LINK_WARNING ("getlogin_r is unportable - " \ - "use gnulib module getlogin_r for portability"), \ - getlogin_r (n, s)) -#endif - - -#if 0 -# if 0 -# define getpagesize rpl_getpagesize -extern int getpagesize (void); -# elif !1 -/* This is for POSIX systems. */ -# if !defined getpagesize && defined _SC_PAGESIZE -# if ! (defined __VMS && __VMS_VER < 70000000) -# define getpagesize() sysconf (_SC_PAGESIZE) -# endif -# endif -/* This is for older VMS. */ -# if !defined getpagesize && defined __VMS -# ifdef __ALPHA -# define getpagesize() 8192 -# else -# define getpagesize() 512 -# endif -# endif -/* This is for BeOS. */ -# if !defined getpagesize && 0 -# include <OS.h> -# if defined B_PAGE_SIZE -# define getpagesize() B_PAGE_SIZE -# endif -# endif -/* This is for AmigaOS4.0. */ -# if !defined getpagesize && defined __amigaos4__ -# define getpagesize() 2048 -# endif -/* This is for older Unix systems. */ -# if !defined getpagesize && 0 -# include <sys/param.h> -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else -# ifdef NBPG -# ifndef CLSIZE -# define CLSIZE 1 -# endif -# define getpagesize() (NBPG * CLSIZE) -# else -# ifdef NBPC -# define getpagesize() NBPC -# endif -# endif -# endif -# endif -# endif -#elif defined GNULIB_POSIXCHECK -# undef getpagesize -# define getpagesize() \ - (GL_LINK_WARNING ("getpagesize is unportable - " \ - "use gnulib module getpagesize for portability"), \ - getpagesize ()) -#endif - - -#if 0 -# if 0 -/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE - to GID (if GID is not -1). Do not follow symbolic links. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - <http://www.opengroup.org/susv3xsh/lchown.html>. */ -# define lchown rpl_lchown -extern int lchown (char const *file, uid_t owner, gid_t group); -# endif -#elif defined GNULIB_POSIXCHECK -# undef lchown -# define lchown(f,u,g) \ - (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \ - "systems - use gnulib module lchown for portability"), \ - lchown (f, u, g)) -#endif - - -#if 0 -# if 0 -/* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. - Return the new offset if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - <http://www.opengroup.org/susv3xsh/lseek.html>. */ -# define lseek rpl_lseek - extern off_t lseek (int fd, off_t offset, int whence); -# endif -#elif defined GNULIB_POSIXCHECK -# undef lseek -# define lseek(f,o,w) \ - (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \ - "systems - use gnulib module lseek for portability"), \ - lseek (f, o, w)) -#endif - - -#if 0 -/* Read the contents of the symbolic link FILE and place the first BUFSIZE - bytes of it into BUF. Return the number of bytes placed into BUF if - successful, otherwise -1 and errno set. - See the POSIX:2001 specification - <http://www.opengroup.org/susv3xsh/readlink.html>. */ -# if !1 -# include <stddef.h> -extern int readlink (const char *file, char *buf, size_t bufsize); -# endif -#elif defined GNULIB_POSIXCHECK -# undef readlink -# define readlink(f,b,s) \ - (GL_LINK_WARNING ("readlink is unportable - " \ - "use gnulib module readlink for portability"), \ - readlink (f, b, s)) -#endif - - -#if 0 -/* Pause the execution of the current thread for N seconds. - Returns the number of seconds left to sleep. - See the POSIX:2001 specification - <http://www.opengroup.org/susv3xsh/sleep.html>. */ -# if !1 -extern unsigned int sleep (unsigned int n); -# endif -#elif defined GNULIB_POSIXCHECK -# undef sleep -# define sleep(n) \ - (GL_LINK_WARNING ("sleep is unportable - " \ - "use gnulib module sleep for portability"), \ - sleep (n)) -#endif - - -#ifdef __cplusplus -} -#endif - - -#endif /* _GL_UNISTD_H */ -#endif /* _GL_UNISTD_H */ |