From 0206674a310f199e0d02e2207a9ecb2d37dad34a Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 22 Mar 2014 21:02:48 +0100 Subject: fix libtirpc for musl --- package/libtirpc/Makefile | 4 +- package/libtirpc/patches/patch-src_auth_des_c | 18 + package/libtirpc/patches/patch-src_auth_none_c | 10 + package/libtirpc/patches/patch-src_auth_time_c | 18 +- package/libtirpc/patches/patch-src_auth_unix_c | 10 + package/libtirpc/patches/patch-src_authdes_prot_c | 7 + package/libtirpc/patches/patch-src_authunix_prot_c | 10 + package/libtirpc/patches/patch-src_bindresvport_c | 18 + package/libtirpc/patches/patch-src_clnt_bcast_c | 22 + package/libtirpc/patches/patch-src_clnt_perror_c | 10 + package/libtirpc/patches/patch-src_clnt_simple_c | 10 + package/libtirpc/patches/patch-src_crypt_client_c | 10 + package/libtirpc/patches/patch-src_des_crypt_c | 10 +- package/libtirpc/patches/patch-src_des_soft_c | 9 + package/libtirpc/patches/patch-src_getnetconfig_c | 10 + package/libtirpc/patches/patch-src_getnetpath_c | 16 + package/libtirpc/patches/patch-src_getpeereid_c | 10 + package/libtirpc/patches/patch-src_getpublickey_c | 10 + package/libtirpc/patches/patch-src_key_call_c | 10 + package/libtirpc/patches/patch-src_key_prot_xdr_c | 10 + package/libtirpc/patches/patch-src_mt_misc_c | 8 + package/libtirpc/patches/patch-src_pmap_clnt_c | 10 + package/libtirpc/patches/patch-src_pmap_getmaps_c | 10 + package/libtirpc/patches/patch-src_rpc_com_h | 31 ++ package/libtirpc/patches/patch-src_rpc_generic_c | 10 + package/libtirpc/patches/patch-src_rpcb_st_xdr_c | 10 + package/libtirpc/patches/patch-src_rpcdname_c | 10 + package/libtirpc/patches/patch-src_svc_dg_c | 10 + package/libtirpc/patches/patch-src_svc_simple_c | 10 + package/libtirpc/patches/patch-src_svc_vc_c | 10 + package/libtirpc/patches/patch-src_xdr_array_c | 10 + package/libtirpc/patches/patch-src_xdr_c | 10 + package/libtirpc/patches/patch-src_xdr_float_c | 10 + package/libtirpc/patches/patch-src_xdr_mem_c | 10 + package/libtirpc/patches/patch-src_xdr_rec_c | 11 + package/libtirpc/patches/patch-src_xdr_reference_c | 11 + package/libtirpc/patches/patch-src_xdr_sizeof_c | 10 + package/libtirpc/patches/patch-src_xdr_stdio_c | 10 + package/libtirpc/patches/patch-tirpc_misc_event_h | 24 + package/libtirpc/patches/patch-tirpc_netconfig_h | 23 + .../libtirpc/patches/patch-tirpc_rpc_auth_des_h | 32 ++ .../libtirpc/patches/patch-tirpc_rpc_auth_gss_h | 53 ++ package/libtirpc/patches/patch-tirpc_rpc_auth_h | 192 +++++++ .../libtirpc/patches/patch-tirpc_rpc_auth_unix_h | 26 + package/libtirpc/patches/patch-tirpc_rpc_clnt_h | 132 +++++ .../libtirpc/patches/patch-tirpc_rpc_clnt_soc_h | 78 +++ .../libtirpc/patches/patch-tirpc_rpc_des_crypt_h | 52 ++ package/libtirpc/patches/patch-tirpc_rpc_nettype_h | 20 + .../libtirpc/patches/patch-tirpc_rpc_pmap_clnt_h | 25 + .../libtirpc/patches/patch-tirpc_rpc_pmap_prot_h | 27 + .../libtirpc/patches/patch-tirpc_rpc_pmap_rmt_h | 26 + package/libtirpc/patches/patch-tirpc_rpc_rpc_com_h | 31 ++ package/libtirpc/patches/patch-tirpc_rpc_rpc_h | 44 ++ package/libtirpc/patches/patch-tirpc_rpc_rpc_msg_h | 23 + .../libtirpc/patches/patch-tirpc_rpc_rpcb_clnt_h | 23 + package/libtirpc/patches/patch-tirpc_rpc_rpcent_h | 31 ++ .../libtirpc/patches/patch-tirpc_rpc_svc_auth_h | 20 + package/libtirpc/patches/patch-tirpc_rpc_svc_h | 152 ++++++ package/libtirpc/patches/patch-tirpc_rpc_svc_soc_h | 102 ++++ package/libtirpc/patches/patch-tirpc_rpc_xdr_h | 53 ++ .../libtirpc/patches/patch-tirpc_rpcsvc_crypt_x | 12 + package/libtirpc/src/src/queue.h | 574 +++++++++++++++++++++ 62 files changed, 2197 insertions(+), 11 deletions(-) create mode 100644 package/libtirpc/patches/patch-src_auth_des_c create mode 100644 package/libtirpc/patches/patch-src_auth_none_c create mode 100644 package/libtirpc/patches/patch-src_auth_unix_c create mode 100644 package/libtirpc/patches/patch-src_authdes_prot_c create mode 100644 package/libtirpc/patches/patch-src_authunix_prot_c create mode 100644 package/libtirpc/patches/patch-src_bindresvport_c create mode 100644 package/libtirpc/patches/patch-src_clnt_bcast_c create mode 100644 package/libtirpc/patches/patch-src_clnt_perror_c create mode 100644 package/libtirpc/patches/patch-src_clnt_simple_c create mode 100644 package/libtirpc/patches/patch-src_crypt_client_c create mode 100644 package/libtirpc/patches/patch-src_des_soft_c create mode 100644 package/libtirpc/patches/patch-src_getnetconfig_c create mode 100644 package/libtirpc/patches/patch-src_getnetpath_c create mode 100644 package/libtirpc/patches/patch-src_getpeereid_c create mode 100644 package/libtirpc/patches/patch-src_getpublickey_c create mode 100644 package/libtirpc/patches/patch-src_key_call_c create mode 100644 package/libtirpc/patches/patch-src_key_prot_xdr_c create mode 100644 package/libtirpc/patches/patch-src_mt_misc_c create mode 100644 package/libtirpc/patches/patch-src_pmap_clnt_c create mode 100644 package/libtirpc/patches/patch-src_pmap_getmaps_c create mode 100644 package/libtirpc/patches/patch-src_rpc_com_h create mode 100644 package/libtirpc/patches/patch-src_rpc_generic_c create mode 100644 package/libtirpc/patches/patch-src_rpcb_st_xdr_c create mode 100644 package/libtirpc/patches/patch-src_rpcdname_c create mode 100644 package/libtirpc/patches/patch-src_svc_dg_c create mode 100644 package/libtirpc/patches/patch-src_svc_simple_c create mode 100644 package/libtirpc/patches/patch-src_svc_vc_c create mode 100644 package/libtirpc/patches/patch-src_xdr_array_c create mode 100644 package/libtirpc/patches/patch-src_xdr_c create mode 100644 package/libtirpc/patches/patch-src_xdr_float_c create mode 100644 package/libtirpc/patches/patch-src_xdr_mem_c create mode 100644 package/libtirpc/patches/patch-src_xdr_rec_c create mode 100644 package/libtirpc/patches/patch-src_xdr_reference_c create mode 100644 package/libtirpc/patches/patch-src_xdr_sizeof_c create mode 100644 package/libtirpc/patches/patch-src_xdr_stdio_c create mode 100644 package/libtirpc/patches/patch-tirpc_misc_event_h create mode 100644 package/libtirpc/patches/patch-tirpc_netconfig_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_auth_des_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_auth_gss_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_auth_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_auth_unix_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_clnt_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_clnt_soc_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_des_crypt_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_nettype_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_pmap_clnt_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_pmap_prot_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_pmap_rmt_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_rpc_com_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_rpc_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_rpc_msg_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_rpcb_clnt_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_rpcent_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_svc_auth_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_svc_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_svc_soc_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpc_xdr_h create mode 100644 package/libtirpc/patches/patch-tirpc_rpcsvc_crypt_x create mode 100644 package/libtirpc/src/src/queue.h (limited to 'package') diff --git a/package/libtirpc/Makefile b/package/libtirpc/Makefile index a1bfab5d1..61ae3a9b5 100644 --- a/package/libtirpc/Makefile +++ b/package/libtirpc/Makefile @@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk PKG_NAME:= libtirpc PKG_VERSION:= 0.2.3 -PKG_RELEASE:= 2 +PKG_RELEASE:= 3 PKG_MD5SUM:= b70e6c12a369a91e69fcc3b9feb23d61 PKG_DESCR:= a transport independent RPC library PKG_SECTION:= libs @@ -15,8 +15,6 @@ PKG_URL:= http://sourceforge.net/projects/libtirpc/ PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=libtirpc/} PKG_OPTS:= dev -PKG_LIBC_DEPENDS:= uclibc glibc - DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2 include ${TOPDIR}/mk/package.mk diff --git a/package/libtirpc/patches/patch-src_auth_des_c b/package/libtirpc/patches/patch-src_auth_des_c new file mode 100644 index 000000000..d91177fdc --- /dev/null +++ b/package/libtirpc/patches/patch-src_auth_des_c @@ -0,0 +1,18 @@ +--- libtirpc-0.2.3.orig/src/auth_des.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/auth_des.c 2014-03-22 13:20:52.000000000 +0100 +@@ -38,7 +38,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -52,7 +51,6 @@ + + #if defined(LIBC_SCCS) && !defined(lint) + #endif +-#include + + #define USEC_PER_SEC 1000000 + #define RTIME_TIMEOUT 5 /* seconds to wait for sync */ diff --git a/package/libtirpc/patches/patch-src_auth_none_c b/package/libtirpc/patches/patch-src_auth_none_c new file mode 100644 index 000000000..d8fd74f3d --- /dev/null +++ b/package/libtirpc/patches/patch-src_auth_none_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/auth_none.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/auth_none.c 2014-03-22 13:20:53.000000000 +0100 +@@ -31,7 +31,6 @@ + static char *sccsid = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro"; + static char *sccsid = "@(#)auth_none.c 2.1 88/07/29 4.0 RPCSRC"; + #endif +-#include + __FBSDID("$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.12 2002/03/22 23:18:35 obrien Exp $"); + */ + diff --git a/package/libtirpc/patches/patch-src_auth_time_c b/package/libtirpc/patches/patch-src_auth_time_c index 5ce7de419..b6319db96 100644 --- a/package/libtirpc/patches/patch-src_auth_time_c +++ b/package/libtirpc/patches/patch-src_auth_time_c @@ -1,6 +1,14 @@ ---- libtirpc-0.2.2.orig/src/auth_time.c 2011-05-02 14:10:40.000000000 +0200 -+++ libtirpc-0.2.2/src/auth_time.c 2012-03-22 19:02:30.422855534 +0100 -@@ -43,7 +43,7 @@ +--- libtirpc-0.2.3.orig/src/auth_time.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/auth_time.c 2014-03-22 13:20:53.000000000 +0100 +@@ -25,7 +25,6 @@ + * needed to deal with TCP connections. + */ + +-#include + #include + #include + #include +@@ -43,7 +42,7 @@ //#include #include #undef NIS @@ -9,7 +17,7 @@ #ifdef TESTING -@@ -138,6 +138,7 @@ free_eps(eps, num) +@@ -138,6 +137,7 @@ free_eps(eps, num) * NIS+ server will call __rpc_get_time_offset() with the nis_server * structure already populated. */ @@ -17,7 +25,7 @@ static nis_server * get_server(sin, host, srv, eps, maxep) struct sockaddr_in *sin; -@@ -491,3 +492,4 @@ error: +@@ -491,3 +491,4 @@ error: return (time_valid); } diff --git a/package/libtirpc/patches/patch-src_auth_unix_c b/package/libtirpc/patches/patch-src_auth_unix_c new file mode 100644 index 000000000..3d5fb990e --- /dev/null +++ b/package/libtirpc/patches/patch-src_auth_unix_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/auth_unix.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/auth_unix.c 2014-03-22 13:20:53.000000000 +0100 +@@ -26,7 +26,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include + + /* + * auth_unix.c, Implements UNIX style authentication parameters. diff --git a/package/libtirpc/patches/patch-src_authdes_prot_c b/package/libtirpc/patches/patch-src_authdes_prot_c new file mode 100644 index 000000000..f829ed45e --- /dev/null +++ b/package/libtirpc/patches/patch-src_authdes_prot_c @@ -0,0 +1,7 @@ +--- libtirpc-0.2.3.orig/src/authdes_prot.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/authdes_prot.c 2014-03-22 13:20:53.000000000 +0100 +@@ -1,4 +1,3 @@ +-#include + /* + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. diff --git a/package/libtirpc/patches/patch-src_authunix_prot_c b/package/libtirpc/patches/patch-src_authunix_prot_c new file mode 100644 index 000000000..178436474 --- /dev/null +++ b/package/libtirpc/patches/patch-src_authunix_prot_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/authunix_prot.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/authunix_prot.c 2014-03-22 13:20:53.000000000 +0100 +@@ -26,7 +26,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include + + /* + * authunix_prot.c diff --git a/package/libtirpc/patches/patch-src_bindresvport_c b/package/libtirpc/patches/patch-src_bindresvport_c new file mode 100644 index 000000000..4e828a005 --- /dev/null +++ b/package/libtirpc/patches/patch-src_bindresvport_c @@ -0,0 +1,18 @@ +--- libtirpc-0.2.3.orig/src/bindresvport.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/bindresvport.c 2014-03-22 13:24:36.000000000 +0100 +@@ -26,7 +26,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include + + /* + * Copyright (c) 1987 by Sun Microsystems, Inc. +@@ -38,6 +37,7 @@ + #include + + #include ++#include + + #include + #include diff --git a/package/libtirpc/patches/patch-src_clnt_bcast_c b/package/libtirpc/patches/patch-src_clnt_bcast_c new file mode 100644 index 000000000..e803b1721 --- /dev/null +++ b/package/libtirpc/patches/patch-src_clnt_bcast_c @@ -0,0 +1,22 @@ +--- libtirpc-0.2.3.orig/src/clnt_bcast.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/clnt_bcast.c 2014-03-22 14:19:29.000000000 +0100 +@@ -28,7 +28,6 @@ + /* + * Copyright (c) 1986-1991 by Sun Microsystems Inc. + */ +-#include + + /* + * clnt_bcast.c +@@ -41,10 +40,8 @@ + */ + #include + #include +-#include + +-/* new queue functions */ +-#include ++#include "queue.h" + + #include + #include diff --git a/package/libtirpc/patches/patch-src_clnt_perror_c b/package/libtirpc/patches/patch-src_clnt_perror_c new file mode 100644 index 000000000..5c3c9169a --- /dev/null +++ b/package/libtirpc/patches/patch-src_clnt_perror_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/clnt_perror.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/clnt_perror.c 2014-03-22 13:20:53.000000000 +0100 +@@ -27,7 +27,6 @@ + */ + + /* +-#include + */ + /* + * clnt_perror.c diff --git a/package/libtirpc/patches/patch-src_clnt_simple_c b/package/libtirpc/patches/patch-src_clnt_simple_c new file mode 100644 index 000000000..8db2f1b8e --- /dev/null +++ b/package/libtirpc/patches/patch-src_clnt_simple_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/clnt_simple.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/clnt_simple.c 2014-03-22 13:20:53.000000000 +0100 +@@ -29,7 +29,6 @@ + * Copyright (c) 1986-1991 by Sun Microsystems Inc. + */ + +-#include + + /* + * clnt_simple.c diff --git a/package/libtirpc/patches/patch-src_crypt_client_c b/package/libtirpc/patches/patch-src_crypt_client_c new file mode 100644 index 000000000..3768305f8 --- /dev/null +++ b/package/libtirpc/patches/patch-src_crypt_client_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/crypt_client.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/crypt_client.c 2014-03-22 13:20:53.000000000 +0100 +@@ -30,7 +30,6 @@ + * SUCH DAMAGE. + */ + +-#include + + #include + #include diff --git a/package/libtirpc/patches/patch-src_des_crypt_c b/package/libtirpc/patches/patch-src_des_crypt_c index 22c03d78b..c1c313dee 100644 --- a/package/libtirpc/patches/patch-src_des_crypt_c +++ b/package/libtirpc/patches/patch-src_des_crypt_c @@ -1,6 +1,10 @@ --- libtirpc-0.2.3.orig/src/des_crypt.c 2013-02-13 16:13:59.000000000 +0100 -+++ libtirpc-0.2.3/src/des_crypt.c 2013-08-12 16:47:07.000000000 +0200 -@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)des_crypt.c ++++ libtirpc-0.2.3/src/des_crypt.c 2014-03-22 13:20:53.000000000 +0100 +@@ -39,11 +39,10 @@ + static char sccsid[] = "@(#)des_crypt.c 2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02/08 SMI"; + #endif + #endif +-#include static int common_crypt( char *, char *, unsigned, unsigned, struct desparams * ); int (*__des_crypt_LOCAL)() = 0; @@ -9,7 +13,7 @@ /* * Copy 8 bytes */ -@@ -145,10 +145,6 @@ common_crypt(key, buf, len, mode, desp) +@@ -145,10 +144,6 @@ common_crypt(key, buf, len, mode, desp) if (!__des_crypt_LOCAL(buf, len, desp)) { return (DESERR_HWERROR); } diff --git a/package/libtirpc/patches/patch-src_des_soft_c b/package/libtirpc/patches/patch-src_des_soft_c new file mode 100644 index 000000000..675a6a265 --- /dev/null +++ b/package/libtirpc/patches/patch-src_des_soft_c @@ -0,0 +1,9 @@ +--- libtirpc-0.2.3.orig/src/des_soft.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/des_soft.c 2014-03-22 13:20:53.000000000 +0100 +@@ -1,5 +1,4 @@ +-//#include +- ++// + /* + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. diff --git a/package/libtirpc/patches/patch-src_getnetconfig_c b/package/libtirpc/patches/patch-src_getnetconfig_c new file mode 100644 index 000000000..fb1f285a1 --- /dev/null +++ b/package/libtirpc/patches/patch-src_getnetconfig_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/getnetconfig.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/getnetconfig.c 2014-03-22 13:20:53.000000000 +0100 +@@ -32,7 +32,6 @@ + + #include + #include +-#include + #include + #include + #include diff --git a/package/libtirpc/patches/patch-src_getnetpath_c b/package/libtirpc/patches/patch-src_getnetpath_c new file mode 100644 index 000000000..73788ea04 --- /dev/null +++ b/package/libtirpc/patches/patch-src_getnetpath_c @@ -0,0 +1,16 @@ +--- libtirpc-0.2.3.orig/src/getnetpath.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/getnetpath.c 2014-03-22 13:20:53.000000000 +0100 +@@ -25,13 +25,11 @@ + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +-#include + + /* + * Copyright (c) 1989 by Sun Microsystems, Inc. + */ + +-#include + #include + #include + #include diff --git a/package/libtirpc/patches/patch-src_getpeereid_c b/package/libtirpc/patches/patch-src_getpeereid_c new file mode 100644 index 000000000..1af375563 --- /dev/null +++ b/package/libtirpc/patches/patch-src_getpeereid_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/getpeereid.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/getpeereid.c 2014-03-22 13:20:52.000000000 +0100 +@@ -24,7 +24,6 @@ + * SUCH DAMAGE. + */ + +-#include + + #include + #include diff --git a/package/libtirpc/patches/patch-src_getpublickey_c b/package/libtirpc/patches/patch-src_getpublickey_c new file mode 100644 index 000000000..a41eca54a --- /dev/null +++ b/package/libtirpc/patches/patch-src_getpublickey_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/getpublickey.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/getpublickey.c 2014-03-22 13:20:53.000000000 +0100 +@@ -26,7 +26,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + /* +-#include + */ + + /* diff --git a/package/libtirpc/patches/patch-src_key_call_c b/package/libtirpc/patches/patch-src_key_call_c new file mode 100644 index 000000000..f7e7fb44d --- /dev/null +++ b/package/libtirpc/patches/patch-src_key_call_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/key_call.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/key_call.c 2014-03-22 13:20:52.000000000 +0100 +@@ -30,7 +30,6 @@ + */ + + +-#include + + /* + * key_call.c, Interface to keyserver diff --git a/package/libtirpc/patches/patch-src_key_prot_xdr_c b/package/libtirpc/patches/patch-src_key_prot_xdr_c new file mode 100644 index 000000000..5dcf3f0f8 --- /dev/null +++ b/package/libtirpc/patches/patch-src_key_prot_xdr_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/key_prot_xdr.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/key_prot_xdr.c 2014-03-22 13:20:53.000000000 +0100 +@@ -33,7 +33,6 @@ + */ + /* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */ + +-#include + + /* + * Compiled from key_prot.x using rpcgen. diff --git a/package/libtirpc/patches/patch-src_mt_misc_c b/package/libtirpc/patches/patch-src_mt_misc_c new file mode 100644 index 000000000..27e711159 --- /dev/null +++ b/package/libtirpc/patches/patch-src_mt_misc_c @@ -0,0 +1,8 @@ +--- libtirpc-0.2.3.orig/src/mt_misc.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/mt_misc.c 2014-03-22 13:20:53.000000000 +0100 +@@ -1,5 +1,4 @@ + +-#include + #include + #include + #include diff --git a/package/libtirpc/patches/patch-src_pmap_clnt_c b/package/libtirpc/patches/patch-src_pmap_clnt_c new file mode 100644 index 000000000..30b5deb86 --- /dev/null +++ b/package/libtirpc/patches/patch-src_pmap_clnt_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/pmap_clnt.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/pmap_clnt.c 2014-03-22 13:20:53.000000000 +0100 +@@ -26,7 +26,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include + + /* + * pmap_clnt.c diff --git a/package/libtirpc/patches/patch-src_pmap_getmaps_c b/package/libtirpc/patches/patch-src_pmap_getmaps_c new file mode 100644 index 000000000..1d9c984be --- /dev/null +++ b/package/libtirpc/patches/patch-src_pmap_getmaps_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/pmap_getmaps.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/pmap_getmaps.c 2014-03-22 13:20:53.000000000 +0100 +@@ -26,7 +26,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include + + /* + * pmap_getmap.c diff --git a/package/libtirpc/patches/patch-src_rpc_com_h b/package/libtirpc/patches/patch-src_rpc_com_h new file mode 100644 index 000000000..c327a0152 --- /dev/null +++ b/package/libtirpc/patches/patch-src_rpc_com_h @@ -0,0 +1,31 @@ +--- libtirpc-0.2.3.orig/src/rpc_com.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/rpc_com.h 2014-03-22 13:20:53.000000000 +0100 +@@ -40,7 +40,6 @@ + #ifndef _TIRPC_RPCCOM_H + #define _TIRPC_RPCCOM_H + +-#include + + /* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */ + +@@ -54,7 +53,9 @@ + #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \ + (u_int32_t)(now)->tv_usec) + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern u_int __rpc_get_a_size(int); + extern int __rpc_dtbsize(void); + extern struct netconfig * __rpcgettp(int); +@@ -90,6 +91,8 @@ void __xprt_set_raddr(SVCXPRT *, const s + SVCXPRT **__svc_xports; + int __svc_maxrec; + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* _TIRPC_RPCCOM_H */ diff --git a/package/libtirpc/patches/patch-src_rpc_generic_c b/package/libtirpc/patches/patch-src_rpc_generic_c new file mode 100644 index 000000000..aa567ce27 --- /dev/null +++ b/package/libtirpc/patches/patch-src_rpc_generic_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/rpc_generic.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/rpc_generic.c 2014-03-22 13:20:53.000000000 +0100 +@@ -29,7 +29,6 @@ + * Copyright (c) 1986-1991 by Sun Microsystems Inc. + */ + +-#include + + /* + * rpc_generic.c, Miscl routines for RPC. diff --git a/package/libtirpc/patches/patch-src_rpcb_st_xdr_c b/package/libtirpc/patches/patch-src_rpcb_st_xdr_c new file mode 100644 index 000000000..30eeeee9d --- /dev/null +++ b/package/libtirpc/patches/patch-src_rpcb_st_xdr_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/rpcb_st_xdr.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/rpcb_st_xdr.c 2014-03-22 13:20:53.000000000 +0100 +@@ -35,7 +35,6 @@ + * routines used with the rpcbind stats facility. + */ + +-#include + + #include + diff --git a/package/libtirpc/patches/patch-src_rpcdname_c b/package/libtirpc/patches/patch-src_rpcdname_c new file mode 100644 index 000000000..b66b0a46f --- /dev/null +++ b/package/libtirpc/patches/patch-src_rpcdname_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/rpcdname.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/rpcdname.c 2014-03-22 13:20:53.000000000 +0100 +@@ -25,7 +25,6 @@ + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +-#include + + /* + * rpcdname.c diff --git a/package/libtirpc/patches/patch-src_svc_dg_c b/package/libtirpc/patches/patch-src_svc_dg_c new file mode 100644 index 000000000..88622d951 --- /dev/null +++ b/package/libtirpc/patches/patch-src_svc_dg_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/svc_dg.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/svc_dg.c 2014-03-22 13:20:52.000000000 +0100 +@@ -31,7 +31,6 @@ + * Copyright (c) 1986-1991 by Sun Microsystems Inc. + */ + +-#include + + /* + * svc_dg.c, Server side for connectionless RPC. diff --git a/package/libtirpc/patches/patch-src_svc_simple_c b/package/libtirpc/patches/patch-src_svc_simple_c new file mode 100644 index 000000000..ed994e4f5 --- /dev/null +++ b/package/libtirpc/patches/patch-src_svc_simple_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/svc_simple.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/svc_simple.c 2014-03-22 13:20:53.000000000 +0100 +@@ -29,7 +29,6 @@ + * Copyright (c) 1986-1991 by Sun Microsystems Inc. + */ + +-#include + + /* + * svc_simple.c diff --git a/package/libtirpc/patches/patch-src_svc_vc_c b/package/libtirpc/patches/patch-src_svc_vc_c new file mode 100644 index 000000000..8e43f4b8d --- /dev/null +++ b/package/libtirpc/patches/patch-src_svc_vc_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/svc_vc.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/svc_vc.c 2014-03-22 13:20:53.000000000 +0100 +@@ -27,7 +27,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include + + /* + * svc_vc.c, Server side for Connection Oriented based RPC. diff --git a/package/libtirpc/patches/patch-src_xdr_array_c b/package/libtirpc/patches/patch-src_xdr_array_c new file mode 100644 index 000000000..dfa17d673 --- /dev/null +++ b/package/libtirpc/patches/patch-src_xdr_array_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/xdr_array.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/xdr_array.c 2014-03-22 13:20:53.000000000 +0100 +@@ -27,7 +27,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include + + /* + * xdr_array.c, Generic XDR routines impelmentation. diff --git a/package/libtirpc/patches/patch-src_xdr_c b/package/libtirpc/patches/patch-src_xdr_c new file mode 100644 index 000000000..22211757b --- /dev/null +++ b/package/libtirpc/patches/patch-src_xdr_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/xdr.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/xdr.c 2014-03-22 13:20:53.000000000 +0100 +@@ -26,7 +26,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include + + /* + * xdr.c, Generic XDR routines implementation. diff --git a/package/libtirpc/patches/patch-src_xdr_float_c b/package/libtirpc/patches/patch-src_xdr_float_c new file mode 100644 index 000000000..db18981e1 --- /dev/null +++ b/package/libtirpc/patches/patch-src_xdr_float_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/xdr_float.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/xdr_float.c 2014-03-22 13:20:53.000000000 +0100 +@@ -27,7 +27,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include + + /* + * xdr_float.c, Generic XDR routines implementation. diff --git a/package/libtirpc/patches/patch-src_xdr_mem_c b/package/libtirpc/patches/patch-src_xdr_mem_c new file mode 100644 index 000000000..670bba01e --- /dev/null +++ b/package/libtirpc/patches/patch-src_xdr_mem_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/xdr_mem.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/xdr_mem.c 2014-03-22 13:20:53.000000000 +0100 +@@ -26,7 +26,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include + + /* + * xdr_mem.h, XDR implementation using memory buffers. diff --git a/package/libtirpc/patches/patch-src_xdr_rec_c b/package/libtirpc/patches/patch-src_xdr_rec_c new file mode 100644 index 000000000..f4a2672d3 --- /dev/null +++ b/package/libtirpc/patches/patch-src_xdr_rec_c @@ -0,0 +1,11 @@ +--- libtirpc-0.2.3.orig/src/xdr_rec.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/xdr_rec.c 2014-03-22 13:20:53.000000000 +0100 +@@ -27,8 +27,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include +-#include + + /* + * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking" diff --git a/package/libtirpc/patches/patch-src_xdr_reference_c b/package/libtirpc/patches/patch-src_xdr_reference_c new file mode 100644 index 000000000..a0b284380 --- /dev/null +++ b/package/libtirpc/patches/patch-src_xdr_reference_c @@ -0,0 +1,11 @@ +--- libtirpc-0.2.3.orig/src/xdr_reference.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/xdr_reference.c 2014-03-22 13:20:53.000000000 +0100 +@@ -26,8 +26,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include +-#include + + /* + * xdr_reference.c, Generic XDR routines impelmentation. diff --git a/package/libtirpc/patches/patch-src_xdr_sizeof_c b/package/libtirpc/patches/patch-src_xdr_sizeof_c new file mode 100644 index 000000000..0246ffa7d --- /dev/null +++ b/package/libtirpc/patches/patch-src_xdr_sizeof_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/xdr_sizeof.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/xdr_sizeof.c 2014-03-22 13:20:53.000000000 +0100 +@@ -34,7 +34,6 @@ + * when serialized using XDR. + */ + +-#include + + #include "namespace.h" + #include diff --git a/package/libtirpc/patches/patch-src_xdr_stdio_c b/package/libtirpc/patches/patch-src_xdr_stdio_c new file mode 100644 index 000000000..90dabf120 --- /dev/null +++ b/package/libtirpc/patches/patch-src_xdr_stdio_c @@ -0,0 +1,10 @@ +--- libtirpc-0.2.3.orig/src/xdr_stdio.c 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/src/xdr_stdio.c 2014-03-22 13:20:53.000000000 +0100 +@@ -26,7 +26,6 @@ + * POSSIBILITY OF SUCH DAMAGE. + */ + +-#include + + /* + * xdr_stdio.c, XDR implementation on standard i/o file. diff --git a/package/libtirpc/patches/patch-tirpc_misc_event_h b/package/libtirpc/patches/patch-tirpc_misc_event_h new file mode 100644 index 000000000..7fc07813f --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_misc_event_h @@ -0,0 +1,24 @@ +--- libtirpc-0.2.3.orig/tirpc/misc/event.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/misc/event.h 2014-03-22 13:20:52.000000000 +0100 +@@ -186,15 +186,18 @@ extern int kqueue_del_filteropts(int fil + + #else /* !_KERNEL */ + +-#include + struct timespec; + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int kqueue(void); + int kevent(int kq, const struct kevent *changelist, int nchanges, + struct kevent *eventlist, int nevents, + const struct timespec *timeout); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_KERNEL */ + diff --git a/package/libtirpc/patches/patch-tirpc_netconfig_h b/package/libtirpc/patches/patch-tirpc_netconfig_h new file mode 100644 index 000000000..2f17d5fd4 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_netconfig_h @@ -0,0 +1,23 @@ +--- libtirpc-0.2.3.orig/tirpc/netconfig.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/netconfig.h 2014-03-22 13:20:52.000000000 +0100 +@@ -74,7 +74,9 @@ typedef struct { + #define NC_UDP "udp" + #define NC_ICMP "icmp" + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + + extern void *setnetconfig (void); + extern struct netconfig *getnetconfig (void *); +@@ -89,6 +91,8 @@ extern int endnetpath (void *); + extern void nc_perror (const char *); + extern char *nc_sperror (void); + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* _NETCONFIG_H_ */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_auth_des_h b/package/libtirpc/patches/patch-tirpc_rpc_auth_des_h new file mode 100644 index 000000000..c072f8871 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_auth_des_h @@ -0,0 +1,32 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/auth_des.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/auth_des.h 2014-03-22 13:20:52.000000000 +0100 +@@ -114,17 +114,25 @@ struct authdes_verf { + * Map a des credential into a unix cred. + * + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern int authdes_getucred( struct authdes_cred *, uid_t *, gid_t *, int *, gid_t * ); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern bool_t xdr_authdes_cred(XDR *, struct authdes_cred *); + extern bool_t xdr_authdes_verf(XDR *, struct authdes_verf *); + extern int rtime(dev_t, struct netbuf *, int, struct timeval *, + struct timeval *); + extern void kgetnetname(char *); + extern enum auth_stat _svcauth_des(struct svc_req *, struct rpc_msg *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* ndef _TI_AUTH_DES_ */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_auth_gss_h b/package/libtirpc/patches/patch-tirpc_rpc_auth_gss_h new file mode 100644 index 000000000..2d1a07987 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_auth_gss_h @@ -0,0 +1,53 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/auth_gss.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/auth_gss.h 2014-03-22 13:20:52.000000000 +0100 +@@ -104,28 +104,32 @@ struct rpc_gss_init_res { + #define MAXSEQ 0x80000000 + + /* Prototypes. */ +-__BEGIN_DECLS +-bool_t xdr_rpc_gss_cred __P((XDR *xdrs, struct rpc_gss_cred *p)); +-bool_t xdr_rpc_gss_init_args __P((XDR *xdrs, gss_buffer_desc *p)); +-bool_t xdr_rpc_gss_init_res __P((XDR *xdrs, struct rpc_gss_init_res *p)); +-bool_t xdr_rpc_gss_data __P((XDR *xdrs, xdrproc_t xdr_func, ++#ifdef __cplusplus ++extern "C" { ++#endif ++bool_t xdr_rpc_gss_cred (XDR *xdrs, struct rpc_gss_cred *p); ++bool_t xdr_rpc_gss_init_args (XDR *xdrs, gss_buffer_desc *p); ++bool_t xdr_rpc_gss_init_res (XDR *xdrs, struct rpc_gss_init_res *p); ++bool_t xdr_rpc_gss_data (XDR *xdrs, xdrproc_t xdr_func, + caddr_t xdr_ptr, gss_ctx_id_t ctx, + gss_qop_t qop, rpc_gss_svc_t svc, +- u_int seq)); ++ u_int seq); + +-AUTH *authgss_create __P((CLIENT *, gss_name_t, +- struct rpc_gss_sec *)); +-AUTH *authgss_create_default __P((CLIENT *, char *, struct rpc_gss_sec *)); +-bool_t authgss_service __P((AUTH *auth, int svc)); +-bool_t authgss_get_private_data __P((AUTH *auth, +- struct authgss_private_data *)); +-bool_t authgss_free_private_data __P((struct authgss_private_data *)); ++AUTH *authgss_create (CLIENT *, gss_name_t, ++ struct rpc_gss_sec *); ++AUTH *authgss_create_default (CLIENT *, char *, struct rpc_gss_sec *); ++bool_t authgss_service (AUTH *auth, int svc); ++bool_t authgss_get_private_data (AUTH *auth, ++ struct authgss_private_data *); ++bool_t authgss_free_private_data (struct authgss_private_data *); + +-void gss_log_debug __P((const char *fmt, ...)); +-void gss_log_status __P((char *m, OM_uint32 major, +- OM_uint32 minor)); +-void gss_log_hexdump __P((const u_char *buf, int len, int offset)); ++void gss_log_debug (const char *fmt, ...); ++void gss_log_status (char *m, OM_uint32 major, ++ OM_uint32 minor); ++void gss_log_hexdump (const u_char *buf, int len, int offset); + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_TIRPC_AUTH_GSS_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_auth_h b/package/libtirpc/patches/patch-tirpc_rpc_auth_h new file mode 100644 index 000000000..b000f85f7 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_auth_h @@ -0,0 +1,192 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/auth.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/auth.h 2014-03-22 13:20:52.000000000 +0100 +@@ -48,7 +48,6 @@ + + #include + #include +-#include + #include + #include + #include +@@ -165,9 +164,13 @@ union des_block { + char c[8]; + }; + typedef union des_block des_block; +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern bool_t xdr_des_block(XDR *, des_block *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Authentication info. Opaque to client. +@@ -288,9 +291,13 @@ auth_put(AUTH *auth) + xfunc, xwhere)) + + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern struct opaque_auth _null_auth; +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Any style authentication. These routines can be used by any +@@ -311,11 +318,15 @@ int authany_wrap(void), authany_unwrap(v + * int len; + * int *aup_gids; + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern AUTH *authunix_create(char *, uid_t, uid_t, int, uid_t *); + extern AUTH *authunix_create_default(void); /* takes no parameters */ + extern AUTH *authnone_create(void); /* takes no parameters */ +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + /* + * DES style authentication + * AUTH *authsecdes_create(servername, window, timehost, ckey) +@@ -324,15 +335,23 @@ __END_DECLS + * const char *timehost; - optional hostname to sync with + * des_block *ckey; - optional conversation key to use + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *); + extern AUTH *authdes_seccreate (const char *, const u_int, const char *, + const des_block *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip)) + #define authsys_create_default() authunix_create_default() +@@ -340,36 +359,48 @@ __END_DECLS + /* + * Netname manipulation routines. + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern int getnetname(char *); + extern int host2netname(char *, const char *, const char *); + extern int user2netname(char *, const uid_t, const char *); + extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *); + extern int netname2host(char *, char *, const int); + extern void passwd2des ( char *, char * ); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * + * These routines interface to the keyserv daemon + * + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern int key_decryptsession(const char *, des_block *); + extern int key_encryptsession(const char *, des_block *); + extern int key_gendes(des_block *); + extern int key_setsecret(const char *); + extern int key_secretkey_is_set(void); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Publickey routines. + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern int getpublickey (const char *, char *); + extern int getpublicandprivatekey (char *, char *); + extern int getsecretkey (char *, char *, char *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #ifdef KERBEROS + /* +@@ -382,10 +413,14 @@ __END_DECLS + * const char *timehost; - optional hostname to sync with + * int *status; - kerberos status returned + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern AUTH *authkerb_seccreate(const char *, const char *, const char *, + const u_int, const char *, int *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Map a kerberos credential into a unix cred. +@@ -398,19 +433,27 @@ __END_DECLS + * int *groups; + * + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern int authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *, + short *, int * */); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + #endif /* KERBEROS */ + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + struct svc_req; + struct rpc_msg; + enum auth_stat _svcauth_none (struct svc_req *, struct rpc_msg *); + enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *); + enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #define AUTH_NONE 0 /* no authentication */ + #define AUTH_NULL 0 /* backward compatibility */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_auth_unix_h b/package/libtirpc/patches/patch-tirpc_rpc_auth_unix_h new file mode 100644 index 000000000..a0c70ece5 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_auth_unix_h @@ -0,0 +1,26 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/auth_unix.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/auth_unix.h 2014-03-22 13:20:52.000000000 +0100 +@@ -45,7 +45,6 @@ + + #ifndef _TIRPC_AUTH_UNIX_H + #define _TIRPC_AUTH_UNIX_H +-#include + + /* The machine name is part of a credential; it may not exceed 255 bytes */ + #define MAX_MACHINE_NAME 255 +@@ -67,9 +66,13 @@ struct authunix_parms { + + #define authsys_parms authunix_parms + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * If a response verifier has flavor AUTH_SHORT, diff --git a/package/libtirpc/patches/patch-tirpc_rpc_clnt_h b/package/libtirpc/patches/patch-tirpc_rpc_clnt_h new file mode 100644 index 000000000..ddd1f73ae --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_clnt_h @@ -0,0 +1,132 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/clnt.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/clnt.h 2014-03-22 13:20:52.000000000 +0100 +@@ -42,7 +42,6 @@ + #include + #include + +-#include + #include + #include + +@@ -267,7 +266,9 @@ struct rpc_timers { + * Generic client creation routine. Supported protocols are those that + * belong to the nettype namespace (/etc/netconfig). + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t, + const char *); + /* +@@ -414,32 +415,46 @@ extern CLIENT *clnt_dg_create(const int, + */ + extern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t); + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + + /* + * Print why creation failed + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern void clnt_pcreateerror(const char *); /* stderr */ + extern char *clnt_spcreateerror(const char *); /* string */ +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Like clnt_perror(), but is more verbose in its output + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern void clnt_perrno(enum clnt_stat); /* stderr */ + extern char *clnt_sperrno(enum clnt_stat); /* string */ +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Print an English error message, given the client error code + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern void clnt_perror(CLIENT *, const char *); /* stderr */ + extern char *clnt_sperror(CLIENT *, const char *); /* string */ +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + + /* +@@ -450,9 +465,13 @@ struct rpc_createerr { + struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */ + }; + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern struct rpc_createerr *__rpc_createerr(void); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + #define get_rpc_createerr() (*(__rpc_createerr())) + #define rpc_createerr (*(__rpc_createerr())) + +@@ -469,12 +488,16 @@ __END_DECLS + * char *out; + * const char *nettype; + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern enum clnt_stat rpc_call(const char *, const rpcprog_t, + const rpcvers_t, const rpcproc_t, + const xdrproc_t, const char *, + const xdrproc_t, char *, const char *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * RPC broadcast interface +@@ -522,7 +545,9 @@ __END_DECLS + + typedef bool_t (*resultproc_t)(caddr_t, ...); + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t, + const rpcproc_t, const xdrproc_t, + caddr_t, const xdrproc_t, caddr_t, +@@ -532,7 +557,9 @@ extern enum clnt_stat rpc_broadcast_exp( + caddr_t, const xdrproc_t, caddr_t, + const resultproc_t, const int, + const int, const char *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* For backward compatibility */ + #include diff --git a/package/libtirpc/patches/patch-tirpc_rpc_clnt_soc_h b/package/libtirpc/patches/patch-tirpc_rpc_clnt_soc_h new file mode 100644 index 000000000..3112aeee5 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_clnt_soc_h @@ -0,0 +1,78 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/clnt_soc.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/clnt_soc.h 2014-03-22 13:20:52.000000000 +0100 +@@ -46,7 +46,6 @@ + * with TS-RPC. + */ + +-#include + + #define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */ + +@@ -61,27 +60,39 @@ + * u_int sendsz; + * u_int recvsz; + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern CLIENT *clnttcp_create(struct sockaddr_in *, u_long, u_long, int *, + u_int, u_int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Raw (memory) rpc. + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern CLIENT *clntraw_create(u_long, u_long); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + + /* + IPv6 socket version + */ + #ifdef INET6 +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern CLIENT *clnttcp6_create(struct sockaddr_in6 *, u_long, u_long, int *, + u_int, u_int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + #endif + + /* +@@ -105,7 +116,9 @@ __END_DECLS + * u_int sendsz; + * u_int recvsz; + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern CLIENT *clntudp_create(struct sockaddr_in *, u_long, u_long, + struct timeval, int *); + extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, u_long, u_long, +@@ -116,7 +129,9 @@ extern CLIENT *clntudp6_create(struct so + extern CLIENT *clntudp6_bufcreate(struct sockaddr_in6 *, u_long, u_long, + struct timeval, int *, u_int, u_int); + #endif +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + + #endif /* _RPC_CLNT_SOC_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_des_crypt_h b/package/libtirpc/patches/patch-tirpc_rpc_des_crypt_h new file mode 100644 index 000000000..d55657f95 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_des_crypt_h @@ -0,0 +1,52 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/des_crypt.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/des_crypt.h 2014-03-22 13:20:52.000000000 +0100 +@@ -43,7 +43,6 @@ + #ifndef _DES_DES_CRYPT_H + #define _DES_DES_CRYPT_H + +-#include + #include + + #define DES_MAXDATA 8192 /* max bytes encrypted in one call */ +@@ -83,23 +82,35 @@ + /* + * Cipher Block Chaining mode + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int cbc_crypt( char *, char *, unsigned int, unsigned int, char *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Electronic Code Book mode + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int ecb_crypt( char *, char *, unsigned int, unsigned int ); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Set des parity for a key. + * DES parity is odd and in the low bit of each byte + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + void des_setparity( char *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* _DES_DES_CRYPT_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_nettype_h b/package/libtirpc/patches/patch-tirpc_rpc_nettype_h new file mode 100644 index 000000000..60759caad --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_nettype_h @@ -0,0 +1,20 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/nettype.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/nettype.h 2014-03-22 13:20:52.000000000 +0100 +@@ -53,11 +53,15 @@ + #define _RPC_TCP 7 + #define _RPC_UDP 8 + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern void *__rpc_setconf(const char *); + extern void __rpc_endconf(void *); + extern struct netconfig *__rpc_getconf(void *); + extern struct netconfig *__rpc_getconfip(const char *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_TIRPC_NETTYPE_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_pmap_clnt_h b/package/libtirpc/patches/patch-tirpc_rpc_pmap_clnt_h new file mode 100644 index 000000000..7fda59939 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_pmap_clnt_h @@ -0,0 +1,25 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/pmap_clnt.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/pmap_clnt.h 2014-03-22 13:20:52.000000000 +0100 +@@ -63,9 +63,10 @@ + + #ifndef _RPC_PMAP_CLNT_H_ + #define _RPC_PMAP_CLNT_H_ +-#include + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern bool_t pmap_set(u_long, u_long, int, int); + extern bool_t pmap_unset(u_long, u_long); + extern struct pmaplist *pmap_getmaps(struct sockaddr_in *); +@@ -80,6 +81,8 @@ extern enum clnt_stat clnt_broadcast(u_l + resultproc_t); + extern u_short pmap_getport(struct sockaddr_in *, + u_long, u_long, u_int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_RPC_PMAP_CLNT_H_ */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_pmap_prot_h b/package/libtirpc/patches/patch-tirpc_rpc_pmap_prot_h new file mode 100644 index 000000000..891991b98 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_pmap_prot_h @@ -0,0 +1,27 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/pmap_prot.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/pmap_prot.h 2014-03-22 13:20:52.000000000 +0100 +@@ -71,7 +71,6 @@ + + #ifndef _RPC_PMAP_PROT_H + #define _RPC_PMAP_PROT_H +-#include + + #define PMAPPORT ((u_short)111) + #define PMAPPROG ((u_long)100000) +@@ -97,10 +96,14 @@ struct pmaplist { + struct pmaplist *pml_next; + }; + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern bool_t xdr_pmap(XDR *, struct pmap *); + extern bool_t xdr_pmaplist(XDR *, struct pmaplist **); + extern bool_t xdr_pmaplist_ptr(XDR *, struct pmaplist *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_RPC_PMAP_PROT_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_pmap_rmt_h b/package/libtirpc/patches/patch-tirpc_rpc_pmap_rmt_h new file mode 100644 index 000000000..98a494105 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_pmap_rmt_h @@ -0,0 +1,26 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/pmap_rmt.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/pmap_rmt.h 2014-03-22 13:20:52.000000000 +0100 +@@ -41,7 +41,6 @@ + + #ifndef _RPC_PMAP_RMT_H + #define _RPC_PMAP_RMT_H +-#include + + struct rmtcallargs { + u_long prog, vers, proc, arglen; +@@ -56,9 +55,13 @@ struct rmtcallres { + xdrproc_t xdr_results; + }; + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern bool_t xdr_rmtcall_args(XDR *, struct rmtcallargs *); + extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_RPC_PMAP_RMT_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_rpc_com_h b/package/libtirpc/patches/patch-tirpc_rpc_rpc_com_h new file mode 100644 index 000000000..59f0283d3 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_rpc_com_h @@ -0,0 +1,31 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/rpc_com.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/rpc_com.h 2014-03-22 13:20:52.000000000 +0100 +@@ -41,7 +41,6 @@ + #ifndef _RPC_RPCCOM_H + #define _RPC_RPCCOM_H + +-#include + + /* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */ + +@@ -55,7 +54,9 @@ + #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \ + (u_int32_t)(now)->tv_usec) + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern u_int __rpc_get_a_size(int); + extern int __rpc_dtbsize(void); + extern int _rpc_dtablesize(void); +@@ -77,6 +78,8 @@ bool_t rpc_control(int,void *); + + char *_get_next_token(char *, int); + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* _RPC_RPCCOM_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_rpc_h b/package/libtirpc/patches/patch-tirpc_rpc_rpc_h new file mode 100644 index 000000000..7e1f000a2 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_rpc_h @@ -0,0 +1,44 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/rpc.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/rpc.h 2014-03-22 13:20:52.000000000 +0100 +@@ -79,9 +79,11 @@ + #define UDPMSGSIZE 8800 + #endif + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern int get_myaddress(struct sockaddr_in *); +-extern int bindresvport(int, struct sockaddr_in *) __THROW; ++extern int bindresvport(int, struct sockaddr_in *); + extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]), + xdrproc_t, xdrproc_t); + extern int callrpc(const char *, int, int, int, xdrproc_t, void *, +@@ -93,18 +95,24 @@ struct netbuf *uaddr2taddr(const struct + + struct sockaddr; + extern int bindresvport_sa(int, struct sockaddr *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * The following are not exported interfaces, they are for internal library + * and rpcbind use only. Do not use, they may change without notice. + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + int __rpc_nconf2fd(const struct netconfig *); + int __rpc_nconf2fd_flags(const struct netconfig *, int); + int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *); + int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *); + u_int __rpc_get_t_size(int, int, int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_RPC_RPC_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_rpc_msg_h b/package/libtirpc/patches/patch-tirpc_rpc_rpc_msg_h new file mode 100644 index 000000000..caee024d8 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_rpc_msg_h @@ -0,0 +1,23 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/rpc_msg.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/rpc_msg.h 2014-03-22 13:20:52.000000000 +0100 +@@ -161,7 +161,9 @@ struct rpc_msg { + #define acpted_rply ru.RM_rmb.ru.RP_ar + #define rjcted_rply ru.RM_rmb.ru.RP_dr + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + /* + * XDR routine to handle a rpc message. + * xdr_callmsg(xdrs, cmsg) +@@ -210,6 +212,8 @@ extern bool_t xdr_rejected_reply(XDR *, + * struct rpc_err *error; + */ + extern void _seterr_reply(struct rpc_msg *, struct rpc_err *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_TIRPC_RPC_MSG_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_rpcb_clnt_h b/package/libtirpc/patches/patch-tirpc_rpc_rpcb_clnt_h new file mode 100644 index 000000000..b0bc44ae6 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_rpcb_clnt_h @@ -0,0 +1,23 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/rpcb_clnt.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/rpcb_clnt.h 2014-03-22 13:20:52.000000000 +0100 +@@ -59,7 +59,9 @@ + + #include + #include +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t, + const struct netconfig *, const struct netbuf *); + extern bool_t rpcb_unset(const rpcprog_t, const rpcvers_t, +@@ -78,6 +80,8 @@ extern bool_t rpcb_getaddr(const rpcprog + extern bool_t rpcb_gettime(const char *, time_t *); + extern char *rpcb_taddr2uaddr(struct netconfig *, struct netbuf *); + extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_RPC_RPCB_CLNT_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_rpcent_h b/package/libtirpc/patches/patch-tirpc_rpc_rpcent_h new file mode 100644 index 000000000..badea8121 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_rpcent_h @@ -0,0 +1,31 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/rpcent.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/rpcent.h 2014-03-22 14:22:44.000000000 +0100 +@@ -44,10 +44,12 @@ + /* #pragma ident "@(#)rpcent.h 1.13 94/04/25 SMI" */ + /* @(#)rpcent.h 1.1 88/12/06 SMI */ + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + + /* These are defined in /usr/include/rpc/netdb.h */ +-#if 0 ++#if !defined(__GLIBC__) + struct rpcent { + char *r_name; /* name of server for this rpc program */ + char **r_aliases; /* alias list */ +@@ -60,8 +62,10 @@ extern struct rpcent *getrpcbynumber(int + extern struct rpcent *getrpcent(void); + #endif + +-extern void setrpcent(int) __THROW; +-extern void endrpcent(void) __THROW; +-__END_DECLS ++extern void setrpcent(int); ++extern void endrpcent(void); ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_RPC_CENT_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_svc_auth_h b/package/libtirpc/patches/patch-tirpc_rpc_svc_auth_h new file mode 100644 index 000000000..1abf29cde --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_svc_auth_h @@ -0,0 +1,20 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/svc_auth.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/svc_auth.h 2014-03-22 13:20:52.000000000 +0100 +@@ -65,11 +65,15 @@ typedef struct SVCAUTH { + /* + * Server side authenticator + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *); + extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *, + struct rpc_msg *)); + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_RPC_SVC_AUTH_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_svc_h b/package/libtirpc/patches/patch-tirpc_rpc_svc_h new file mode 100644 index 000000000..fcaf5b172 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_svc_h @@ -0,0 +1,152 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/svc.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/svc.h 2014-03-22 13:20:52.000000000 +0100 +@@ -40,7 +40,6 @@ + + #ifndef _TIRPC_SVC_H + #define _TIRPC_SVC_H +-#include + + /* + * This interface must manage two items concerning remote procedure calling: +@@ -200,11 +199,15 @@ struct svc_req { + * const struct netconfig *nconf; + */ + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern bool_t svc_reg(SVCXPRT *, const rpcprog_t, const rpcvers_t, + void (*)(struct svc_req *, SVCXPRT *), + const struct netconfig *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Service un-registration +@@ -214,9 +217,13 @@ __END_DECLS + * const rpcvers_t vers; + */ + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern void svc_unreg(const rpcprog_t, const rpcvers_t); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Transport registration. +@@ -224,9 +231,13 @@ __END_DECLS + * xprt_register(xprt) + * SVCXPRT *xprt; + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern void xprt_register(SVCXPRT *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Transport un-register +@@ -234,9 +245,13 @@ __END_DECLS + * xprt_unregister(xprt) + * SVCXPRT *xprt; + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern void xprt_unregister(SVCXPRT *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + + /* +@@ -265,7 +280,9 @@ __END_DECLS + * deadlock the caller and server processes! + */ + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, void *); + extern void svcerr_decode(SVCXPRT *); + extern void svcerr_weakauth(SVCXPRT *); +@@ -277,7 +294,9 @@ extern void svcerr_systemerr(SVCXPRT *); + extern int rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t, + char *(*)(char *), xdrproc_t, xdrproc_t, + char *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Lowest level dispatching -OR- who owns this process anyway. +@@ -306,11 +325,17 @@ extern int svc_fds; + * a small program implemented by the svc_rpc implementation itself; + * also see clnt.h for protocol numbers. + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern void rpctest_service(void); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern void svc_getreq(int); + extern void svc_getreqset(fd_set *); + extern void svc_getreq_common(int); +@@ -319,7 +344,9 @@ extern void svc_getreq_poll(struct pollf + + extern void svc_run(void); + extern void svc_exit(void); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Socket to use on svcxxx_create call to get default socket +@@ -331,7 +358,9 @@ __END_DECLS + * These are the existing service side transport implementations + */ + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + /* + * Transport independent svc_create routine. + */ +@@ -427,7 +456,9 @@ int svc_dg_enablecache(SVCXPRT *, const + + int __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid); + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + + /* for backward compatibility */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_svc_soc_h b/package/libtirpc/patches/patch-tirpc_rpc_svc_soc_h new file mode 100644 index 000000000..9f7c22259 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_svc_soc_h @@ -0,0 +1,102 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/svc_soc.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/svc_soc.h 2014-03-22 13:20:52.000000000 +0100 +@@ -38,7 +38,6 @@ + + #ifndef _RPC_SVC_SOC_H + #define _RPC_SVC_SOC_H +-#include + + /* #pragma ident "@(#)svc_soc.h 1.11 94/04/25 SMI" */ + /* svc_soc.h 1.8 89/05/01 SMI */ +@@ -64,10 +63,14 @@ + * void (*dispatch)(); + * int protocol; like TCP or UDP, zero means do not register + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern bool_t svc_register(SVCXPRT *, u_long, u_long, + void (*)(struct svc_req *, SVCXPRT *), int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Service un-registration +@@ -76,44 +79,64 @@ __END_DECLS + * u_long prog; + * u_long vers; + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern void svc_unregister(u_long, u_long); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + + /* + * Memory based rpc for testing and timing. + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern SVCXPRT *svcraw_create(void); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + + /* + * Udp based rpc. + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern SVCXPRT *svcudp_create(int); + extern SVCXPRT *svcudp_bufcreate(int, u_int, u_int); + extern int svcudp_enablecache(SVCXPRT *, u_long); + extern SVCXPRT *svcudp6_create(int); + extern SVCXPRT *svcudp6_bufcreate(int, u_int, u_int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + + /* + * Tcp based rpc. + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern SVCXPRT *svctcp_create(int, u_int, u_int); + extern SVCXPRT *svctcp6_create(int, u_int, u_int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Fd based rpc. + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern SVCXPRT *svcfd_create(int, u_int, u_int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_RPC_SVC_SOC_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpc_xdr_h b/package/libtirpc/patches/patch-tirpc_rpc_xdr_h new file mode 100644 index 000000000..0f43e3702 --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpc_xdr_h @@ -0,0 +1,53 @@ +--- libtirpc-0.2.3.orig/tirpc/rpc/xdr.h 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpc/xdr.h 2014-03-22 13:20:52.000000000 +0100 +@@ -40,7 +40,6 @@ + + #ifndef _TIRPC_XDR_H + #define _TIRPC_XDR_H +-#include + #include + #include + +@@ -287,7 +286,9 @@ struct xdr_discrim { + /* + * These are the "generic" xdr routines. + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + extern bool_t xdr_void(void); + extern bool_t xdr_int(XDR *, int *); + extern bool_t xdr_u_int(XDR *, u_int *); +@@ -322,7 +323,9 @@ extern bool_t xdr_hyper(XDR *, quad_t *) + extern bool_t xdr_u_hyper(XDR *, u_quad_t *); + extern bool_t xdr_longlong_t(XDR *, quad_t *); + extern bool_t xdr_u_longlong_t(XDR *, u_quad_t *); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + /* + * Common opaque bytes objects used by many rpc protocols; +@@ -340,7 +343,9 @@ extern bool_t xdr_netobj(XDR *, struct + * These are the public routines for the various implementations of + * xdr streams. + */ +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + /* XDR using memory buffers */ + extern void xdrmem_create(XDR *, char *, u_int, enum xdr_op); + +@@ -361,6 +366,8 @@ extern bool_t xdrrec_skiprecord(XDR *); + /* true if no more input */ + extern bool_t xdrrec_eof(XDR *); + extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int); +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* !_TIRPC_XDR_H */ diff --git a/package/libtirpc/patches/patch-tirpc_rpcsvc_crypt_x b/package/libtirpc/patches/patch-tirpc_rpcsvc_crypt_x new file mode 100644 index 000000000..872800b1d --- /dev/null +++ b/package/libtirpc/patches/patch-tirpc_rpcsvc_crypt_x @@ -0,0 +1,12 @@ +--- libtirpc-0.2.3.orig/tirpc/rpcsvc/crypt.x 2013-02-13 16:13:59.000000000 +0100 ++++ libtirpc-0.2.3/tirpc/rpcsvc/crypt.x 2014-03-22 13:20:52.000000000 +0100 +@@ -31,8 +31,7 @@ + */ + + #ifndef RPC_HDR +-%#include +-%__FBSDID("$FreeBSD: src/include/rpcsvc/crypt.x,v 1.5 2003/05/04 02:51:42 obrien Exp $"); ++%%__FBSDID("$FreeBSD: src/include/rpcsvc/crypt.x,v 1.5 2003/05/04 02:51:42 obrien Exp $"); + #endif + + /* diff --git a/package/libtirpc/src/src/queue.h b/package/libtirpc/src/src/queue.h new file mode 100644 index 000000000..daf4553d3 --- /dev/null +++ b/package/libtirpc/src/src/queue.h @@ -0,0 +1,574 @@ +/* + * Copyright (c) 1991, 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. + * + * @(#)queue.h 8.5 (Berkeley) 8/20/94 + */ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_ + +/* + * This file defines five types of data structures: singly-linked lists, + * lists, simple queues, tail queues, and circular queues. + * + * A singly-linked list is headed by a single forward pointer. The + * elements are singly linked for minimum space and pointer manipulation + * overhead at the expense of O(n) removal for arbitrary elements. New + * elements can be added to the list after an existing element or at the + * head of the list. Elements being removed from the head of the list + * should use the explicit macro for this purpose for optimum + * efficiency. A singly-linked list may only be traversed in the forward + * direction. Singly-linked lists are ideal for applications with large + * datasets and few or no removals or for implementing a LIFO queue. + * + * A list is headed by a single forward pointer (or an array of forward + * pointers for a hash table header). The elements are doubly linked + * so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before + * or after an existing element or at the head of the list. A list + * may only be traversed in the forward direction. + * + * A simple queue is headed by a pair of pointers, one the head of the + * list and the other to the tail of the list. The elements are singly + * linked to save space, so elements can only be removed from the + * head of the list. New elements can be added to the list after + * an existing element, at the head of the list, or at the end of the + * list. A simple queue may only be traversed in the forward direction. + * + * A tail queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or + * after an existing element, at the head of the list, or at the end of + * the list. A tail queue may be traversed in either direction. + * + * A circle queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or after + * an existing element, at the head of the list, or at the end of the list. + * A circle queue may be traversed in either direction, but has a more + * complex end of list detection. + * + * For details on the use of these macros, see the queue(3) manual page. + */ + +/* + * List definitions. + */ +#define LIST_HEAD(name, type) \ +struct name { \ + struct type *lh_first; /* first element */ \ +} + +#define LIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define LIST_ENTRY(type) \ +struct { \ + struct type *le_next; /* next element */ \ + struct type **le_prev; /* address of previous next element */ \ +} + +/* + * List functions. + */ +#define LIST_INIT(head) do { \ + (head)->lh_first = NULL; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_AFTER(listelm, elm, field) do { \ + if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ + (listelm)->field.le_next->field.le_prev = \ + &(elm)->field.le_next; \ + (listelm)->field.le_next = (elm); \ + (elm)->field.le_prev = &(listelm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.le_prev = (listelm)->field.le_prev; \ + (elm)->field.le_next = (listelm); \ + *(listelm)->field.le_prev = (elm); \ + (listelm)->field.le_prev = &(elm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.le_next = (head)->lh_first) != NULL) \ + (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ + (head)->lh_first = (elm); \ + (elm)->field.le_prev = &(head)->lh_first; \ +} while (/*CONSTCOND*/0) + +#define LIST_REMOVE(elm, field) do { \ + if ((elm)->field.le_next != NULL) \ + (elm)->field.le_next->field.le_prev = \ + (elm)->field.le_prev; \ + *(elm)->field.le_prev = (elm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_FOREACH(var, head, field) \ + for ((var) = ((head)->lh_first); \ + (var); \ + (var) = ((var)->field.le_next)) + +/* + * List access methods. + */ +#define LIST_EMPTY(head) ((head)->lh_first == NULL) +#define LIST_FIRST(head) ((head)->lh_first) +#define LIST_NEXT(elm, field) ((elm)->field.le_next) + + +/* + * Singly-linked List definitions. + */ +#define SLIST_HEAD(name, type) \ +struct name { \ + struct type *slh_first; /* first element */ \ +} + +#define SLIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define SLIST_ENTRY(type) \ +struct { \ + struct type *sle_next; /* next element */ \ +} + +/* + * Singly-linked List functions. + */ +#define SLIST_INIT(head) do { \ + (head)->slh_first = NULL; \ +} while (/*CONSTCOND*/0) + +#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ + (elm)->field.sle_next = (slistelm)->field.sle_next; \ + (slistelm)->field.sle_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define SLIST_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.sle_next = (head)->slh_first; \ + (head)->slh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE_HEAD(head, field) do { \ + (head)->slh_first = (head)->slh_first->field.sle_next; \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE(head, elm, type, field) do { \ + if ((head)->slh_first == (elm)) { \ + SLIST_REMOVE_HEAD((head), field); \ + } \ + else { \ + struct type *curelm = (head)->slh_first; \ + while(curelm->field.sle_next != (elm)) \ + curelm = curelm->field.sle_next; \ + curelm->field.sle_next = \ + curelm->field.sle_next->field.sle_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define SLIST_FOREACH(var, head, field) \ + for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next) + +/* + * Singly-linked List access methods. + */ +#define SLIST_EMPTY(head) ((head)->slh_first == NULL) +#define SLIST_FIRST(head) ((head)->slh_first) +#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) + + +/* + * Singly-linked Tail queue declarations. + */ +#define STAILQ_HEAD(name, type) \ +struct name { \ + struct type *stqh_first; /* first element */ \ + struct type **stqh_last; /* addr of last next element */ \ +} + +#define STAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).stqh_first } + +#define STAILQ_ENTRY(type) \ +struct { \ + struct type *stqe_next; /* next element */ \ +} + +/* + * Singly-linked Tail queue functions. + */ +#define STAILQ_INIT(head) do { \ + (head)->stqh_first = NULL; \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (head)->stqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.stqe_next = NULL; \ + *(head)->stqh_last = (elm); \ + (head)->stqh_last = &(elm)->field.stqe_next; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (listelm)->field.stqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define STAILQ_REMOVE_HEAD(head, field) do { \ + if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_REMOVE(head, elm, type, field) do { \ + if ((head)->stqh_first == (elm)) { \ + STAILQ_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->stqh_first; \ + while (curelm->field.stqe_next != (elm)) \ + curelm = curelm->field.stqe_next; \ + if ((curelm->field.stqe_next = \ + curelm->field.stqe_next->field.stqe_next) == NULL) \ + (head)->stqh_last = &(curelm)->field.stqe_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define STAILQ_FOREACH(var, head, field) \ + for ((var) = ((head)->stqh_first); \ + (var); \ + (var) = ((var)->field.stqe_next)) + +#define STAILQ_CONCAT(head1, head2) do { \ + if (!STAILQ_EMPTY((head2))) { \ + *(head1)->stqh_last = (head2)->stqh_first; \ + (head1)->stqh_last = (head2)->stqh_last; \ + STAILQ_INIT((head2)); \ + } \ +} while (/*CONSTCOND*/0) + +/* + * Singly-linked Tail queue access methods. + */ +#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) +#define STAILQ_FIRST(head) ((head)->stqh_first) +#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) + + +/* + * Simple queue definitions. + */ +#define SIMPLEQ_HEAD(name, type) \ +struct name { \ + struct type *sqh_first; /* first element */ \ + struct type **sqh_last; /* addr of last next element */ \ +} + +#define SIMPLEQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).sqh_first } + +#define SIMPLEQ_ENTRY(type) \ +struct { \ + struct type *sqe_next; /* next element */ \ +} + +/* + * Simple queue functions. + */ +#define SIMPLEQ_INIT(head) do { \ + (head)->sqh_first = NULL; \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (head)->sqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.sqe_next = NULL; \ + *(head)->sqh_last = (elm); \ + (head)->sqh_last = &(elm)->field.sqe_next; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (listelm)->field.sqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE_HEAD(head, field) do { \ + if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE(head, elm, type, field) do { \ + if ((head)->sqh_first == (elm)) { \ + SIMPLEQ_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->sqh_first; \ + while (curelm->field.sqe_next != (elm)) \ + curelm = curelm->field.sqe_next; \ + if ((curelm->field.sqe_next = \ + curelm->field.sqe_next->field.sqe_next) == NULL) \ + (head)->sqh_last = &(curelm)->field.sqe_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_FOREACH(var, head, field) \ + for ((var) = ((head)->sqh_first); \ + (var); \ + (var) = ((var)->field.sqe_next)) + +/* + * Simple queue access methods. + */ +#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL) +#define SIMPLEQ_FIRST(head) ((head)->sqh_first) +#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) + + +/* + * Tail queue definitions. + */ +#define _TAILQ_HEAD(name, type, qual) \ +struct name { \ + qual type *tqh_first; /* first element */ \ + qual type *qual *tqh_last; /* addr of last next element */ \ +} +#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,) + +#define TAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).tqh_first } + +#define _TAILQ_ENTRY(type, qual) \ +struct { \ + qual type *tqe_next; /* next element */ \ + qual type *qual *tqe_prev; /* address of previous next element */\ +} +#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,) + +/* + * Tail queue functions. + */ +#define TAILQ_INIT(head) do { \ + (head)->tqh_first = NULL; \ + (head)->tqh_last = &(head)->tqh_first; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ + (head)->tqh_first->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (head)->tqh_first = (elm); \ + (elm)->field.tqe_prev = &(head)->tqh_first; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.tqe_next = NULL; \ + (elm)->field.tqe_prev = (head)->tqh_last; \ + *(head)->tqh_last = (elm); \ + (head)->tqh_last = &(elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ + (elm)->field.tqe_next->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (listelm)->field.tqe_next = (elm); \ + (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ + (elm)->field.tqe_next = (listelm); \ + *(listelm)->field.tqe_prev = (elm); \ + (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_REMOVE(head, elm, field) do { \ + if (((elm)->field.tqe_next) != NULL) \ + (elm)->field.tqe_next->field.tqe_prev = \ + (elm)->field.tqe_prev; \ + else \ + (head)->tqh_last = (elm)->field.tqe_prev; \ + *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_FOREACH(var, head, field) \ + for ((var) = ((head)->tqh_first); \ + (var); \ + (var) = ((var)->field.tqe_next)) + +#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ + for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \ + (var); \ + (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) + +#define TAILQ_CONCAT(head1, head2, field) do { \ + if (!TAILQ_EMPTY(head2)) { \ + *(head1)->tqh_last = (head2)->tqh_first; \ + (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ + (head1)->tqh_last = (head2)->tqh_last; \ + TAILQ_INIT((head2)); \ + } \ +} while (/*CONSTCOND*/0) + +/* + * Tail queue access methods. + */ +#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) +#define TAILQ_FIRST(head) ((head)->tqh_first) +#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) + +#define TAILQ_LAST(head, headname) \ + (*(((struct headname *)((head)->tqh_last))->tqh_last)) +#define TAILQ_PREV(elm, headname, field) \ + (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) + + +/* + * Circular queue definitions. + */ +#define CIRCLEQ_HEAD(name, type) \ +struct name { \ + struct type *cqh_first; /* first element */ \ + struct type *cqh_last; /* last element */ \ +} + +#define CIRCLEQ_HEAD_INITIALIZER(head) \ + { (void *)&head, (void *)&head } + +#define CIRCLEQ_ENTRY(type) \ +struct { \ + struct type *cqe_next; /* next element */ \ + struct type *cqe_prev; /* previous element */ \ +} + +/* + * Circular queue functions. + */ +#define CIRCLEQ_INIT(head) do { \ + (head)->cqh_first = (void *)(head); \ + (head)->cqh_last = (void *)(head); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm)->field.cqe_next; \ + (elm)->field.cqe_prev = (listelm); \ + if ((listelm)->field.cqe_next == (void *)(head)) \ + (head)->cqh_last = (elm); \ + else \ + (listelm)->field.cqe_next->field.cqe_prev = (elm); \ + (listelm)->field.cqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm); \ + (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ + if ((listelm)->field.cqe_prev == (void *)(head)) \ + (head)->cqh_first = (elm); \ + else \ + (listelm)->field.cqe_prev->field.cqe_next = (elm); \ + (listelm)->field.cqe_prev = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.cqe_next = (head)->cqh_first; \ + (elm)->field.cqe_prev = (void *)(head); \ + if ((head)->cqh_last == (void *)(head)) \ + (head)->cqh_last = (elm); \ + else \ + (head)->cqh_first->field.cqe_prev = (elm); \ + (head)->cqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.cqe_next = (void *)(head); \ + (elm)->field.cqe_prev = (head)->cqh_last; \ + if ((head)->cqh_first == (void *)(head)) \ + (head)->cqh_first = (elm); \ + else \ + (head)->cqh_last->field.cqe_next = (elm); \ + (head)->cqh_last = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_REMOVE(head, elm, field) do { \ + if ((elm)->field.cqe_next == (void *)(head)) \ + (head)->cqh_last = (elm)->field.cqe_prev; \ + else \ + (elm)->field.cqe_next->field.cqe_prev = \ + (elm)->field.cqe_prev; \ + if ((elm)->field.cqe_prev == (void *)(head)) \ + (head)->cqh_first = (elm)->field.cqe_next; \ + else \ + (elm)->field.cqe_prev->field.cqe_next = \ + (elm)->field.cqe_next; \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_FOREACH(var, head, field) \ + for ((var) = ((head)->cqh_first); \ + (var) != (const void *)(head); \ + (var) = ((var)->field.cqe_next)) + +#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ + for ((var) = ((head)->cqh_last); \ + (var) != (const void *)(head); \ + (var) = ((var)->field.cqe_prev)) + +/* + * Circular queue access methods. + */ +#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) +#define CIRCLEQ_FIRST(head) ((head)->cqh_first) +#define CIRCLEQ_LAST(head) ((head)->cqh_last) +#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) +#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) + +#define CIRCLEQ_LOOP_NEXT(head, elm, field) \ + (((elm)->field.cqe_next == (void *)(head)) \ + ? ((head)->cqh_first) \ + : (elm->field.cqe_next)) +#define CIRCLEQ_LOOP_PREV(head, elm, field) \ + (((elm)->field.cqe_prev == (void *)(head)) \ + ? ((head)->cqh_last) \ + : (elm->field.cqe_prev)) + +#endif /* sys/queue.h */ -- cgit v1.2.3