From 24ddd8c071e9214d39d9482a210ee4345ddfe78a Mon Sep 17 00:00:00 2001
Package: libedit
Version: 2.11~20080614-2
From: Guillem Jover <guillem@hadrons.org>
Date: Tue, 26 May 2009 02:00:15 +0200
Debbug: 513027
Status: applied
Subject: [PATCH] Switch to use libbsd instead of embedded code copies

---
 debian/control                          |    6 +-
 debian/libedit-vis.h                    |    8 +
 debian/libedit.pc                       |    1 +
 debian/patches/01-Makefile.diff         |   25 +-
 debian/patches/06-fgetln.c-error.diff   |   24 -
 debian/patches/11-357594-vis.h.diff     |   34 --
 debian/patches/13-symbol_not_found.diff |  100 ----
 debian/patches/series                   |    3 -
 debian/rules                            |   12 +-
 glibc-bsd-glue/bsdcompat.h              |   16 -
 glibc-bsd-glue/fgetln.c                 |   13 -
 glibc-compat/namespace.h                |  781 -------------------------------
 glibc-compat/strlcat.c                  |   85 ----
 glibc-compat/strlcpy.c                  |   81 ----
 glibc-compat/unvis.c                    |  306 ------------
 glibc-compat/vis.c                      |  384 ---------------
 glibc-compat/vis.h                      |   91 ----
 17 files changed, 22 insertions(+), 1948 deletions(-)
 create mode 100644 debian/libedit-vis.h
 delete mode 100644 debian/patches/06-fgetln.c-error.diff
 delete mode 100644 debian/patches/11-357594-vis.h.diff
 delete mode 100644 debian/patches/13-symbol_not_found.diff
 delete mode 100644 glibc-bsd-glue/bsdcompat.h
 delete mode 100644 glibc-bsd-glue/fgetln.c
 delete mode 100644 glibc-compat/namespace.h
 delete mode 100644 glibc-compat/strlcat.c
 delete mode 100644 glibc-compat/strlcpy.c
 delete mode 100644 glibc-compat/unvis.c
 delete mode 100644 glibc-compat/vis.c
 delete mode 100644 glibc-compat/vis.h

diff --git a/debian/control b/debian/control
index 872d10a..577f20a 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,8 @@ Source: libedit
 Section: libs
 Priority: standard
 Maintainer: Anibal Monsalve Salazar <anibal@debian.org>
-Build-Depends: debhelper (>= 7), quilt, pmake (>= 1.45-8), groff-base, libncurses5-dev, bsdmainutils
+Build-Depends: debhelper (>= 7), quilt, pmake (>= 1.45-8), groff-base,
+ libbsd-dev (>= 0.1.3), libncurses5-dev, bsdmainutils
 Standards-Version: 3.8.1
 Vcs-Browser: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/
 Homepage: http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-5-0/src/lib/libedit/
@@ -11,7 +12,6 @@ Package: libedit2
 Section: libs
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Suggests: libbsd0
 Description: BSD editline and history libraries
  The editline library provides generic line editing and
  history functions.
@@ -22,7 +22,7 @@ Package: libedit-dev
 Section: libdevel
 Priority: optional
 Architecture: any
-Depends: libedit2 (= ${binary:Version}), libncurses5-dev
+Depends: libedit2 (= ${binary:Version}), libbsd-dev (>= 0.1.3), libncurses5-dev
 Description: BSD editline and history libraries (development files)
  The editline library provides generic line editing and
  history functions.
diff --git a/debian/libedit-vis.h b/debian/libedit-vis.h
new file mode 100644
index 0000000..4009f4a
--- /dev/null
+++ b/debian/libedit-vis.h
@@ -0,0 +1,8 @@
+#ifndef LIBEDIT_VIS_H
+#define LIBEDIT_VIS_H
+
+#warning "This header is obsolete, use <vis.h> instead."
+
+#include <vis.h>
+
+#endif
diff --git a/debian/libedit.pc b/debian/libedit.pc
index 6bb5e51..2ba2fb9 100644
--- a/debian/libedit.pc
+++ b/debian/libedit.pc
@@ -7,6 +7,7 @@ Name: libedit
 Description: Not just a replacement library for libreadline and libhistory.
 Version: 2.11
 Requires:
+Requires.private: libbsd
 Libs: -L${libdir} -ledit -lcurses 
 Libs.private:
 Cflags: -I${includedir}
diff --git a/debian/patches/01-Makefile.diff b/debian/patches/01-Makefile.diff
index c527553..67fa289 100644
--- a/debian/patches/01-Makefile.diff
+++ b/debian/patches/01-Makefile.diff
@@ -5,32 +5,23 @@
  Makefile, so it will compile on GNU systems, with our supplied
  glue code
 
---- a/libedit/Makefile	2007-05-28 22:06:18.000000000 +1000
-+++ a/libedit/Makefile	2008-06-14 18:43:26.000000000 +1000
-@@ -1,6 +1,15 @@
+---
+ libedit/Makefile |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/libedit/Makefile
++++ b/libedit/Makefile
+@@ -1,6 +1,13 @@
  #	$NetBSD: Makefile,v 1.36 2007/05/28 12:06:18 tls Exp $
  #	@(#)Makefile	8.1 (Berkeley) 6/4/93
  
 +OS!=	sh -c "case `uname -s` in GNU|GNU/*) echo GNU ;; *) uname -s ;; esac"
 +
 +.if ${OS} == GNU || ${OS} == Linux
-+CPPFLAGS+=-I../glibc-compat -I../glibc-bsd-glue
-+CFLAGS += -include ../glibc-bsd-glue/bsdcompat.h
-+.PATH: ${.CURDIR}/../glibc-bsd-glue ${.CURDIR}/../glibc-compat
++CFLAGS += -include bsd/bsd.h
 +MKLINT=no
 +.endif
 +
  USE_SHLIBDIR=	yes
  
  WARNS=	3
-@@ -12,6 +21,10 @@ OSRCS=	chared.c common.c el.c emacs.c fc
- 	key.c map.c \
- 	parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c
- 
-+.if ${OS} == GNU || ${OS} == Linux
-+OSRCS+=	fgetln.c vis.c unvis.c strlcat.c strlcpy.c
-+.endif
-+
- MAN=	editline.3 editrc.5
- 
- MLINKS=	editline.3 el_init.3 editline.3 el_end.3 editline.3 el_reset.3 \
diff --git a/debian/patches/06-fgetln.c-error.diff b/debian/patches/06-fgetln.c-error.diff
deleted file mode 100644
index 5e610c3..0000000
--- a/debian/patches/06-fgetln.c-error.diff
+++ /dev/null
@@ -1,24 +0,0 @@
- 06-fgetln.c-error.diff by Ben Burton <bab@debian.org>
-
- Routine fgetln() was behaving incorrectly on error (such as when
- EOF was reached), which in turn caused infinite memory consumption
- during read_history().
-
---- a/glibc-bsd-glue/fgetln.c
-+++ a/glibc-bsd-glue/fgetln.c
-@@ -5,9 +5,10 @@
- {
- 	char *line=NULL;
- 
--	getline (&line, len, stream);
--
--	(*len)--; /* get rid of the trailing \0, fgetln
--	does not have it */
--	return line;
-+	if (getline (&line, len, stream) >= 0) {
-+		(*len)--; /* get rid of the trailing \0, fgetln
-+		does not have it */
-+		return line;
-+	} else
-+		return NULL;
- }
diff --git a/debian/patches/11-357594-vis.h.diff b/debian/patches/11-357594-vis.h.diff
deleted file mode 100644
index 67f3608..0000000
--- a/debian/patches/11-357594-vis.h.diff
+++ /dev/null
@@ -1,34 +0,0 @@
- 11-357594-vis.h.diff by Robert Millan <rmh@aybabtu.com>
- minor adaptation for Glibc
- http://bugs.debian.org/357594
-
---- a/glibc-compat/vis.h	2005-09-13 11:44:32.000000000 +1000
-+++ a/glibc-compat/vis.h	2008-06-15 12:51:31.000000000 +1000
-@@ -40,7 +40,7 @@
-  * to select alternate encoding format
-  */
- #define	VIS_OCTAL	0x01	/* use octal \ddd format */
--#define	VIS_CSTYLE	0x02	/* use \[nrft0..] where appropiate */
-+#define	VIS_CSTYLE	0x02	/* use \[nrft0..] where appropriate */
- 
- /*
-  * to alter set of characters encoded (default is to encode all
-@@ -57,6 +57,7 @@
-  */
- #define	VIS_NOSLASH	0x40	/* inhibit printing '\' */
- #define	VIS_HTTPSTYLE	0x80	/* http-style escape % HEX HEX */
-+#define	VIS_GLOB	0x100	/* encode glob(3) magics */
- 
- /*
-  * unvis return codes
-@@ -83,9 +84,7 @@
- int	strsvisx(char *, const char *, size_t, int, const char *);
- int	strunvis(char *, const char *);
- int	strunvisx(char *, const char *, int);
--#ifndef __LIBC12_SOURCE__
--int	unvis(char *, int, int *, int) __RENAME(__unvis13);
--#endif
-+int	unvis(char *, int, int *, int);
- __END_DECLS
- 
- #endif /* !_VIS_H_ */
diff --git a/debian/patches/13-symbol_not_found.diff b/debian/patches/13-symbol_not_found.diff
deleted file mode 100644
index 0494450..0000000
--- a/debian/patches/13-symbol_not_found.diff
+++ /dev/null
@@ -1,100 +0,0 @@
- 13-symbol_not_found.diff by Anibal Monsalve Salazar
- Without this patch I get the following messages:
- dpkg-shlibdeps: warning: symbol strlcpy used by debian/libedit2/usr/lib/libedit.so.2.11 found in none of the libraries.
- dpkg-shlibdeps: warning: symbol strlcat used by debian/libedit2/usr/lib/libedit.so.2.11 found in none of the libraries.
-
---- a/glibc-compat/namespace.h	2008-04-29 06:23:00.000000000 +1000
-+++ a/glibc-compat/namespace.h	2008-06-15 17:39:10.000000000 +1000
-@@ -52,8 +52,6 @@
- #define pipe		_pipe
- #define sbrk		_sbrk
- #define strerror_r	_strerror_r
--#define strlcat		_strlcat
--#define strlcpy		_strlcpy
- #define strtof		_strtof
- #define strtoimax	_strtoimax
- #define strtold		_strtold
---- a/glibc-compat/strlcat.c	2007-06-05 04:19:27.000000000 +1000
-+++ a/glibc-compat/strlcat.c	2008-06-15 22:45:39.000000000 +1000
-@@ -17,34 +17,15 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
--#if !defined(_KERNEL) && !defined(_STANDALONE)
--#if HAVE_NBTOOL_CONFIG_H
--#include "nbtool_config.h"
--#endif
--
- #include <sys/cdefs.h>
- #if defined(LIBC_SCCS) && !defined(lint)
- __RCSID("$NetBSD: strlcat.c,v 1.3 2007/06/04 18:19:27 christos Exp $");
- #endif /* LIBC_SCCS and not lint */
- 
--#ifdef _LIBC
--#include "namespace.h"
--#endif
- #include <sys/types.h>
- #include <assert.h>
- #include <string.h>
- 
--#ifdef _LIBC
--# ifdef __weak_alias
--__weak_alias(strlcat, _strlcat)
--# endif
--#endif
--
--#else
--#include <lib/libkern/libkern.h>
--#endif /* !_KERNEL && !_STANDALONE */
--
--#if !HAVE_STRLCAT
- /*
-  * Appends src to string dst of size siz (unlike strncat, siz is the
-  * full size of dst, not space left).  At most siz-1 characters
-@@ -82,4 +63,3 @@
- 
- 	return(dlen + (s - src));	/* count does not include NUL */
- }
--#endif
---- a/glibc-compat/strlcpy.c	2007-06-05 04:19:27.000000000 +1000
-+++ a/glibc-compat/strlcpy.c	2008-06-15 22:45:50.000000000 +1000
-@@ -17,34 +17,15 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
--#if !defined(_KERNEL) && !defined(_STANDALONE)
--#if HAVE_NBTOOL_CONFIG_H
--#include "nbtool_config.h"
--#endif
--
- #include <sys/cdefs.h>
- #if defined(LIBC_SCCS) && !defined(lint)
- __RCSID("$NetBSD: strlcpy.c,v 1.3 2007/06/04 18:19:27 christos Exp $");
- #endif /* LIBC_SCCS and not lint */
- 
--#ifdef _LIBC
--#include "namespace.h"
--#endif
- #include <sys/types.h>
- #include <assert.h>
- #include <string.h>
- 
--#ifdef _LIBC
--# ifdef __weak_alias
--__weak_alias(strlcpy, _strlcpy)
--# endif
--#endif
--#else
--#include <lib/libkern/libkern.h>
--#endif /* !_KERNEL && !_STANDALONE */
--
--
--#if !HAVE_STRLCPY
- /*
-  * Copy src to string dst of size siz.  At most siz-1 characters
-  * will be copied.  Always NUL terminates (unless siz == 0).
-@@ -78,4 +59,3 @@
- 
- 	return(s - src - 1);	/* count does not include NUL */
- }
--#endif
diff --git a/debian/patches/series b/debian/patches/series
index 89fc720..cf9604c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,10 +2,7 @@
 02-el.c-issetugid.diff
 03-el.c-MAXPATHLEN.diff
 04-readline.h-stdio.diff
-06-fgetln.c-error.diff
 08-readline-history.h.diff
 10-define_SIZE_T_MAX.diff
-11-357594-vis.h.diff
 12-libedit-Makefile.diff
-13-symbol_not_found.diff
 20-fortify.patch
diff --git a/debian/rules b/debian/rules
index de16d67..ae8a314 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,7 +9,7 @@ PACKAGE		 = libedit
 PKGDIR		 = ${CURDIR}/debian/tmp
 PMAKE_ARGS	 = MKPROFILE=no MKCATPAGES=no MLINKS= MANPAGES= \
 		 SHLIB_SHFLAGS="-Wl,-soname,libedit.so.${major}" \
-		 LDADD="*.so -lcurses"
+		 LDADD="*.so -lbsd -lcurses"
 EDITLINE_3_LINKS = el_init el_end el_reset el_gets el_getc el_push \
 		 el_parse el_set el_get el_source el_resize el_line \
 		 el_insertstr el_deletestr history_init history_end history
@@ -20,9 +20,6 @@ major		 = 2
 CVSROOT		 = :pserver:anoncvs@anoncvs.netbsd.org:/cvsroot
 DATE		 = $(shell date +%Y%m%d)
 ROOT		 = basesrc
-MISC_STUFF	 = lib/libc/include/namespace.h lib/libc/string/strlcat.c \
-		 lib/libc/string/strlcpy.c lib/libc/gen/vis.c \
-		 lib/libc/gen/unvis.c include/vis.h
 
 DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
@@ -61,7 +58,7 @@ install: build
 	install -d ${PKGDIR}/usr/share/man/man3
 	install -d ${PKGDIR}/usr/share/man/man5
 	install -d ${PKGDIR}/usr/lib/pkgconfig
-	install -m 644 $(CURDIR)/glibc-compat/vis.h ${PKGDIR}/usr/include/libedit
+	install -m 644 $(CURDIR)/debian/libedit-vis.h ${PKGDIR}/usr/include/libedit/vis.h
 	install -m 644 $(CURDIR)/debian/libedit.pc ${PKGDIR}/usr/lib/pkgconfig
 	cd libedit && \
 	 pmake install incinstall DESTDIR=${PKGDIR} ${PMAKE_ARGS}
@@ -101,11 +98,6 @@ binary-arch: build install
 binary: binary-indep binary-arch
 
 cvs-update:
-	install -d glibc-compat/tmp
-	cd glibc-compat/tmp && \
-	 cvs -d ${CVSROOT} export -D now $(patsubst %,${ROOT}/%,${MISC_STUFF})
-	find glibc-compat/tmp -type f -exec mv {} glibc-compat/ \;
-	rm -rf glibc-compat/tmp
 	cvs -d ${CVSROOT} export -D now -d libedit-${DATE} ${ROOT}/lib/libedit
 
 .PHONY: build clean binary-indep binary-arch binary install cvs-update
diff --git a/glibc-bsd-glue/bsdcompat.h b/glibc-bsd-glue/bsdcompat.h
deleted file mode 100644
index 0b27d73..0000000
--- a/glibc-bsd-glue/bsdcompat.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _BSDCOMPAT_H
-#define _BSDCOMPAT_H 1
-
-#include <stdio.h>
-#include <sys/ioctl.h>
-
-size_t   strlcat __P((char *, const char *, size_t));
-size_t   strlcpy __P((char *, const char *, size_t));
-char	*fgetln  __P((FILE *, size_t *));
-
-#define __warn_references(...)
-#define __RENAME(...)
-#define _DIAGASSERT(...)
-#define __RCSID(...)
-
-#endif /* !_BSDCOMPAT_H */
diff --git a/glibc-bsd-glue/fgetln.c b/glibc-bsd-glue/fgetln.c
deleted file mode 100644
index 599292c..0000000
--- a/glibc-bsd-glue/fgetln.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "bsdcompat.h"
-
-char *
-fgetln (FILE *stream, size_t *len)
-{
-	char *line=NULL;
-
-	getline (&line, len, stream);
-
-	(*len)--; /* get rid of the trailing \0, fgetln
-	does not have it */
-	return line;
-}
diff --git a/glibc-compat/namespace.h b/glibc-compat/namespace.h
deleted file mode 100644
index ebc2637..0000000
--- a/glibc-compat/namespace.h
+++ /dev/null
@@ -1,781 +0,0 @@
-/*	$NetBSD: namespace.h,v 1.131 2008/04/28 20:23:00 martin Exp $	*/
-
-/*-
- * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _NAMESPACE_H_
-#define _NAMESPACE_H_
-
-#include <sys/cdefs.h>
-
-#ifndef __lint__
-#define brk		_brk
-#define catclose	_catclose
-#define catgets		_catgets
-#define catopen		_catopen
-#define daylight	_daylight
-#define err		_err
-#define errx		_errx
-#ifdef _REENTRANT
-#define fileno		_fileno
-#endif /* _REENTRANT */
-#define fork		_fork
-#define fseeko		_fseeko
-#define ftello		_ftello
-#define getcontext	_getcontext
-#define getenv_r	_getenv_r
-#define inet_aton	_inet_aton
-#define inet_pton	_inet_pton
-#define pipe		_pipe
-#define sbrk		_sbrk
-#define strerror_r	_strerror_r
-#define strlcat		_strlcat
-#define strlcpy		_strlcpy
-#define strtof		_strtof
-#define strtoimax	_strtoimax
-#define strtold		_strtold
-#define strtoll		_strtoll
-#define strtoull	_strtoull
-#define strtoumax	_strtoumax
-#define sys_errlist	_sys_errlist
-#define sys_nerr	_sys_nerr
-#define sys_siglist	_sys_siglist
-#define	sys_nsig	_sys_nsig
-#define sysconf		__sysconf
-#define verr		_verr
-#define verrx		_verrx
-#define vwarn		_vwarn
-#define vwarnx		_vwarnx
-#define warn		_warn
-#define warnx		_warnx
-
-#ifdef __weak_alias
-#define MD2Data			_MD2Data
-#define MD2End			_MD2End
-#define MD2FileChunk		_MD2FileChunk
-#define MD2File			_MD2File
-#define MD2Final		_MD2Final
-#define MD2Init			_MD2Init
-#define MD2Transform		_MD2Transform
-#define MD2Update		_MD2Update
-#define MD4Data			_MD4Data
-#define MD4End			_MD4End
-#define MD4FileChunk		_MD4FileChunk
-#define MD4File			_MD4File
-#define MD4Final		_MD4Final
-#define MD4Init			_MD4Init
-#define MD4Transform		_MD4Transform
-#define MD4Update		_MD4Update
-#define MD5Data			_MD5Data
-#define MD5End			_MD5End
-#define MD5FileChunk		_MD5FileChunk
-#define MD5File			_MD5File
-#define MD5Final		_MD5Final
-#define MD5Init			_MD5Init
-#define MD5Transform		_MD5Transform
-#define MD5Update		_MD5Update
-#define RMD160Data		_RMD160Data
-#define RMD160End		_RMD160End
-#define RMD160FileChunk		_RMD160FileChunk
-#define RMD160File		_RMD160File
-#define RMD160Final		_RMD160Final
-#define RMD160Init		_RMD160Init
-#define RMD160Transform		_RMD160Transform
-#define RMD160Update		_RMD160Update
-#define SHA1Data		_SHA1Data
-#define SHA1End			_SHA1End
-#define SHA1FileChunk		_SHA1FileChunk
-#define SHA1File		_SHA1File
-#define SHA1Final		_SHA1Final
-#define SHA1Init		_SHA1Init
-#define SHA1Transform		_SHA1Transform
-#define SHA1Update		_SHA1Update
-#define SHA256_Data		_SHA256_Data
-#define SHA256_End		_SHA256_End
-#define SHA256_FileChunk	_SHA256_FileChunk
-#define SHA256_File		_SHA256_File
-#define SHA256_Final		_SHA256_Final
-#define SHA256_Init		_SHA256_Init
-#define SHA256_Transform	_SHA256_Transform
-#define SHA256_Update		_SHA256_Update
-#define SHA384_Data		_SHA384_Data
-#define SHA384_End		_SHA384_End
-#define SHA384_FileChunk	_SHA384_FileChunk
-#define SHA384_File		_SHA384_File
-#define SHA384_Final		_SHA384_Final
-#define SHA384_Init		_SHA384_Init
-#define SHA384_Transform	_SHA384_Transform
-#define SHA384_Update		_SHA384_Update
-#define SHA512_Data		_SHA512_Data
-#define SHA512_End		_SHA512_End
-#define SHA512_FileChunk	_SHA512_FileChunk
-#define SHA512_File		_SHA512_File
-#define SHA512_Final		_SHA512_Final
-#define SHA512_Init		_SHA512_Init
-#define SHA512_Transform	_SHA512_Transform
-#define SHA512_Update		_SHA512_Update
-#define a64l			_a64l
-#define adjtime			_adjtime
-#define alarm			_alarm
-#define alphasort		_alphasort
-#define arc4random		_arc4random
-#define asctime_r		_asctime_r
-#define asprintf		_asprintf
-#define atoll			_atoll
-#define authnone_create		_authnone_create
-#define authunix_create		_authunix_create
-#define authunix_create_default _authunix_create_default
-#define basename		_basename
-#define bindresvport		_bindresvport
-#define bindresvport_sa		_bindresvport_sa
-#define bm_comp			_bm_comp
-#define bm_exec			_bm_exec
-#define bm_free			_bm_free
-#define callrpc			_callrpc
-#define cfgetispeed		_cfgetispeed
-#define cfgetospeed		_cfgetospeed
-#define cfmakeraw		_cfmakeraw
-#define cfsetispeed		_cfsetispeed
-#define cfsetospeed		_cfsetospeed
-#define cfsetspeed		_cfsetspeed
-#define cgetcap			_cgetcap
-#define cgetclose		_cgetclose
-#define cgetent			_cgetent
-#define cgetfirst		_cgetfirst
-#define cgetmatch		_cgetmatch
-#define cgetnext		_cgetnext
-#define cgetnum			_cgetnum
-#define cgetset			_cgetset
-#define cgetstr			_cgetstr
-#define cgetustr		_cgetustr
-#define clnt_broadcast		_clnt_broadcast
-#define clnt_create		_clnt_create
-#define clnt_create_vers	_clnt_create_vers
-#define clnt_dg_create		_clnt_dg_create
-#define clnt_pcreateerror	_clnt_pcreateerror
-#define clnt_perrno		_clnt_perrno
-#define clnt_perror		_clnt_perror
-#define clnt_raw_create		_clnt_raw_create
-#define clnt_tli_create		_clnt_tli_create
-#define clnt_tp_create		_clnt_tp_create
-#define clnt_spcreateerror	_clnt_spcreateerror
-#define clnt_sperrno		_clnt_sperrno
-#define clnt_sperror		_clnt_sperror
-#define clnt_vc_create		_clnt_vc_create
-#define clntraw_create		_clntraw_create
-#define clnttcp_create		_clnttcp_create
-#define clntudp_bufcreate	_clntudp_bufcreate
-#define clntudp_create		_clntudp_create
-#define clock_settime		_clock_settime
-#define closedir		_closedir
-#define closelog		_closelog
-#define closelog_r		_closelog_r
-#define confstr			_confstr
-#define csetexpandtc		_csetexpandtc
-#define ctermid			_ctermid
-#define ctime_r			_ctime_r
-#define daemon			_daemon
-#define dbopen			_dbopen
-#define devname			_devname
-#define dirname			_dirname
-#define dn_expand		_dn_expand
-#define drand48			_drand48
-#define endfsent		_endfsent
-#define endgrent		_endgrent
-#define endhostent		_endhostent
-#define endnetconfig		_endnetconfig
-#define endnetent		_endnetent
-#define endnetgrent		_endnetgrent
-#define endnetpath		_endnetpath
-#define endprotoent		_endprotoent
-#define endprotoent_r		_endprotoent_r
-#define endpwent		_endpwent
-#define endrpcent		_endrpcent
-#define endservent		_endservent
-#define endservent_r		_endservent_r
-#define endttyent		_endttyent
-#define endusershell		_endusershell
-#define erand48			_erand48
-#define ether_aton		_ether_aton
-#define ether_hostton		_ether_hostton
-#define ether_line		_ether_line
-#define ether_ntoa		_ether_ntoa
-#define ether_ntohost		_ether_ntohost
-#define execl			_execl
-#define execle			_execle
-#define execlp			_execlp
-#define execv			_execv
-#define execvp			_execvp
-#define fdopen			_fdopen
-#define fgetln			_fgetln
-#define fgetwln			_fgetwln
-#define fhstatvfs		_fhstatvfs
-#define flockfile		_flockfile
-#define ftrylockfile		_ftrylockfile
-#define funlockfile		_funlockfile
-#define fnmatch			_fnmatch
-#define fparseln		_fparseln
-#define fpgetmask		_fpgetmask
-#define fpgetround		_fpgetround
-#define fpgetsticky		_fpgetsticky
-#define fpsetmask		_fpsetmask
-#define fpsetround		_fpsetround
-#define fpsetsticky		_fpsetsticky
-#define freenetconfigent	_freenetconfigent
-#define freeaddrinfo		_freeaddrinfo
-#define freeifaddrs		_freeifaddrs
-#define fstatvfs		_fstatvfs
-#define ftok			_ftok
-#define ftruncate		_ftruncate
-#define fts_children		_fts_children
-#define fts_close		_fts_close
-#define fts_open		_fts_open
-#define fts_read		_fts_read
-#define fts_set			_fts_set
-#define gai_strerror		_gai_strerror
-#define get_myaddress		_get_myaddress
-#define getaddrinfo		_getaddrinfo
-#define getbsize		_getbsize
-#define getcwd			_getcwd
-#define getdevmajor		_getdevmajor
-#define getdiskbyname		_getdiskbyname
-#define getdomainname		_getdomainname
-#define getfsent		_getfsent
-#define getfsfile		_getfsfile
-#define getfsspec		_getfsspec
-#define getgrent		_getgrent
-#define getgrent_r		_getgrent_r
-#define getgrgid		_getgrgid
-#define getgrgid_r		_getgrgid_r
-#define getgrnam		_getgrnam
-#define getgrnam_r		_getgrnam_r
-#define getgrouplist		_getgrouplist
-#define getgroupmembership	_getgroupmembership
-#define gethostbyaddr		_gethostbyaddr
-#define gethostbyname		_gethostbyname
-#define gethostent		_gethostent
-#define gethostname		_gethostname
-#define getifaddrs		_getifaddrs
-#define getloadavg		_getloadavg
-#define getlogin		_getlogin
-#define getmntinfo		_getmntinfo
-#define getmode			_getmode
-#define getnameinfo		_getnameinfo
-#define getnetbyaddr		_getnetbyaddr
-#define getnetbyname		_getnetbyname
-#define getnetconfig		_getnetconfig
-#define getnetconfigent		_getnetconfigent
-#define getnetent		_getnetent
-#define getnetgrent		_getnetgrent
-#define getnetpath		_getnetpath
-#define getopt			_getopt
-#define getopt_long		_getopt_long
-#define getpagesize		_getpagesize
-#define getpass			_getpass
-#define getprogname		_getprogname
-#define getprotobyname		_getprotobyname
-#define getprotobyname_r	_getprotobyname_r
-#define getprotobynumber	_getprotobynumber
-#define getprotobynumber_r	_getprotobynumber_r
-#define getprotoent		_getprotoent
-#define getprotoent_r		_getprotoent_r
-#define getpwent		_getpwent
-#define getpwent_r		_getpwent_r
-#define getpwnam		_getpwnam
-#define getpwnam_r		_getpwnam_r
-#define getpwuid		_getpwuid
-#define getpwuid_r		_getpwuid_r
-#define getrpcbyname		_getrpcbyname
-#define getrpcbyname_r		_getrpcbyname_r
-#define getrpcbynumber		_getrpcbynumber
-#define getrpcbynumber_r	_getrpcbynumber_r
-#define getrpcent		_getrpcent
-#define getrpcent_r		_getrpcent_r
-#define getrpcport		_getrpcport
-#define getservbyname		_getservbyname
-#define getservbyname_r		_getservbyname_r
-#define getservbyport		_getservbyport
-#define getservbyport_r		_getservbyport_r
-#define getservent		_getservent
-#define getservent_r		_getservent_r
-#define getsubopt		_getsubopt
-#define getttyent		_getttyent
-#define getttynam		_getttynam
-#define getusershell		_getusershell
-#define glob			_glob
-#define globfree		_globfree
-#define gmtime_r		_gmtime_r
-#define group_from_gid		_group_from_gid
-#define heapsort		_heapsort
-#define herror			_herror
-#define hes_error		_hes_error
-#define hes_free		_hes_free
-#define hes_init		_hes_init
-#define hes_resolve		_hes_resolve
-#define hes_to_bind		_hes_to_bind
-#define hesiod_end		_hesiod_end
-#define hesiod_free_list	_hesiod_free_list
-#define hesiod_init		_hesiod_init
-#define hesiod_resolve		_hesiod_resolve
-#define hesiod_to_bind		_hesiod_to_bind
-#define iconv			_iconv
-#define iconv_open		_iconv_open
-#define iconv_close		_iconv_close
-#define if_freenameindex	_if_freenameindex
-#define if_indextoname		_if_indextoname
-#define if_nameindex		_if_nameindex
-#define if_nametoindex		_if_nametoindex
-#define in6addr_any		_in6addr_any
-#define in6addr_linklocal_allnodes	_in6addr_linklocal_allnodes
-#define in6addr_linklocal_allrouters	_in6addr_linklocal_allrouters
-#define in6addr_loopback	_in6addr_loopback
-#define in6addr_nodelocal_allnodes	_in6addr_nodelocal_allnodes
-#define inet6_option_alloc	_inet6_option_alloc
-#define inet6_option_append	_inet6_option_append
-#define inet6_option_find	_inet6_option_find
-#define inet6_option_init	_inet6_option_init
-#define inet6_option_next	_inet6_option_next
-#define inet6_option_space	_inet6_option_space
-#define inet6_opt_init		_inet6_opt_init
-#define inet6_opt_append	_inet6_opt_append
-#define inet6_opt_finish	_inet6_opt_finish
-#define inet6_opt_set_val	_inet6_opt_set_val
-#define inet6_opt_next		_inet6_opt_next
-#define inet6_opt_find		_inet6_opt_find
-#define inet6_opt_get_val	_inet6_opt_get_val
-#define inet6_rthdr_add		_inet6_rthdr_add
-#define inet6_rthdr_getaddr	_inet6_rthdr_getaddr
-#define inet6_rthdr_getflags	_inet6_rthdr_getflags
-#define inet6_rthdr_init	_inet6_rthdr_init
-#define inet6_rthdr_lasthop	_inet6_rthdr_lasthop
-#define inet6_rthdr_segments	_inet6_rthdr_segments
-#define inet6_rthdr_space	_inet6_rthdr_space
-#define inet6_rth_space		_inet6_rth_space
-#define inet6_rth_init		_inet6_rth_init
-#define inet6_rth_add		_inet6_rth_add
-#define inet6_rth_reverse	_inet6_rth_reverse
-#define inet6_rth_segments	_inet6_rth_segments
-#define inet6_rth_getaddr	_inet6_rth_getaddr
-#define inet_cidr_ntop		_inet_cidr_ntop
-#define inet_cidr_pton		_inet_cidr_pton
-#define inet_lnaof		_inet_lnaof
-#define inet_makeaddr		_inet_makeaddr
-#define inet_net_ntop		_inet_net_ntop
-#define inet_net_pton		_inet_net_pton
-#define inet_neta		_inet_neta
-#define inet_netof		_inet_netof
-#define inet_network		_inet_network
-#define inet_nsap_addr		_inet_nsap_addr
-#define inet_nsap_ntoa		_inet_nsap_ntoa
-#define inet_ntoa		_inet_ntoa
-#define inet_ntop		_inet_ntop
-#define initgroups		_initgroups
-#define initstate		_initstate
-#define innetgr			_innetgr
-#define isatty			_isatty
-#define jrand48			_jrand48
-#define kill			_kill
-#define l64a			_l64a
-#define l64a_r			_l64a_r
-#define lcong48			_lcong48
-#define llabs			_llabs
-#define lldiv			_lldiv
-#define localtime_r		_localtime_r
-#define lockf			_lockf
-#define lrand48			_lrand48
-#define lseek			_lseek
-#define mergesort		_mergesort
-#define mkstemp			_mkstemp
-#define mmap			_mmap
-#define mpool_close		_mpool_close
-#define mpool_filter		_mpool_filter
-#define mpool_get		_mpool_get
-#define mpool_new		_mpool_new
-#define mpool_open		_mpool_open
-#define mpool_put		_mpool_put
-#define mpool_sync		_mpool_sync
-#define mrand48			_mrand48
-#define nc_perror		_nc_perror
-#define nc_sperror		_nc_sperror
-#define nice			_nice
-#if 0
-#define nlist			_nlist
-#endif
-#define nrand48			_nrand48
-#define ntp_adjtime		_ntp_adjtime
-#define nsdispatch		_nsdispatch
-#define offtime			_offtime
-#define opendir			_opendir
-#define openlog			_openlog
-#define openlog_r		_openlog_r
-#define pause			_pause
-#define pclose			_pclose
-#define pmap_getmaps		_pmap_getmaps
-#define pmap_getport		_pmap_getport
-#define pmap_rmtcall		_pmap_rmtcall
-#define pmap_set		_pmap_set
-#define pmap_unset		_pmap_unset
-#define popen			_popen
-#define posix2time		_posix2time
-#define pread			_pread
-#define psignal			_psignal
-#define pthread_atfork		_pthread_atfork
-#define putenv			_putenv
-#define pwcache_groupdb		_pwcache_groupdb
-#define pwcache_userdb		_pwcache_userdb
-#define pwrite			_pwrite
-#define qabs			_qabs
-#define qdiv			_qdiv
-#define radixsort		_radixsort
-#define random			_random
-#define randomid		_randomid
-#define randomid_new		_randomid_new
-#define randomid_delete		_randomid_delete
-#define read			_read
-#define readdir			_readdir
-#define readdir_r		_readdir_r
-#define readlink		_readlink
-#define realpath		_realpath
-#define regcomp			_regcomp
-#define regerror		_regerror
-#define regexec			_regexec
-#define regfree			_regfree
-#define registerrpc		_registerrpc
-#define res_init		_res_init
-#define res_mkquery		_res_mkquery
-#define res_query		_res_query
-#define res_search		_res_search
-#define rewinddir		_rewinddir
-#define rpc_broadcast		_rpc_broadcast
-#define rpc_broadcast_exp	_rpc_broadcast_exp
-#define rpc_call		_rpc_call
-#define rpc_control		_rpc_control
-#define rpc_reg			_rpc_reg
-#define rpcb_getmaps		_rpcb_getmaps
-#define rpcb_gettime		_rpcb_gettime
-#define rpcb_rmtcall		_rpcb_rmtcall
-#define rpcb_set		_rpcb_set
-#define rpcb_taddr2uaddr	_rpcb_taddr2uaddr
-#define rpcb_uaddr2taddr	_rpcb_uaddr2taddr
-#define rpcb_unset		_rpcb_unset
-#define scandir			_scandir
-#define seed48			_seed48
-#define seekdir			_seekdir
-#define send			_send
-#define setdomainname		_setdomainname
-#define setenv			_setenv
-#define setfsent		_setfsent
-#define setgrent		_setgrent
-#define setgroupent		_setgroupent
-#define sethostent		_sethostent
-#define sethostname		_sethostname
-#define setlogin		_setlogin
-#define setlogmask		_setlogmask
-#define setlogmask_r		_setlogmask_r
-#define setmode			_setmode
-#define setnetconfig		_setnetconfig
-#define setnetent		_setnetent
-#define setnetgrent		_setnetgrent
-#define setpassent		_setpassent
-#define setnetpath		_setnetpath
-#define setproctitle		_setproctitle
-#define setprotoent		_setprotoent
-#define setprotoent_r		_setprotoent_r
-#define setpwent		_setpwent
-#define setrpcent		_setrpcent
-#define setservent		_setservent
-#define setservent_r		_setservent_r
-#define setstate		_setstate
-#define setttyent		_setttyent
-#define setttyentpath		_setttyentpath
-#define settimeofday		_settimeofday
-#define setusershell		_setusershell
-#define shm_open		_shm_open
-#define shm_unlink		_shm_unlink
-#define shquote			_shquote
-#define siginterrupt		_siginterrupt
-#define signal			_signal
-#define sl_add			_sl_add
-#define sl_create		_sl_create
-#define sl_delete		_sl_delete
-#define sl_find			_sl_find
-#define sl_free			_sl_free
-#define sl_init			_sl_init
-#define sleep			_sleep
-#ifndef snprintf
-#define snprintf		_snprintf
-#endif
-#define snprintf_ss		_snprintf_ss
-#define sradixsort		_sradixsort
-#define srand48			_srand48
-#define srandom			_srandom
-#define statvfs(a, b)		_statvfs(a, b)
-#define strcasecmp		_strcasecmp
-#define strdup			_strdup
-#define stresep			_stresep
-#define strndup			_strndup
-#define strncasecmp		_strncasecmp
-#define strptime		_strptime
-#define strsep			_strsep
-#define strsignal		_strsignal
-#define strsuftoll	 	_strsuftoll
-#define strsuftollx	 	_strsuftollx
-#define strsvis			_strsvis
-#define strsvisx		_strsvisx
-#define strtok_r		_strtok_r
-#define strunvis		_strunvis
-#define strvis			_strvis
-#define strvisx			_strvisx
-#define svc_auth_reg		_svc_auth_reg
-#define svc_create		_svc_create
-#define svc_dg_create		_svc_dg_create
-#define svc_exit		_svc_exit
-#define svc_fd_create		_svc_fd_create
-#define svc_getreq		_svc_getreq
-#define svc_getreqset		_svc_getreqset
-#define svc_getreq_common	_svc_getreq_common
-#define svc_raw_create		_svc_raw_create
-#define svc_register		_svc_register
-#define svc_reg			_svc_reg
-#define svc_run			_svc_run
-#define svc_sendreply		_svc_sendreply
-#define svc_tli_create		_svc_tli_create
-#define svc_tp_create		_svc_tp_create
-#define svc_unregister		_svc_unregister
-#define svc_unreg		_svc_unreg
-#define svc_vc_create		_svc_vc_create
-#define svcerr_auth		_svcerr_auth
-#define svcerr_decode		_svcerr_decode
-#define svcerr_noproc		_svcerr_noproc
-#define svcerr_noprog		_svcerr_noprog
-#define svcerr_progvers		_svcerr_progvers
-#define svcerr_systemerr	_svcerr_systemerr
-#define svcerr_weakauth		_svcerr_weakauth
-#define svcfd_create		_svcfd_create
-#define svcraw_create		_svcraw_create
-#define svctcp_create		_svctcp_create
-#define svcudp_bufcreate	_svcudp_bufcreate
-#define svcudp_create		_svcudp_create
-#define svcudp_enablecache	_svcudp_enablecache
-#define svis			_svis
-#define sysarch			_sys_sysarch
-#define sysctl			_sysctl
-#define sysctlbyname		_sysctlbyname
-#define sysctlgetmibinfo	_sysctlgetmibinfo
-#define sysctlnametomib		_sysctlnametomib
-#define syslog			_syslog
-#define syslog_r		_syslog_r
-#define syslog_ss		_syslog_ss
-#define taddr2uaddr		_taddr2uaddr
-#define tcdrain			_tcdrain
-#define tcflow			_tcflow
-#define tcflush			_tcflush
-#define tcgetattr		_tcgetattr
-#define tcgetpgrp		_tcgetpgrp
-#define tcgetsid		_tcgetsid
-#define tcsendbreak		_tcsendbreak
-#define tcsetattr		_tcsetattr
-#define tcsetpgrp		_tcsetpgrp
-#define telldir			_telldir
-#define time			_time
-#define time2posix		_time2posix
-#define timegm			_timegm
-#define timelocal		_timelocal
-#define timeoff			_timeoff
-#define times			_times
-#define ttyname			_ttyname
-#define ttyname_r		_ttyname_r
-#define ttyslot			_ttyslot
-#define tzname			_tzname
-#define tzset			_tzset
-#define tzsetwall		_tzsetwall
-#define uaddr2taddr		_uaddr2taddr
-#define ualarm			_ualarm
-#define uname			_uname
-#define unsetenv		_unsetenv
-#define unvis			_unvis
-#define user_from_uid		_user_from_uid
-#define usleep			_usleep
-#define utime			_utime
-#define uuid_create_nil		_uuid_create_nil
-#define uuid_is_nil		_uuid_is_nil
-#define valloc			_valloc
-#define vis			_vis
-#ifndef vsnprintf
-#define vsnprintf		_vsnprintf
-#endif
-#define vsnprintf_ss		_vsnprintf_ss
-#define vsyslog			_vsyslog
-#define vsyslog_r		_vsyslog_r
-#define vsyslog_ss		_vsyslog_ss
-#define wait			_wait
-#define wait3			_wait3
-#define waitpid			_waitpid
-#define wcscasecmp		_wcscasecmp
-#define wcsdup			_wcsdup
-#define wcsncasecmp		_wcsncasecmp
-#define wcstof			_wcstof
-#define wcstod			_wcstod
-#define wcstold			_wcstold
-#define wcwidth			_wcwidth
-#define xdr_accepted_reply	_xdr_accepted_reply
-#define xdr_array		_xdr_array
-#define xdr_authunix_parms	_xdr_authunix_parms
-#define xdr_bool		_xdr_bool
-#define xdr_bytes		_xdr_bytes
-#define xdr_callhdr		_xdr_callhdr
-#define xdr_callmsg		_xdr_callmsg
-#define xdr_char		_xdr_char
-#define xdr_datum		_xdr_datum
-#define xdr_des_block		_xdr_des_block
-#define xdr_domainname		_xdr_domainname
-#define xdr_double		_xdr_double
-#define xdr_enum		_xdr_enum
-#define xdr_float		_xdr_float
-#define xdr_free		_xdr_free
-#define	xdr_hyper		_xdr_hyper
-#define xdr_int			_xdr_int
-#define xdr_int16_t		_xdr_int16_t
-#define xdr_int32_t		_xdr_int32_t
-#define xdr_int64_t		_xdr_int64_t
-#define xdr_long		_xdr_long
-#define	xdr_longlong_t		_xdr_longlong_t
-#define xdr_mapname		_xdr_mapname
-#define xdr_netbuf		_xdr_netbuf
-#define xdr_netobj		_xdr_netobj
-#define xdr_opaque		_xdr_opaque
-#define xdr_opaque_auth		_xdr_opaque_auth
-#define xdr_peername		_xdr_peername
-#define xdr_pmap		_xdr_pmap
-#define xdr_pmaplist		_xdr_pmaplist
-#define xdr_pointer		_xdr_pointer
-#define xdr_reference		_xdr_reference
-#define xdr_rejected_reply	_xdr_rejected_reply
-#define xdr_replymsg		_xdr_replymsg
-#define xdr_rmtcall_args	_xdr_rmtcall_args
-#define xdr_rmtcallres		_xdr_rmtcallres
-#define xdr_rpcb		_xdr_rpcb
-#define xdr_rpcb_entry		_xdr_rpcb_entry
-#define xdr_rpcb_entry_list_ptr	_xdr_rpcb_entry_list_ptr
-#define xdr_rpcb_rmtcallargs	_xdr_rpcb_rmtcallargs
-#define xdr_rpcb_rmtcallres	_xdr_rpcb_rmtcallres
-#define xdr_rpcb_stat		_xdr_rpcb_stat
-#define xdr_rpcb_stat_byvers	_xdr_rpcb_stat_byvers
-#define xdr_rpcblist		_xdr_rpcblist
-#define xdr_rpcblist_ptr	_xdr_rpcblist_ptr
-#define xdr_rpcbs_addrlist	_xdr_rpcbs_addrlist
-#define xdr_rpcbs_addrlist_ptr	_xdr_rpcbs_addrlist_ptr
-#define xdr_rpcbs_proc		_xdr_rpcbs_proc
-#define xdr_rpcbs_rmtcalllist	_xdr_rpcbs_rmtcalllist
-#define xdr_rpcbs_rmtcalllist_ptr	_xdr_rpcbs_rmtcalllist_ptr
-#define xdr_rpcbs		_xdr_rpcbs
-#define xdr_rpcbs		_xdr_rpcbs
-#define xdr_short		_xdr_short
-#define xdr_string		_xdr_string
-#define xdr_u_char		_xdr_u_char
-#define	xdr_u_hyper		_xdr_u_hyper
-#define xdr_u_int		_xdr_u_int
-#define xdr_u_int16_t		_xdr_u_int16_t
-#define xdr_u_int32_t		_xdr_u_int32_t
-#define xdr_u_int64_t		_xdr_u_int64_t
-#define xdr_u_long		_xdr_u_long
-#define	xdr_u_longlong_t	_xdr_u_longlong_t
-#define xdr_u_short		_xdr_u_short
-#define xdr_union		_xdr_union
-#define xdr_vector		_xdr_vector
-#define xdr_void		_xdr_void
-#define xdr_wrapstring		_xdr_wrapstring
-#define xdr_yp_inaddr		_xdr_yp_inaddr
-#define xdr_ypall		_xdr_ypall
-#define xdr_ypbind_resp		_xdr_ypbind_resp
-#define xdr_ypbind_setdom	_xdr_ypbind_setdom
-#define xdr_ypdomain_wrap_string	_xdr_ypdomain_wrap_string
-#define xdr_ypmap_parms		_xdr_ypmap_parms
-#define xdr_ypmap_wrap_string	_xdr_ypmap_wrap_string
-#define xdr_ypmaplist		_xdr_ypmaplist
-#define xdr_ypowner_wrap_string _xdr_ypowner_wrap_string
-#define xdr_yppushresp_xfr	_xdr_yppushresp_xfr
-#define xdr_ypreq_key		_xdr_ypreq_key
-#define xdr_ypreq_nokey		_xdr_ypreq_nokey
-#define xdr_ypreq_xfr		_xdr_ypreq_xfr
-#define xdr_ypresp_key_val	_xdr_ypresp_key_val
-#define xdr_ypresp_maplist	_xdr_ypresp_maplist
-#define xdr_ypresp_master	_xdr_ypresp_master
-#define xdr_ypresp_order	_xdr_ypresp_order
-#define xdr_ypresp_val		_xdr_ypresp_val
-#define xdrmem_create		_xdrmem_create
-#define xdrrec_create		_xdrrec_create
-#define xdrrec_endofrecord	_xdrrec_endofrecord
-#define xdrrec_eof		_xdrrec_eof
-#define xdrrec_skiprecord	_xdrrec_skiprecord
-#define xdrstdio_create		_xdrstdio_create
-#define xprt_register		_xprt_register
-#define xprt_unregister		_xprt_unregister
-#define yp_all			_yp_all
-#define yp_bind			_yp_bind
-#define yp_first		_yp_first
-#define yp_get_default_domain	_yp_get_default_domain
-#define yp_maplist		_yp_maplist
-#define yp_master		_yp_master
-#define yp_match		_yp_match
-#define yp_next			_yp_next
-#define yp_order		_yp_order
-#define yp_unbind		_yp_unbind
-#define yperr_string		_yperr_string
-#define ypprot_err		_ypprot_err
-#define dlopen			__dlopen
-#define dlclose			__dlclose
-#define dlsym			__dlsym
-#define dlerror			__dlerror
-#define dladdr			__dladdr
-#define fmtcheck		__fmtcheck
-
-/* rpc locks */
-#define authdes_lock		__rpc_authdes_lock
-#define authnone_lock		__rpc_authnone_lock
-#define authsvc_lock		__rpc_authsvc_lock
-#define clnt_fd_lock		__rpc_clnt_fd_lock
-#define clntraw_lock		__rpc_clntraw_lock
-#define dname_lock		__rpc_dname_lock
-#define dupreq_lock		__rpc_dupreq_lock
-#define keyserv_lock		__rpc_keyserv_lock
-#define libnsl_trace_lock	__rpc_libnsl_trace_lock
-#define loopnconf_lock		__rpc_loopnconf_lock
-#define ops_lock		__rpc_ops_lock
-#define portnum_lock		__rpc_portnum_lock
-#define proglst_lock		__rpc_proglst_lock
-#define rpcbaddr_cache_lock	__rpc_rpcbaddr_cache_lock
-#define rpcsoc_lock		__rpc_rpcsoc_lock
-#define svc_fd_lock		__rpc_svc_fd_lock
-#define svc_lock		__rpc_svc_lock
-#define svcraw_lock		__rpc_svcraw_lock
-#define xprtlist_lock		__rpc_xprtlist_lock
-
-#define __learn_tree		___learn_tree
-#endif /* __weak_alias */
-#endif /* !__lint__ */
-
-#endif /* _NAMESPACE_H_ */
diff --git a/glibc-compat/strlcat.c b/glibc-compat/strlcat.c
deleted file mode 100644
index d4a8d7e..0000000
--- a/glibc-compat/strlcat.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*	$NetBSD: strlcat.c,v 1.3 2007/06/04 18:19:27 christos Exp $	*/
-/*	$OpenBSD: strlcat.c,v 1.10 2003/04/12 21:56:39 millert Exp $	*/
-
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
- * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#if !defined(_KERNEL) && !defined(_STANDALONE)
-#if HAVE_NBTOOL_CONFIG_H
-#include "nbtool_config.h"
-#endif
-
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strlcat.c,v 1.3 2007/06/04 18:19:27 christos Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#ifdef _LIBC
-#include "namespace.h"
-#endif
-#include <sys/types.h>
-#include <assert.h>
-#include <string.h>
-
-#ifdef _LIBC
-# ifdef __weak_alias
-__weak_alias(strlcat, _strlcat)
-# endif
-#endif
-
-#else
-#include <lib/libkern/libkern.h>
-#endif /* !_KERNEL && !_STANDALONE */
-
-#if !HAVE_STRLCAT
-/*
- * Appends src to string dst of size siz (unlike strncat, siz is the
- * full size of dst, not space left).  At most siz-1 characters
- * will be copied.  Always NUL terminates (unless siz <= strlen(dst)).
- * Returns strlen(src) + MIN(siz, strlen(initial dst)).
- * If retval >= siz, truncation occurred.
- */
-size_t
-strlcat(char *dst, const char *src, size_t siz)
-{
-	char *d = dst;
-	const char *s = src;
-	size_t n = siz;
-	size_t dlen;
-
-	_DIAGASSERT(dst != NULL);
-	_DIAGASSERT(src != NULL);
-
-	/* Find the end of dst and adjust bytes left but don't go past end */
-	while (n-- != 0 && *d != '\0')
-		d++;
-	dlen = d - dst;
-	n = siz - dlen;
-
-	if (n == 0)
-		return(dlen + strlen(s));
-	while (*s != '\0') {
-		if (n != 1) {
-			*d++ = *s;
-			n--;
-		}
-		s++;
-	}
-	*d = '\0';
-
-	return(dlen + (s - src));	/* count does not include NUL */
-}
-#endif
diff --git a/glibc-compat/strlcpy.c b/glibc-compat/strlcpy.c
deleted file mode 100644
index fbb5f4d..0000000
--- a/glibc-compat/strlcpy.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*	$NetBSD: strlcpy.c,v 1.3 2007/06/04 18:19:27 christos Exp $	*/
-/*	$OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp $	*/
-
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
- * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#if !defined(_KERNEL) && !defined(_STANDALONE)
-#if HAVE_NBTOOL_CONFIG_H
-#include "nbtool_config.h"
-#endif
-
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strlcpy.c,v 1.3 2007/06/04 18:19:27 christos Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#ifdef _LIBC
-#include "namespace.h"
-#endif
-#include <sys/types.h>
-#include <assert.h>
-#include <string.h>
-
-#ifdef _LIBC
-# ifdef __weak_alias
-__weak_alias(strlcpy, _strlcpy)
-# endif
-#endif
-#else
-#include <lib/libkern/libkern.h>
-#endif /* !_KERNEL && !_STANDALONE */
-
-
-#if !HAVE_STRLCPY
-/*
- * Copy src to string dst of size siz.  At most siz-1 characters
- * will be copied.  Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
- */
-size_t
-strlcpy(char *dst, const char *src, size_t siz)
-{
-	char *d = dst;
-	const char *s = src;
-	size_t n = siz;
-
-	_DIAGASSERT(dst != NULL);
-	_DIAGASSERT(src != NULL);
-
-	/* Copy as many bytes as will fit */
-	if (n != 0 && --n != 0) {
-		do {
-			if ((*d++ = *s++) == 0)
-				break;
-		} while (--n != 0);
-	}
-
-	/* Not enough room in dst, add NUL and traverse rest of src */
-	if (n == 0) {
-		if (siz != 0)
-			*d = '\0';		/* NUL-terminate dst */
-		while (*s++)
-			;
-	}
-
-	return(s - src - 1);	/* count does not include NUL */
-}
-#endif
diff --git a/glibc-compat/unvis.c b/glibc-compat/unvis.c
deleted file mode 100644
index 95f523b..0000000
--- a/glibc-compat/unvis.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*	$NetBSD: unvis.c,v 1.28 2005/09/13 01:44:09 christos Exp $	*/
-
-/*-
- * Copyright (c) 1989, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)unvis.c	8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: unvis.c,v 1.28 2005/09/13 01:44:09 christos Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
-#include <sys/types.h>
-
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <vis.h>
-
-#ifdef __weak_alias
-__weak_alias(strunvis,_strunvis)
-#endif
-
-#if !HAVE_VIS
-/*
- * decode driven by state machine
- */
-#define	S_GROUND	0	/* haven't seen escape char */
-#define	S_START		1	/* start decoding special sequence */
-#define	S_META		2	/* metachar started (M) */
-#define	S_META1		3	/* metachar more, regular char (-) */
-#define	S_CTRL		4	/* control char started (^) */
-#define	S_OCTAL2	5	/* octal digit 2 */
-#define	S_OCTAL3	6	/* octal digit 3 */
-#define	S_HEX1		7	/* hex digit */
-#define	S_HEX2		8	/* hex digit 2 */
-
-#define	isoctal(c)	(((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
-#define xtod(c)		(isdigit(c) ? (c - '0') : ((tolower(c) - 'a') + 10))
-
-/*
- * unvis - decode characters previously encoded by vis
- */
-int
-unvis(cp, c, astate, flag)
-	char *cp;
-	int c;
-	int *astate, flag;
-{
-	unsigned char uc = (unsigned char)c;
-
-	_DIAGASSERT(cp != NULL);
-	_DIAGASSERT(astate != NULL);
-
-	if (flag & UNVIS_END) {
-		if (*astate == S_OCTAL2 || *astate == S_OCTAL3
-		    || *astate == S_HEX2) {
-			*astate = S_GROUND;
-			return (UNVIS_VALID);
-		}
-		return (*astate == S_GROUND ? UNVIS_NOCHAR : UNVIS_SYNBAD);
-	}
-
-	switch (*astate) {
-
-	case S_GROUND:
-		*cp = 0;
-		if (c == '\\') {
-			*astate = S_START;
-			return (0);
-		}
-		if ((flag & VIS_HTTPSTYLE) && c == '%') {
-			*astate = S_HEX1;
-			return (0);
-		}
-		*cp = c;
-		return (UNVIS_VALID);
-
-	case S_START:
-		switch(c) {
-		case '\\':
-			*cp = c;
-			*astate = S_GROUND;
-			return (UNVIS_VALID);
-		case '0': case '1': case '2': case '3':
-		case '4': case '5': case '6': case '7':
-			*cp = (c - '0');
-			*astate = S_OCTAL2;
-			return (0);
-		case 'M':
-			*cp = (char)0200;
-			*astate = S_META;
-			return (0);
-		case '^':
-			*astate = S_CTRL;
-			return (0);
-		case 'n':
-			*cp = '\n';
-			*astate = S_GROUND;
-			return (UNVIS_VALID);
-		case 'r':
-			*cp = '\r';
-			*astate = S_GROUND;
-			return (UNVIS_VALID);
-		case 'b':
-			*cp = '\b';
-			*astate = S_GROUND;
-			return (UNVIS_VALID);
-		case 'a':
-			*cp = '\007';
-			*astate = S_GROUND;
-			return (UNVIS_VALID);
-		case 'v':
-			*cp = '\v';
-			*astate = S_GROUND;
-			return (UNVIS_VALID);
-		case 't':
-			*cp = '\t';
-			*astate = S_GROUND;
-			return (UNVIS_VALID);
-		case 'f':
-			*cp = '\f';
-			*astate = S_GROUND;
-			return (UNVIS_VALID);
-		case 's':
-			*cp = ' ';
-			*astate = S_GROUND;
-			return (UNVIS_VALID);
-		case 'E':
-			*cp = '\033';
-			*astate = S_GROUND;
-			return (UNVIS_VALID);
-		case '\n':
-			/*
-			 * hidden newline
-			 */
-			*astate = S_GROUND;
-			return (UNVIS_NOCHAR);
-		case '$':
-			/*
-			 * hidden marker
-			 */
-			*astate = S_GROUND;
-			return (UNVIS_NOCHAR);
-		}
-		*astate = S_GROUND;
-		return (UNVIS_SYNBAD);
-
-	case S_META:
-		if (c == '-')
-			*astate = S_META1;
-		else if (c == '^')
-			*astate = S_CTRL;
-		else {
-			*astate = S_GROUND;
-			return (UNVIS_SYNBAD);
-		}
-		return (0);
-
-	case S_META1:
-		*astate = S_GROUND;
-		*cp |= c;
-		return (UNVIS_VALID);
-
-	case S_CTRL:
-		if (c == '?')
-			*cp |= 0177;
-		else
-			*cp |= c & 037;
-		*astate = S_GROUND;
-		return (UNVIS_VALID);
-
-	case S_OCTAL2:	/* second possible octal digit */
-		if (isoctal(uc)) {
-			/*
-			 * yes - and maybe a third
-			 */
-			*cp = (*cp << 3) + (c - '0');
-			*astate = S_OCTAL3;
-			return (0);
-		}
-		/*
-		 * no - done with current sequence, push back passed char
-		 */
-		*astate = S_GROUND;
-		return (UNVIS_VALIDPUSH);
-
-	case S_OCTAL3:	/* third possible octal digit */
-		*astate = S_GROUND;
-		if (isoctal(uc)) {
-			*cp = (*cp << 3) + (c - '0');
-			return (UNVIS_VALID);
-		}
-		/*
-		 * we were done, push back passed char
-		 */
-		return (UNVIS_VALIDPUSH);
-
-	case S_HEX1:
-		if (isxdigit(uc)) {
-			*cp = xtod(uc);
-			*astate = S_HEX2;
-			return (0);
-		}
-		/*
-		 * no - done with current sequence, push back passed char
-		 */
-		*astate = S_GROUND;
-		return (UNVIS_VALIDPUSH);
-
-	case S_HEX2:
-		*astate = S_GROUND;
-		if (isxdigit(uc)) {
-			*cp = xtod(uc) | (*cp << 4);
-			return (UNVIS_VALID);
-		}
-		return (UNVIS_VALIDPUSH);
-
-	default:
-		/*
-		 * decoder in unknown state - (probably uninitialized)
-		 */
-		*astate = S_GROUND;
-		return (UNVIS_SYNBAD);
-	}
-}
-
-/*
- * strunvis - decode src into dst
- *
- *	Number of chars decoded into dst is returned, -1 on error.
- *	Dst is null terminated.
- */
-
-int
-strunvisx(dst, src, flag)
-	char *dst;
-	const char *src;
-	int flag;
-{
-	char c;
-	char *start = dst;
-	int state = 0;
-
-	_DIAGASSERT(src != NULL);
-	_DIAGASSERT(dst != NULL);
-
-	while ((c = *src++) != '\0') {
- again:
-		switch (unvis(dst, c, &state, flag)) {
-		case UNVIS_VALID:
-			dst++;
-			break;
-		case UNVIS_VALIDPUSH:
-			dst++;
-			goto again;
-		case 0:
-		case UNVIS_NOCHAR:
-			break;
-		default:
-			return (-1);
-		}
-	}
-	if (unvis(dst, c, &state, UNVIS_END) == UNVIS_VALID)
-		dst++;
-	*dst = '\0';
-	return (dst - start);
-}
-
-int
-strunvis(dst, src)
-	char *dst;
-	const char *src;
-{
-	return strunvisx(dst, src, 0);
-}
-#endif
diff --git a/glibc-compat/vis.c b/glibc-compat/vis.c
deleted file mode 100644
index 9be97ef..0000000
--- a/glibc-compat/vis.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/*	$NetBSD: vis.c,v 1.36 2008/04/29 06:53:01 martin Exp $	*/
-
-/*-
- * Copyright (c) 1989, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*-
- * Copyright (c) 1999, 2005 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: vis.c,v 1.36 2008/04/29 06:53:01 martin Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
-#include <sys/types.h>
-
-#include <assert.h>
-#include <vis.h>
-#include <stdlib.h>
-
-#ifdef __weak_alias
-__weak_alias(strsvis,_strsvis)
-__weak_alias(strsvisx,_strsvisx)
-__weak_alias(strvis,_strvis)
-__weak_alias(strvisx,_strvisx)
-__weak_alias(svis,_svis)
-__weak_alias(vis,_vis)
-#endif
-
-#if !HAVE_VIS || !HAVE_SVIS
-#include <ctype.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-
-#undef BELL
-#define BELL '\a'
-
-#define isoctal(c)	(((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
-#define iswhite(c)	(c == ' ' || c == '\t' || c == '\n')
-#define issafe(c)	(c == '\b' || c == BELL || c == '\r')
-#define xtoa(c)		"0123456789abcdef"[c]
-
-#define MAXEXTRAS	5
-
-
-#define MAKEEXTRALIST(flag, extra, orig_str)				      \
-do {									      \
-	const char *orig = orig_str;					      \
-	const char *o = orig;						      \
-	char *e;							      \
-	while (*o++)							      \
-		continue;						      \
-	extra = malloc((size_t)((o - orig) + MAXEXTRAS));		      \
-	if (!extra) break;						      \
-	for (o = orig, e = extra; (*e++ = *o++) != '\0';)		      \
-		continue;						      \
-	e--;								      \
-	if (flag & VIS_SP) *e++ = ' ';					      \
-	if (flag & VIS_TAB) *e++ = '\t';				      \
-	if (flag & VIS_NL) *e++ = '\n';					      \
-	if ((flag & VIS_NOSLASH) == 0) *e++ = '\\';			      \
-	*e = '\0';							      \
-} while (/*CONSTCOND*/0)
-
-
-/*
- * This is HVIS, the macro of vis used to HTTP style (RFC 1808)
- */
-#define HVIS(dst, c, flag, nextc, extra)				      \
-do									      \
-	if (!isascii(c) || !isalnum(c) || strchr("$-_.+!*'(),", c) != NULL) { \
-		*dst++ = '%';						      \
-		*dst++ = xtoa(((unsigned int)c >> 4) & 0xf);		      \
-		*dst++ = xtoa((unsigned int)c & 0xf);			      \
-	} else {							      \
-		SVIS(dst, c, flag, nextc, extra);			      \
-	}								      \
-while (/*CONSTCOND*/0)
-
-/*
- * This is SVIS, the central macro of vis.
- * dst:	      Pointer to the destination buffer
- * c:	      Character to encode
- * flag:      Flag word
- * nextc:     The character following 'c'
- * extra:     Pointer to the list of extra characters to be
- *	      backslash-protected.
- */
-#define SVIS(dst, c, flag, nextc, extra)				      \
-do {									      \
-	int isextra;							      \
-	isextra = strchr(extra, c) != NULL;				      \
-	if (!isextra && isascii(c) && (isgraph(c) || iswhite(c) ||	      \
-	    ((flag & VIS_SAFE) && issafe(c)))) {			      \
-		*dst++ = c;						      \
-		break;							      \
-	}								      \
-	if (flag & VIS_CSTYLE) {					      \
-		switch (c) {						      \
-		case '\n':						      \
-			*dst++ = '\\'; *dst++ = 'n';			      \
-			continue;					      \
-		case '\r':						      \
-			*dst++ = '\\'; *dst++ = 'r';			      \
-			continue;					      \
-		case '\b':						      \
-			*dst++ = '\\'; *dst++ = 'b';			      \
-			continue;					      \
-		case BELL:						      \
-			*dst++ = '\\'; *dst++ = 'a';			      \
-			continue;					      \
-		case '\v':						      \
-			*dst++ = '\\'; *dst++ = 'v';			      \
-			continue;					      \
-		case '\t':						      \
-			*dst++ = '\\'; *dst++ = 't';			      \
-			continue;					      \
-		case '\f':						      \
-			*dst++ = '\\'; *dst++ = 'f';			      \
-			continue;					      \
-		case ' ':						      \
-			*dst++ = '\\'; *dst++ = 's';			      \
-			continue;					      \
-		case '\0':						      \
-			*dst++ = '\\'; *dst++ = '0';			      \
-			if (isoctal(nextc)) {				      \
-				*dst++ = '0';				      \
-				*dst++ = '0';				      \
-			}						      \
-			continue;					      \
-		default:						      \
-			if (isgraph(c)) {				      \
-				*dst++ = '\\'; *dst++ = c;		      \
-				continue;				      \
-			}						      \
-		}							      \
-	}								      \
-	if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) {	      \
-		*dst++ = '\\';						      \
-		*dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + '0';    \
-		*dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + '0';    \
-		*dst++ =			     (c	      & 07) + '0';    \
-	} else {							      \
-		if ((flag & VIS_NOSLASH) == 0) *dst++ = '\\';		      \
-		if (c & 0200) {						      \
-			c &= 0177; *dst++ = 'M';			      \
-		}							      \
-		if (iscntrl(c)) {					      \
-			*dst++ = '^';					      \
-			if (c == 0177)					      \
-				*dst++ = '?';				      \
-			else						      \
-				*dst++ = c + '@';			      \
-		} else {						      \
-			*dst++ = '-'; *dst++ = c;			      \
-		}							      \
-	}								      \
-} while (/*CONSTCOND*/0)
-
-
-/*
- * svis - visually encode characters, also encoding the characters
- *	  pointed to by `extra'
- */
-char *
-svis(char *dst, int c, int flag, int nextc, const char *extra)
-{
-	char *nextra = NULL;
-
-	_DIAGASSERT(dst != NULL);
-	_DIAGASSERT(extra != NULL);
-	MAKEEXTRALIST(flag, nextra, extra);
-	if (!nextra) {
-		*dst = '\0';		/* can't create nextra, return "" */
-		return dst;
-	}
-	if (flag & VIS_HTTPSTYLE)
-		HVIS(dst, c, flag, nextc, nextra);
-	else
-		SVIS(dst, c, flag, nextc, nextra);
-	free(nextra);
-	*dst = '\0';
-	return dst;
-}
-
-
-/*
- * strsvis, strsvisx - visually encode characters from src into dst
- *
- *	Extra is a pointer to a \0-terminated list of characters to
- *	be encoded, too. These functions are useful e. g. to
- *	encode strings in such a way so that they are not interpreted
- *	by a shell.
- *
- *	Dst must be 4 times the size of src to account for possible
- *	expansion.  The length of dst, not including the trailing NULL,
- *	is returned.
- *
- *	Strsvisx encodes exactly len bytes from src into dst.
- *	This is useful for encoding a block of data.
- */
-int
-strsvis(char *dst, const char *csrc, int flag, const char *extra)
-{
-	int c;
-	char *start;
-	char *nextra = NULL;
-	const unsigned char *src = (const unsigned char *)csrc;
-
-	_DIAGASSERT(dst != NULL);
-	_DIAGASSERT(src != NULL);
-	_DIAGASSERT(extra != NULL);
-	MAKEEXTRALIST(flag, nextra, extra);
-	if (!nextra) {
-		*dst = '\0';		/* can't create nextra, return "" */
-		return 0;
-	}
-	if (flag & VIS_HTTPSTYLE) {
-		for (start = dst; (c = *src++) != '\0'; /* empty */)
-			HVIS(dst, c, flag, *src, nextra);
-	} else {
-		for (start = dst; (c = *src++) != '\0'; /* empty */)
-			SVIS(dst, c, flag, *src, nextra);
-	}
-	free(nextra);
-	*dst = '\0';
-	return (dst - start);
-}
-
-
-int
-strsvisx(char *dst, const char *csrc, size_t len, int flag, const char *extra)
-{
-	unsigned char c;
-	char *start;
-	char *nextra = NULL;
-	const unsigned char *src = (const unsigned char *)csrc;
-
-	_DIAGASSERT(dst != NULL);
-	_DIAGASSERT(src != NULL);
-	_DIAGASSERT(extra != NULL);
-	MAKEEXTRALIST(flag, nextra, extra);
-	if (! nextra) {
-		*dst = '\0';		/* can't create nextra, return "" */
-		return 0;
-	}
-
-	if (flag & VIS_HTTPSTYLE) {
-		for (start = dst; len > 0; len--) {
-			c = *src++;
-			HVIS(dst, c, flag, len ? *src : '\0', nextra);
-		}
-	} else {
-		for (start = dst; len > 0; len--) {
-			c = *src++;
-			SVIS(dst, c, flag, len ? *src : '\0', nextra);
-		}
-	}
-	free(nextra);
-	*dst = '\0';
-	return (dst - start);
-}
-#endif
-
-#if !HAVE_VIS
-/*
- * vis - visually encode characters
- */
-char *
-vis(char *dst, int c, int flag, int nextc)
-{
-	char *extra = NULL;
-	unsigned char uc = (unsigned char)c;
-
-	_DIAGASSERT(dst != NULL);
-
-	MAKEEXTRALIST(flag, extra, "");
-	if (! extra) {
-		*dst = '\0';		/* can't create extra, return "" */
-		return dst;
-	}
-	if (flag & VIS_HTTPSTYLE)
-		HVIS(dst, uc, flag, nextc, extra);
-	else
-		SVIS(dst, uc, flag, nextc, extra);
-	free(extra);
-	*dst = '\0';
-	return dst;
-}
-
-
-/*
- * strvis, strvisx - visually encode characters from src into dst
- *
- *	Dst must be 4 times the size of src to account for possible
- *	expansion.  The length of dst, not including the trailing NULL,
- *	is returned.
- *
- *	Strvisx encodes exactly len bytes from src into dst.
- *	This is useful for encoding a block of data.
- */
-int
-strvis(char *dst, const char *src, int flag)
-{
-	char *extra = NULL;
-	int rv;
-
-	MAKEEXTRALIST(flag, extra, "");
-	if (!extra) {
-		*dst = '\0';		/* can't create extra, return "" */
-		return 0;
-	}
-	rv = strsvis(dst, src, flag, extra);
-	free(extra);
-	return rv;
-}
-
-
-int
-strvisx(char *dst, const char *src, size_t len, int flag)
-{
-	char *extra = NULL;
-	int rv;
-
-	MAKEEXTRALIST(flag, extra, "");
-	if (!extra) {
-		*dst = '\0';		/* can't create extra, return "" */
-		return 0;
-	}
-	rv = strsvisx(dst, src, len, flag, extra);
-	free(extra);
-	return rv;
-}
-#endif
diff --git a/glibc-compat/vis.h b/glibc-compat/vis.h
deleted file mode 100644
index f3f2f60..0000000
--- a/glibc-compat/vis.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*	$NetBSD: vis.h,v 1.16 2005/09/13 01:44:32 christos Exp $	*/
-
-/*-
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)vis.h	8.1 (Berkeley) 6/2/93
- */
-
-#ifndef _VIS_H_
-#define	_VIS_H_
-
-#include <sys/types.h>
-
-/*
- * to select alternate encoding format
- */
-#define	VIS_OCTAL	0x01	/* use octal \ddd format */
-#define	VIS_CSTYLE	0x02	/* use \[nrft0..] where appropiate */
-
-/*
- * to alter set of characters encoded (default is to encode all
- * non-graphic except space, tab, and newline).
- */
-#define	VIS_SP		0x04	/* also encode space */
-#define	VIS_TAB		0x08	/* also encode tab */
-#define	VIS_NL		0x10	/* also encode newline */
-#define	VIS_WHITE	(VIS_SP | VIS_TAB | VIS_NL)
-#define	VIS_SAFE	0x20	/* only encode "unsafe" characters */
-
-/*
- * other
- */
-#define	VIS_NOSLASH	0x40	/* inhibit printing '\' */
-#define	VIS_HTTPSTYLE	0x80	/* http-style escape % HEX HEX */
-
-/*
- * unvis return codes
- */
-#define	UNVIS_VALID	 1	/* character valid */
-#define	UNVIS_VALIDPUSH	 2	/* character valid, push back passed char */
-#define	UNVIS_NOCHAR	 3	/* valid sequence, no character produced */
-#define	UNVIS_SYNBAD	-1	/* unrecognized escape sequence */
-#define	UNVIS_ERROR	-2	/* decoder in unknown state (unrecoverable) */
-
-/*
- * unvis flags
- */
-#define	UNVIS_END	1	/* no more characters */
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-char	*vis(char *, int, int, int);
-char	*svis(char *, int, int, int, const char *);
-int	strvis(char *, const char *, int);
-int	strsvis(char *, const char *, int, const char *);
-int	strvisx(char *, const char *, size_t, int);
-int	strsvisx(char *, const char *, size_t, int, const char *);
-int	strunvis(char *, const char *);
-int	strunvisx(char *, const char *, int);
-#ifndef __LIBC12_SOURCE__
-int	unvis(char *, int, int *, int) __RENAME(__unvis13);
-#endif
-__END_DECLS
-
-#endif /* !_VIS_H_ */
-- 
1.6.3.1

