diff options
Diffstat (limited to 'net')
45 files changed, 4608 insertions, 157 deletions
diff --git a/net/tcl-scotty/Makefile b/net/tcl-scotty/Makefile index 89d8d02febd..63ba905abde 100644 --- a/net/tcl-scotty/Makefile +++ b/net/tcl-scotty/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.31 2014/02/04 00:19:14 joerg Exp $ +# $NetBSD: Makefile,v 1.32 2014/03/05 13:52:29 he Exp $ # DISTNAME= scotty-${DIST_VERS} PKGNAME= tcl-scotty-${DIST_VERS} -PKGREVISION= 9 +PKGREVISION= 10 CATEGORIES= net tcl MASTER_SITES= ftp://ftp.ibr.cs.tu-bs.de/pub/local/tkined/ @@ -29,7 +29,6 @@ CONFIGURE_ENV+= TARGET=scotty .include "../../mk/bsd.prefs.mk" -CFLAGS+= -DUSE_INTERP_RESULT -DUSE_INTERP_ERRORLINE MAKE_FLAGS+= CFLAGS=${CFLAGS:Q} GDMO_LIBS= USE_LIBTOOL= yes diff --git a/net/tcl-scotty/distinfo b/net/tcl-scotty/distinfo index 0459671efa4..c5e6625af6f 100644 --- a/net/tcl-scotty/distinfo +++ b/net/tcl-scotty/distinfo @@ -1,12 +1,45 @@ -$NetBSD: distinfo,v 1.11 2012/08/22 22:18:23 marino Exp $ +$NetBSD: distinfo,v 1.12 2014/03/05 13:52:29 he Exp $ SHA1 (scotty-2.1.11.tar.gz) = 819011f908c57e4591d6f50e51677c01eb55dc13 RMD160 (scotty-2.1.11.tar.gz) = 3b4d45f3db73f05b49a46017bf2ffed6d6464b00 Size (scotty-2.1.11.tar.gz) = 1381059 bytes -SHA1 (patch-aa) = 6d2b4b522ba802d07c0bc8346330070ae7e0edea -SHA1 (patch-ab) = a948075a85ace0ab0cd2a0fe10a2a80f15f367dc -SHA1 (patch-ac) = bf067f64474dc3ed6306caa468f29a040023e165 -SHA1 (patch-ad) = 512d58ca512467b293e1f96d6728e4d5b5839a20 -SHA1 (patch-af) = 0db13ef063f641559c3f7c98480ab99b4877451e -SHA1 (patch-ag) = fb115d88369b45f43da1b906ee8aefde9db96ab2 -SHA1 (patch-ah) = 327f9a0dae60ceacc039e288946114e0bbdbebde +SHA1 (patch-tkined_apps_ip__discover.tcl) = bf067f64474dc3ed6306caa468f29a040023e165 +SHA1 (patch-tnm_gdmo_tnmGdmoTcl.c) = cc67acec2df2cc34a73b0319d452b7ee0aafc5cc +SHA1 (patch-tnm_generic_tnm.h) = 781250970f5d6e1b0653175ce024d8310168f611 +SHA1 (patch-tnm_generic_tnmDns.c) = f6c3279b84c8cd23e46acfb94ffbff7b1e50a898 +SHA1 (patch-tnm_generic_tnmEvent.c) = daddbfef94daea1c6e6530a3a23fb612bb590637 +SHA1 (patch-tnm_generic_tnmHttp.c) = 6798640bcad7eb09ecf706bee94bba26d291dbce +SHA1 (patch-tnm_generic_tnmIcmp.c) = 73a981d2a976fc7a2de5029703e0584712424e21 +SHA1 (patch-tnm_generic_tnmIned.c) = df6e0f305490c414fa4b2a488fc9fac1eb6d23fb +SHA1 (patch-tnm_generic_tnmInit.c) = ac786794a15eed1ca53fcaf799120a66b835f5ee +SHA1 (patch-tnm_generic_tnmInt.h) = 50eec2ecb348e63245a9851518e729db4cce3a38 +SHA1 (patch-tnm_generic_tnmJob.c) = 5891e534c0be96b33165097d60f447e0247dba00 +SHA1 (patch-tnm_generic_tnmNetdb.c) = d8a8bfc5f92004ea774ca113c1f7de8915d2d8c0 +SHA1 (patch-tnm_generic_tnmNtp.c) = a4c0bb8d28bb9d83f80fc444d4e170e7035c885f +SHA1 (patch-tnm_generic_tnmRpc.c) = d3dd34e2022da00116b383640efec2baf7b1e7ec +SHA1 (patch-tnm_generic_tnmSunRpc.c) = 12286dd6c01feaf8fadc4d2c193f88a4337b81e0 +SHA1 (patch-tnm_generic_tnmSyslog.c) = 3963f952ea8ce9907a7db4584e4f27280e4bb33d +SHA1 (patch-tnm_generic_tnmUdp.c) = ceaa4f32a379b3c697405ae1bc22d7c5a4775982 +SHA1 (patch-tnm_generic_tnmUtil.c) = 0c9216365ab2059e7e064439bfb8df8341afe1b9 +SHA1 (patch-tnm_snmp_straps.c) = 3ec9baf566ab4cabd09de98ca1c3a689d9335b8c +SHA1 (patch-tnm_snmp_tnmAsn1.c) = 4eefe643ff0ffc4003e446a91189bf07ae37474b +SHA1 (patch-tnm_snmp_tnmAsn1.h) = 09b036aea74fdc187fedb72db520a701f217ca57 +SHA1 (patch-tnm_snmp_tnmMib.h) = f98655ed6f69479d91b91524397897c355cf7453 +SHA1 (patch-tnm_snmp_tnmMibParser.c) = ef22293224b42f90dc900d63f54ae78c34e74e6b +SHA1 (patch-tnm_snmp_tnmMibQuery.c) = d3983871a3c7a32c1f33ca33067ad5697a29e0aa +SHA1 (patch-tnm_snmp_tnmMibTcl.c) = d259009bd5a50688106c8d67bf8f8edd3c226c30 +SHA1 (patch-tnm_snmp_tnmMibTree.c) = fee6c4c681c3930ec4df624166d3a32091b2159b +SHA1 (patch-tnm_snmp_tnmSnmp.h) = 79d12cbbef65e7a2c230b52a47a7c4b059fe6d32 +SHA1 (patch-tnm_snmp_tnmSnmpAgent.c) = 04a87727d6644861fdd41e9e10bf3085ff943109 +SHA1 (patch-tnm_snmp_tnmSnmpInst.c) = 5d5fc656b59215c5436fc1a6633ba7b626bca442 +SHA1 (patch-tnm_snmp_tnmSnmpNet.c) = 0c18209ecdba85f9ef746c9de5faecd63a67460d +SHA1 (patch-tnm_snmp_tnmSnmpRecv.c) = f55abae9975a7832e38e2754fe6e38e025eb6276 +SHA1 (patch-tnm_snmp_tnmSnmpSend.c) = 46c2b0f7c3d5f6392df96cba55b831ef763deeb7 +SHA1 (patch-tnm_snmp_tnmSnmpTcl.c) = 565d982a4e24e8033c4a16895ff503a3159a1a33 +SHA1 (patch-tnm_snmp_tnmSnmpUtil.c) = 9441f16f0be0f15689e9e628c3e96fc0c10bc942 +SHA1 (patch-unix-Makefile.in) = a948075a85ace0ab0cd2a0fe10a2a80f15f367dc +SHA1 (patch-unix_configure) = 6d2b4b522ba802d07c0bc8346330070ae7e0edea +SHA1 (patch-unix_scotty.c) = fdb6a9bb414566ddb5317a3ebc60d2c305f611a7 +SHA1 (patch-unix_tnmUnixIcmp.c) = 86be48d8da9d77098662e7d2515193515a028e96 +SHA1 (patch-unix_tnmUnixLog.c) = 9191e4683d691a04c5397180f61ebb4365a2c344 +SHA1 (patch-unix_tnmUnixSocket.c) = 7ed9ebea6baa74bf6b36c4e17559f9ef9c2dae52 diff --git a/net/tcl-scotty/patches/patch-ad b/net/tcl-scotty/patches/patch-ad deleted file mode 100644 index 566711d6c02..00000000000 --- a/net/tcl-scotty/patches/patch-ad +++ /dev/null @@ -1,23 +0,0 @@ -$NetBSD: patch-ad,v 1.4 2012/08/21 21:54:19 marino Exp $ - -Don't try to include OS version in directory name for mib files. - ---- tnm/generic/tnmInit.c.orig 1999-03-05 22:32:26.000000000 +0000 -+++ tnm/generic/tnmInit.c -@@ -106,15 +106,12 @@ InitVars(interp) - - machine = Tcl_GetVar2(interp, "tcl_platform", "machine", TCL_GLOBAL_ONLY); - os = Tcl_GetVar2(interp, "tcl_platform", "os", TCL_GLOBAL_ONLY); -- vers = Tcl_GetVar2(interp, "tcl_platform", "osVersion", TCL_GLOBAL_ONLY); - - Tcl_DStringInit(&arch); -- if (machine && os && vers) { -+ if (machine && os) { - Tcl_DStringAppend(&arch, machine, -1); - Tcl_DStringAppend(&arch, "-", 1); - Tcl_DStringAppend(&arch, os, -1); -- Tcl_DStringAppend(&arch, "-", 1); -- Tcl_DStringAppend(&arch, vers, -1); - } else { - Tcl_DStringAppend(&arch, "unknown-os", -1); - } diff --git a/net/tcl-scotty/patches/patch-af b/net/tcl-scotty/patches/patch-af deleted file mode 100644 index bc16cdf1563..00000000000 --- a/net/tcl-scotty/patches/patch-af +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-af,v 1.3 2011/09/02 08:06:55 he Exp $ - -Correct typo. - ---- tnm/generic/tnmUdp.c.orig Mon Nov 25 12:35:13 2002 -+++ tnm/generic/tnmUdp.c Mon Nov 25 12:35:27 2002 -@@ -643,7 +643,7 @@ - } - - mreq.imr_multiaddr.s_addr = name.sin_addr.s_addr; -- name.imr_interface.s_addr = htonl(INADDR_ANY); -+ mreq.imr_interface.s_addr = htonl(INADDR_ANY); - - sock = TnmSocket(PF_INET, SOCK_DGRAM, 0); - if (sock == TNM_SOCKET_ERROR) { diff --git a/net/tcl-scotty/patches/patch-ah b/net/tcl-scotty/patches/patch-ah deleted file mode 100644 index e5d0e4be49a..00000000000 --- a/net/tcl-scotty/patches/patch-ah +++ /dev/null @@ -1,99 +0,0 @@ -$NetBSD: patch-ah,v 1.1 2011/09/02 08:06:55 he Exp $ - -Avoid use of _res, since scotty is a pthread-linked program. -Instead, use the newer resolver interfaces. - ---- tnm/generic/tnmDns.c.orig 1997-11-13 11:17:41.000000000 +0000 -+++ tnm/generic/tnmDns.c -@@ -141,6 +141,8 @@ AssocDeleteProc(clientData, interp) - *---------------------------------------------------------------------- - */ - -+static struct __res_state rs; -+ - static void - DnsInit(timeout, retries, server) - int timeout; -@@ -150,20 +152,20 @@ DnsInit(timeout, retries, server) - static int initialized = 0; - - if (! initialized) { -- res_init(); -- _res.options |= RES_RECURSE | RES_DNSRCH | RES_DEFNAMES | RES_AAONLY; -+ res_ninit(&rs); -+ rs.options |= RES_RECURSE | RES_DNSRCH | RES_DEFNAMES | RES_AAONLY; - initialized = 1; -- if (_res.nscount > 0) { -- *server = _res.nsaddr.sin_addr; -+ if (rs.nscount > 0) { -+ *server = rs.nsaddr.sin_addr; - } - if (! server->s_addr) { - server->s_addr = htonl(INADDR_LOOPBACK); - } - } - -- _res.retrans = timeout; -- _res.retry = retries + 1; -- _res.nsaddr.sin_addr = *server; -+ rs.retrans = timeout; -+ rs.retry = retries + 1; -+ rs.nsaddr.sin_addr = *server; - } - - /* -@@ -248,7 +250,7 @@ DnsDoQuery(query_string, query_type, que - * res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) - */ - -- qlen = res_mkquery(QUERY, query_string, C_IN, query_type, -+ qlen = res_nmkquery(&rs, QUERY, query_string, C_IN, query_type, - (u_char *) 0, 0, 0, - (u_char *) &query, sizeof(query)); - if (qlen <= 0) { -@@ -261,7 +263,7 @@ DnsDoQuery(query_string, query_type, que - * res_send(msg, msglen, answer, anslen) - */ - -- alen = res_send((u_char *) &query, qlen, -+ alen = res_nsend(&rs, (u_char *) &query, qlen, - (u_char *) &answer, sizeof (answer)); - if (alen <= 0) { - query_result->n = -1; -@@ -499,10 +501,10 @@ DnsHaveQuery(query_string, query_type, q - - if (i == -1) { - strcpy(tmp, query_string); -- } else if (! _res.dnsrch[i]) { -+ } else if (! rs.dnsrch[i]) { - break; - } else { -- sprintf(tmp, "%s.%s", query_string, _res.dnsrch[i]); -+ sprintf(tmp, "%s.%s", query_string, rs.dnsrch[i]); - } - - DnsDoQuery(tmp, query_type, &res); -@@ -529,10 +531,10 @@ DnsHaveQuery(query_string, query_type, q - - if (i == -1) { - strcpy(tmp, query_string); -- } else if (! _res.dnsrch[i]) { -+ } else if (! rs.dnsrch[i]) { - break; - } else { -- sprintf(tmp, "%s.%s", query_string, _res.dnsrch[i]); -+ sprintf(tmp, "%s.%s", query_string, rs.dnsrch[i]); - } - - DnsDoQuery(tmp, query_type, &res); -@@ -562,8 +564,8 @@ DnsHaveQuery(query_string, query_type, q - if (tmpres.type != T_A || tmpres.n <= 0) { - return; - } -- _res.nsaddr.sin_addr = tmpres.u.addr[0]; -- _res.nscount = 1; -+ rs.nsaddr.sin_addr = tmpres.u.addr[0]; -+ rs.nscount = 1; - DnsHaveQuery(query_string, query_type, query_result, depth + 1); - return; - } diff --git a/net/tcl-scotty/patches/patch-ac b/net/tcl-scotty/patches/patch-tkined_apps_ip__discover.tcl index 28101568ece..f4e68df02f2 100644 --- a/net/tcl-scotty/patches/patch-ac +++ b/net/tcl-scotty/patches/patch-tkined_apps_ip__discover.tcl @@ -1,4 +1,4 @@ -$NetBSD: patch-ac,v 1.2 2011/09/02 08:06:55 he Exp $ +$NetBSD: patch-tkined_apps_ip__discover.tcl,v 1.1 2014/03/05 13:52:29 he Exp $ Ensure we unset the global variable... diff --git a/net/tcl-scotty/patches/patch-tnm_gdmo_tnmGdmoTcl.c b/net/tcl-scotty/patches/patch-tnm_gdmo_tnmGdmoTcl.c new file mode 100644 index 00000000000..b093e5866ef --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_gdmo_tnmGdmoTcl.c @@ -0,0 +1,94 @@ +$NetBSD: patch-tnm_gdmo_tnmGdmoTcl.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/gdmo/tnmGdmoTcl.c.orig 1996-10-01 20:18:38.000000000 +0000 ++++ tnm/gdmo/tnmGdmoTcl.c +@@ -88,20 +88,20 @@ oid_result _ANSI_ARGS_((Tcl_Interp*, gd + + static int + GdmoNotification _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + GdmoBehaviour _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + GdmoLoad _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + GdmoInfo _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + GdmoCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + + + /*===========================================================================* +@@ -1282,7 +1282,7 @@ static int + GdmoNotification (interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + if (argc == 2) { + if (!strcmp(argv[1], "info")) { +@@ -1360,7 +1360,7 @@ static int + GdmoBehaviour (interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + if (argc == 2) { + if (!strcmp(argv[1], "info")) { +@@ -1424,11 +1424,11 @@ static int + GdmoLoad (interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Tcl_DString fileBuffer; +- char *library, *fileName, *file = argv[2]; +- char **fileArgv = NULL, **libArgv = NULL; ++ const char *library, *fileName, *file = argv[2]; ++ const char **fileArgv = NULL, **libArgv = NULL; + int fileArgc, libArgc; + int code = TCL_OK; + FILE *fin = NULL; +@@ -1463,8 +1463,8 @@ GdmoLoad (interp, argc, argv) + if (access(fileName, R_OK) != 0) { + + int tmpArgc; +- char **tmpArgv = (char **) ckalloc((libArgc + 2) * sizeof(char *)); +- ++ const char **tmpArgv = (const char **) ckalloc((libArgc + 2) * ++ sizeof(char *)); + if (library) { + for (tmpArgc = 0; tmpArgc < libArgc; tmpArgc++) { + tmpArgv[tmpArgc] = libArgv[tmpArgc]; +@@ -1551,7 +1551,7 @@ static int + GdmoInfo(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + if (argc != 3) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], +@@ -1610,7 +1610,7 @@ GdmoCmd(clientData, interp, argc, argv) + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + if (argc < 2) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnm.h b/net/tcl-scotty/patches/patch-tnm_generic_tnm.h new file mode 100644 index 00000000000..f54fed5f0fe --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnm.h @@ -0,0 +1,58 @@ +$NetBSD: patch-tnm_generic_tnm.h,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/generic/tnm.h~ 1998-11-03 16:17:48.000000000 +0100 ++++ tnm/generic/tnm.h 2014-03-04 14:12:35.000000000 +0100 +@@ -81,39 +81,39 @@ + + EXTERN int + Tnm_EventCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + EXTERN int + Tnm_JobCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + EXTERN int + Tnm_SyslogCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + EXTERN int + Tnm_UdpCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + EXTERN int + Tnm_RpcCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + EXTERN int + Tnm_HttpCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + EXTERN int + Tnm_DnsCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + EXTERN int + Tnm_NtpCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + EXTERN int + Tnm_SunrpcCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + EXTERN int + Tnm_IcmpCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + EXTERN int + Tnm_InedCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + EXTERN int + Tnm_NetdbCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + + #endif /* _TNM */ diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmDns.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmDns.c new file mode 100644 index 00000000000..6f3dd3bffe1 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmDns.c @@ -0,0 +1,291 @@ +$NetBSD: patch-tnm_generic_tnmDns.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Avoid use of _res, since scotty is a pthread-linked program. +Instead, use the newer resolver interfaces. + +Constify. + +--- tnm/generic/tnmDns.c.orig 1997-11-13 12:17:41.000000000 +0100 ++++ tnm/generic/tnmDns.c 2014-03-04 15:38:34.000000000 +0100 +@@ -68,31 +68,31 @@ + DnsInit _ANSI_ARGS_((int timeout, int retries, + struct in_addr *server)); + static int +-DnsGetHostName _ANSI_ARGS_((Tcl_Interp *interp, char *hname)); ++DnsGetHostName _ANSI_ARGS_((Tcl_Interp *interp, const char *hname)); + + static void +-DnsDoQuery _ANSI_ARGS_((char *query_string, int query_type, ++DnsDoQuery _ANSI_ARGS_((const char *query_string, int query_type, + a_res *query_result)); + static void +-DnsHaveQuery _ANSI_ARGS_((char *query_string, int query_type, ++DnsHaveQuery _ANSI_ARGS_((const char *query_string, int query_type, + a_res *query_result, int depth)); + static int +-DnsA _ANSI_ARGS_((Tcl_Interp *interp, char *hname)); ++DnsA _ANSI_ARGS_((Tcl_Interp *interp, const char *hname)); + + static int +-DnsPtr _ANSI_ARGS_((Tcl_Interp *interp, char *ip)); ++DnsPtr _ANSI_ARGS_((Tcl_Interp *interp, const char *ip)); + + static void + DnsCleanHinfo _ANSI_ARGS_((char *str)); + + static int +-DnsHinfo _ANSI_ARGS_((Tcl_Interp *interp, char *hname)); ++DnsHinfo _ANSI_ARGS_((Tcl_Interp *interp, const char *hname)); + + static int +-DnsMx _ANSI_ARGS_((Tcl_Interp *interp, char *hname)); ++DnsMx _ANSI_ARGS_((Tcl_Interp *interp, const char *hname)); + + static int +-DnsSoa _ANSI_ARGS_((Tcl_Interp *interp, char *hname)); ++DnsSoa _ANSI_ARGS_((Tcl_Interp *interp, const char *hname)); + + /* + *---------------------------------------------------------------------- +@@ -141,6 +141,8 @@ + *---------------------------------------------------------------------- + */ + ++static struct __res_state rs; ++ + static void + DnsInit(timeout, retries, server) + int timeout; +@@ -150,20 +152,20 @@ + static int initialized = 0; + + if (! initialized) { +- res_init(); +- _res.options |= RES_RECURSE | RES_DNSRCH | RES_DEFNAMES | RES_AAONLY; ++ res_ninit(&rs); ++ rs.options |= RES_RECURSE | RES_DNSRCH | RES_DEFNAMES | RES_AAONLY; + initialized = 1; +- if (_res.nscount > 0) { +- *server = _res.nsaddr.sin_addr; ++ if (rs.nscount > 0) { ++ *server = rs.nsaddr.sin_addr; + } + if (! server->s_addr) { + server->s_addr = htonl(INADDR_LOOPBACK); + } + } + +- _res.retrans = timeout; +- _res.retry = retries + 1; +- _res.nsaddr.sin_addr = *server; ++ rs.retrans = timeout; ++ rs.retry = retries + 1; ++ rs.nsaddr.sin_addr = *server; + } + + /* +@@ -186,7 +188,7 @@ + static int + DnsGetHostName(interp, hname) + Tcl_Interp *interp; +- char *hname; ++ const char *hname; + { + int rc; + +@@ -220,7 +222,7 @@ + + static void + DnsDoQuery(query_string, query_type, query_result) +- char *query_string; ++ const char *query_string; + int query_type; + a_res *query_result; + { +@@ -248,7 +250,7 @@ + * res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) + */ + +- qlen = res_mkquery(QUERY, query_string, C_IN, query_type, ++ qlen = res_nmkquery(&rs, QUERY, query_string, C_IN, query_type, + (u_char *) 0, 0, 0, + (u_char *) &query, sizeof(query)); + if (qlen <= 0) { +@@ -261,7 +263,7 @@ + * res_send(msg, msglen, answer, anslen) + */ + +- alen = res_send((u_char *) &query, qlen, ++ alen = res_nsend(&rs, (u_char *) &query, qlen, + (u_char *) &answer, sizeof (answer)); + if (alen <= 0) { + query_result->n = -1; +@@ -475,7 +477,7 @@ + + static void + DnsHaveQuery(query_string, query_type, query_result, depth) +- char *query_string; ++ const char *query_string; + int query_type; + a_res *query_result; + int depth; +@@ -499,10 +501,10 @@ + + if (i == -1) { + strcpy(tmp, query_string); +- } else if (! _res.dnsrch[i]) { ++ } else if (! rs.dnsrch[i]) { + break; + } else { +- sprintf(tmp, "%s.%s", query_string, _res.dnsrch[i]); ++ sprintf(tmp, "%s.%s", query_string, rs.dnsrch[i]); + } + + DnsDoQuery(tmp, query_type, &res); +@@ -529,10 +531,10 @@ + + if (i == -1) { + strcpy(tmp, query_string); +- } else if (! _res.dnsrch[i]) { ++ } else if (! rs.dnsrch[i]) { + break; + } else { +- sprintf(tmp, "%s.%s", query_string, _res.dnsrch[i]); ++ sprintf(tmp, "%s.%s", query_string, rs.dnsrch[i]); + } + + DnsDoQuery(tmp, query_type, &res); +@@ -562,8 +564,8 @@ + if (tmpres.type != T_A || tmpres.n <= 0) { + return; + } +- _res.nsaddr.sin_addr = tmpres.u.addr[0]; +- _res.nscount = 1; ++ rs.nsaddr.sin_addr = tmpres.u.addr[0]; ++ rs.nscount = 1; + DnsHaveQuery(query_string, query_type, query_result, depth + 1); + return; + } +@@ -590,14 +592,14 @@ + static int + DnsA(interp, hname) + Tcl_Interp *interp; +- char *hname; ++ const char *hname; + { + a_res res; + int i; + + if (TnmValidateIpAddress(NULL, hname) == TCL_OK) { + if (DnsPtr(interp, hname) == TCL_OK) { +- Tcl_SetResult(interp, hname, TCL_VOLATILE); ++ Tcl_SetResult(interp, (char *)hname, TCL_VOLATILE); + return TCL_OK; + } else { + return TCL_ERROR; +@@ -641,7 +643,7 @@ + static int + DnsPtr(interp, ip) + Tcl_Interp *interp; +- char *ip; ++ const char *ip; + { + a_res res; + int i, a, b, c, d; +@@ -722,7 +724,7 @@ + static int + DnsHinfo(interp, hname) + Tcl_Interp *interp; +- char *hname; ++ const char *hname; + { + a_res res; + char *start, *ptr; +@@ -735,7 +737,7 @@ + if (DnsGetHostName(interp, hname) != TCL_OK) { + return TCL_ERROR; + } +- hname = interp->result; ++ hname = Tcl_GetStringResult(interp); + } + + if (TnmValidateIpHostName(interp, hname) != TCL_OK) { +@@ -799,7 +801,7 @@ + static int + DnsMx(interp, hname) + Tcl_Interp *interp; +- char *hname; ++ const char *hname; + { + a_res res; + int i; +@@ -812,7 +814,7 @@ + if (DnsGetHostName(interp, hname) != TCL_OK) { + return TCL_ERROR; + } +- hname = interp->result; ++ hname = Tcl_GetStringResult(interp); + } + + if (TnmValidateIpHostName(interp, hname) != TCL_OK) { +@@ -853,7 +855,7 @@ + static int + DnsSoa(interp, hname) + Tcl_Interp *interp; +- char *hname; ++ const char *hname; + { + a_res res; + int i; +@@ -867,7 +869,7 @@ + if (DnsGetHostName(interp, hname) != TCL_OK) { + return TCL_ERROR; + } +- hname = interp->result; ++ hname = Tcl_GetStringResult(interp); + } + + if (TnmValidateIpHostName(interp, hname) != TCL_OK) { +@@ -910,14 +912,14 @@ + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char *argv[]; ++ const char *argv[]; + { +- char *cmd = argv[0]; ++ const char *cmd = argv[0]; + + int actRetries = -1; /* actually used # of retries */ + int actTimeout = -1; /* actually used timeout in s */ + struct in_addr actServer; /* actually used DNS server */ +- char *serverName = NULL; /* name of new DNS server */ ++ const char *serverName = NULL; /* name of new DNS server */ + + DnsControl *control = (DnsControl *) + Tcl_GetAssocData(interp, tnmDnsControl, NULL); +@@ -946,10 +948,13 @@ + */ + + while ((argc > 0) && (*argv[0] == '-')) { ++ char res[20]; ++ + if (strcmp(argv[0], "-timeout") == 0) { + argc--, argv++; + if (argc <= 0) { +- sprintf(interp->result, "%d", control->timeout); ++ sprintf(res, "%d", control->timeout); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_OK; + } + if (TnmGetPositive(interp, argv[0], &actTimeout) != TCL_OK) { +@@ -959,7 +964,8 @@ + } else if (strcmp(argv[0], "-retries") == 0) { + argc--, argv++; + if (argc <= 0) { +- sprintf(interp->result, "%d", control->retries); ++ sprintf(res, "%d", control->retries); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_OK; + } + if (TnmGetUnsigned(interp, argv[0], &actRetries) != TCL_OK) { diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmEvent.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmEvent.c new file mode 100644 index 00000000000..58989c2b827 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmEvent.c @@ -0,0 +1,47 @@ +$NetBSD: patch-tnm_generic_tnmEvent.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/generic/tnmEvent.c.orig 1996-08-27 20:24:58.000000000 +0000 ++++ tnm/generic/tnmEvent.c +@@ -73,11 +73,11 @@ EventProc _ANSI_ARGS_((ClientData client + + static int + BindEvent _ANSI_ARGS_((Tcl_Interp *interp, EventControl *control, +- int argc, char **argv)); ++ int argc, const char **argv)); + + static int + RaiseEvent _ANSI_ARGS_((Tcl_Interp *interp, EventControl *control, +- int argc, char **argv)); ++ int argc, const char * const *argv)); + + /* + *---------------------------------------------------------------------- +@@ -170,7 +170,7 @@ BindEvent(interp, control, argc, argv) + Tcl_Interp *interp; + EventControl *control; + int argc; +- char **argv; ++ const char **argv; + { + Tcl_HashEntry *entryPtr; + +@@ -249,7 +249,7 @@ RaiseEvent(interp, control, argc, argv) + Tcl_Interp *interp; + EventControl *control; + int argc; +- char **argv; ++ const char * const * argv; + { + Tcl_HashEntry *entryPtr; + +@@ -299,7 +299,7 @@ Tnm_EventCmd(clientData, interp, argc, a + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + EventControl *control = (EventControl *) + Tcl_GetAssocData(interp, tnmEventControl, NULL); diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmHttp.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmHttp.c new file mode 100644 index 00000000000..d2567899fce --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmHttp.c @@ -0,0 +1,327 @@ +$NetBSD: patch-tnm_generic_tnmHttp.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/generic/tnmHttp.c.orig 1999-04-06 11:13:31.000000000 +0200 ++++ tnm/generic/tnmHttp.c 2014-03-04 18:01:45.000000000 +0100 +@@ -169,20 +169,21 @@ + */ + + static char* +-Base64Encode _ANSI_ARGS_((char *string)); ++Base64Encode _ANSI_ARGS_((const char *string)); + + static char* +-Base64Decode _ANSI_ARGS_((char *string)); ++Base64Decode _ANSI_ARGS_((const char *string)); + + static int +-HttpGetPort _ANSI_ARGS_((char *name)); ++HttpGetPort _ANSI_ARGS_((const char *name)); + + static HttpUrl* +-HttpSplitUrl _ANSI_ARGS_((char *str)); ++HttpSplitUrl _ANSI_ARGS_((const char *str)); + + static void + HttpRequestLine _ANSI_ARGS_((Tcl_Channel channel, +- char *method, char *path)); ++ const char *method, ++ const char *path)); + static void + HttpStatusLine _ANSI_ARGS_((Tcl_Channel channel, int code)); + +@@ -213,7 +214,7 @@ + HttpEvalCallback _ANSI_ARGS_((Tcl_Interp *interp, char *callback, + char *addr, char *url)); + static Tcl_Channel +-HttpOpen _ANSI_ARGS_((char *fileName, char **contentType, ++HttpOpen _ANSI_ARGS_((const char *fileName, char **contentType, + char **contentEncoding, + int *contentLength)); + static void +@@ -228,31 +229,31 @@ + Tcl_Channel dst)); + static int + HttpProxy _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + HttpHead _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + HttpGet _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + HttpPost _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + HttpPut _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + HttpDelete _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + HttpServer _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + HttpBind _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + HttpMime _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + /* + * The following defines are used to implement base64 en/decoding. + * See RFC 1521 for a description of base64 en/decoding. +@@ -294,7 +295,7 @@ + + static char * + Base64Encode(in) +- char *in; ++ const char *in; + { + static char *ret = NULL; + static int size = 0; +@@ -374,7 +375,7 @@ + + static char * + Base64Decode(in) +- char *in; ++ const char *in; + { + static char *ret = NULL; + static int size = 0; +@@ -448,7 +449,7 @@ + + static int + HttpGetPort(name) +- char *name; ++ const char *name; + { + struct sockaddr_in addr; + +@@ -479,7 +480,7 @@ + + static HttpUrl* + HttpSplitUrl(str) +- char *str; ++ const char *str; + { + static HttpUrl url = { 0, 0, 0, 0 }; + char *hbuf; +@@ -595,8 +596,8 @@ + static void + HttpRequestLine(channel, method, path) + Tcl_Channel channel; +- char *method; +- char *path; ++ const char *method; ++ const char *path; + { + Tcl_Write(channel, method, strlen(method)); + Tcl_Write(channel, " ", 1); +@@ -973,7 +974,7 @@ + Tcl_DStringFree(&tclCmd); + + if (code == TCL_ERROR) { +- char *errorMsg = ckstrdup(interp->result); ++ char *errorMsg = ckstrdup(Tcl_GetStringResult(interp)); + Tcl_AddErrorInfo(interp, "\n (http callback)"); + Tcl_BackgroundError(interp); + Tcl_SetResult(interp, errorMsg, TCL_DYNAMIC); +@@ -1005,14 +1006,14 @@ + + static Tcl_Channel + HttpOpen(fileName, contentType, contentEncoding, contentLength) +- char *fileName; ++ const char *fileName; + char **contentType; + char **contentEncoding; + int *contentLength; + { + Tcl_Channel channel; + struct stat st; +- char *dot = NULL; ++ char *dot = NULL, *fn; + int n; + + channel = Tcl_OpenFileChannel(NULL, fileName, "r", 0644); +@@ -1033,21 +1034,22 @@ + * x-compress and x-gzip encoding. This is a quick hack. + */ + +- for (n = strlen(fileName) - 1; n >= 0; n--) { +- if (fileName[n] == '.' && *contentEncoding == NULL) { +- if (strcmp(fileName+n, ".gz") == 0) { ++ fn = ckstrdup(fileName); ++ for (n = strlen(fn) - 1; n >= 0; n--) { ++ if (fn[n] == '.' && *contentEncoding == NULL) { ++ if (strcmp(fn+n, ".gz") == 0) { + *contentEncoding = "x-gzip"; +- dot = fileName + n; ++ dot = fn + n; + *dot = '\0'; +- } else if (strcmp(fileName+n, ".Z") == 0) { ++ } else if (strcmp(fn+n, ".Z") == 0) { + *contentEncoding = "x-compress"; +- dot = fileName + n; ++ dot = fn + n; + *dot = '\0'; + } + } +- if (fileName[n] == '.') { ++ if (fn[n] == '.') { + Tcl_HashEntry *entryPtr; +- entryPtr = Tcl_FindHashEntry(&mimeTypeTable, fileName+n+1); ++ entryPtr = Tcl_FindHashEntry(&mimeTypeTable, fn+n+1); + if (entryPtr) { + *contentType = (char *) Tcl_GetHashValue(entryPtr); + } +@@ -1061,6 +1063,7 @@ + if (! *contentType) { + *contentType = "text/plain"; + } ++ ckfree(fn); + + return channel; + } +@@ -1165,7 +1168,7 @@ + if (rc == TCL_OK) { + char *contentType, *contentEncoding; + int contentLength; +- Tcl_Channel obj = HttpOpen(interp->result, &contentType, ++ Tcl_Channel obj = HttpOpen(Tcl_GetStringResult(interp), &contentType, + &contentEncoding, &contentLength); + if (obj) { + HttpStatusLine(channel, HTTP_OK); +@@ -1179,7 +1182,7 @@ + HttpSendError(channel, HTTP_INTERNAL); + } + } else { +- int code = TnmGetTableKey(httpStatusTable, interp->result); ++ int code = TnmGetTableKey(httpStatusTable, Tcl_GetStringResult(interp)); + HttpSendError(channel, (code < 0) ? HTTP_INTERNAL : code); + } + +@@ -1362,7 +1365,7 @@ + HttpProxy(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + if (argc < 2 && argc > 3) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], +@@ -1419,7 +1422,7 @@ + HttpHead(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Tcl_Channel src; + HttpUrl *url; +@@ -1469,7 +1472,7 @@ + HttpGet(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Tcl_Channel src, dst; + HttpUrl *url; +@@ -1530,7 +1533,7 @@ + HttpPost(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Tcl_Channel src, dst, obj; + HttpUrl *url; +@@ -1603,7 +1606,7 @@ + HttpPut(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Tcl_Channel src, obj; + HttpUrl *url; +@@ -1665,7 +1668,7 @@ + HttpDelete(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Tcl_Channel src; + HttpUrl *url; +@@ -1717,10 +1720,11 @@ + HttpServer(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + static int port = -1; + static Tcl_Channel channel; ++ char res[20]; + + if (argc < 2 && argc > 3) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], +@@ -1730,7 +1734,8 @@ + + if (argc == 2) { + if (port > 0) { +- sprintf(interp->result, "%d", port); ++ sprintf(res, "%d", port); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + } + return TCL_OK; + } +@@ -1762,7 +1767,8 @@ + return TCL_ERROR; + } + +- sprintf(interp->result, "%d", port); ++ sprintf(res, "%d", port); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_OK; + } + +@@ -1788,7 +1794,7 @@ + HttpBind(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + int eventType = 0; + HttpBinding *bindPtr; +@@ -1878,7 +1884,7 @@ + HttpMime(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Tcl_HashTable *tablePtr = &mimeTypeTable; + Tcl_HashEntry *entryPtr; +@@ -1934,7 +1940,7 @@ + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + static int initialized = 0; + char c; diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmIcmp.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmIcmp.c new file mode 100644 index 00000000000..33517f12bd8 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmIcmp.c @@ -0,0 +1,95 @@ +$NetBSD: patch-tnm_generic_tnmIcmp.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/generic/tnmIcmp.c~ 1998-12-17 12:59:55.000000000 +0100 ++++ tnm/generic/tnmIcmp.c 2014-03-04 15:27:10.000000000 +0100 +@@ -35,7 +35,7 @@ + AssocDeleteProc _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp)); + + static int +-IcmpRequest _ANSI_ARGS_((Tcl_Interp *interp, char *hosts, int type, ++IcmpRequest _ANSI_ARGS_((Tcl_Interp *interp, const char *hosts, int type, + int ttl, int timeout, int retries, int delay, + int size)); + +@@ -88,11 +88,11 @@ + static int + IcmpRequest(interp, hosts, type, ttl, timeout, retries, delay, size) + Tcl_Interp *interp; +- char *hosts; ++ const char *hosts; + int type, ttl, timeout, retries, delay, size; + { + int i, code, largc, len; +- char **largv; ++ const char **largv; + TnmIcmpRequest *icmpPtr; + + code = Tcl_SplitList(interp, hosts, &largc, &largv); +@@ -154,7 +154,7 @@ + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + int actTimeout = -1; /* actually used timeout */ + int actRetries = -1; /* actually used retries */ +@@ -164,7 +164,7 @@ + int type = 0; /* the request type */ + int ttl = -1; /* the time to live field */ + +- char *cmdName = argv[0]; ++ char const *cmdName = argv[0]; + + IcmpControl *control = (IcmpControl *) + Tcl_GetAssocData(interp, tnmIcmpControl, NULL); +@@ -193,11 +193,13 @@ + + argc--; argv++; + while (argc > 0 && (*argv[0] == '-')) { ++ char res[20]; + if (strcmp(argv[0], "-retries") == 0) { + argc--, argv++; + if (argc < 1) { +- sprintf(interp->result, "%d", control->retries); +- return TCL_OK; ++ sprintf(res, "%d", control->retries); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); ++ return TCL_OK; + } + if (TnmGetUnsigned(interp, argv[0], &actRetries) != TCL_OK) + return TCL_ERROR; +@@ -205,7 +207,8 @@ + } else if (strcmp(argv[0], "-timeout") == 0) { + argc--, argv++; + if (argc < 1) { +- sprintf(interp->result, "%d", control->timeout); ++ sprintf(res, "%d", control->timeout); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_OK; + } + if (TnmGetPositive(interp, argv[0], &actTimeout) != TCL_OK) { +@@ -215,8 +218,9 @@ + } else if (strcmp(argv[0], "-size") == 0) { + argc--, argv++; + if (argc < 1) { +- sprintf(interp->result, "%d", control->size); +- return TCL_OK; ++ sprintf(res, "%d", control->size); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); ++ return TCL_OK; + } + if (TnmGetUnsigned(interp, argv[0], &actSize) != TCL_OK) { + return TCL_ERROR; +@@ -226,7 +230,8 @@ + } else if (strcmp(argv[0], "-delay") == 0) { + argc--, argv++; + if (argc < 1) { +- sprintf(interp->result, "%d", control->delay); ++ sprintf(res, "%d", control->delay); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_OK; + } + if (TnmGetUnsigned(interp, argv[0], &actDelay) != TCL_OK) diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmIned.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmIned.c new file mode 100644 index 00000000000..d430e00a492 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmIned.c @@ -0,0 +1,197 @@ +$NetBSD: patch-tnm_generic_tnmIned.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/generic/tnmIned.c.orig 1998-09-07 17:14:12.000000000 +0000 ++++ tnm/generic/tnmIned.c +@@ -20,7 +20,7 @@ + */ + + typedef struct Message { +- char *msg; ++ const char *msg; + struct Message *next; + } Message; + +@@ -55,14 +55,14 @@ static void + InedFlushQueue _ANSI_ARGS_((Tcl_Interp *)); + + static void +-InedAppendQueue _ANSI_ARGS_((Tcl_Interp *interp, char *msg)); ++InedAppendQueue _ANSI_ARGS_((Tcl_Interp *interp, const char *msg)); + + static char* + InedGets _ANSI_ARGS_((Tcl_Interp *interp)); + + static int +-InedCompCmd _ANSI_ARGS_((char *cmd, Tcl_Interp *interp, +- int argc, char **argv)); ++InedCompCmd _ANSI_ARGS_((const char *cmd, Tcl_Interp *interp, ++ int argc, const char **argv)); + static void + InedReceiveProc _ANSI_ARGS_((ClientData clientData, int mask)); + +@@ -136,7 +136,8 @@ static void + InedInitialize(interp) + Tcl_Interp *interp; + { +- char *path, *tmp, *p; ++ const char *path, *p; ++ char *tmp; + Tcl_Channel channel; + + /* +@@ -174,10 +175,12 @@ InedInitialize(interp) + Tcl_SetVar(interp, "auto_path", "", TCL_GLOBAL_ONLY); + + if ((p = getenv("TKINED_PATH"))) { ++ char *tp; ++ + tmp = ckstrdup(p); +- for (p = tmp; *p; p++) { +- if (*p == ':') { +- *p = ' '; ++ for (tp = tmp; *tp; tp++) { ++ if (*tp == ':') { ++ *tp = ' '; + } + } + Tcl_SetVar(interp, "auto_path", tmp, TCL_GLOBAL_ONLY); +@@ -371,7 +374,7 @@ InedFlushQueue(interp) + static void + InedAppendQueue(interp, msg) + Tcl_Interp *interp; +- char *msg; ++ const char *msg; + { + Message *np; + Message *p; +@@ -457,10 +460,10 @@ InedGets(interp) + + static int + InedCompCmd(cmd, interp, argc, argv) +- char *cmd; ++ const char *cmd; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + int type = TnmGetTableKey(tkiTypeTable, argv[0]); + if (type < 0 || (type == TKINED_NONE) || (type == TKINED_ALL)) { +@@ -468,11 +471,11 @@ InedCompCmd(cmd, interp, argc, argv) + } + + if ((strcmp(cmd, "type") == 0) && (argc > 0)) { +- Tcl_SetResult(interp, argv[0], TCL_VOLATILE); ++ Tcl_SetResult(interp, (char *)argv[0], TCL_VOLATILE); + return TCL_OK; + + } else if ((strcmp(cmd, "id") == 0) && (argc > 1)) { +- Tcl_SetResult(interp, argv[1], TCL_VOLATILE); ++ Tcl_SetResult(interp, (char *)argv[1], TCL_VOLATILE); + return TCL_OK; + + } else if ((strcmp(cmd, "name") == 0) && (argc > 2)) { +@@ -482,7 +485,7 @@ InedCompCmd(cmd, interp, argc, argv) + || (type == TKINED_MENU) || (type == TKINED_LOG) + || (type == TKINED_GRAPH) || (type == TKINED_HTML) + || (type == TKINED_DATA) || (type == TKINED_EVENT) ) +- Tcl_SetResult(interp, argv[2], TCL_VOLATILE); ++ Tcl_SetResult(interp, (char *)argv[2], TCL_VOLATILE); + return TCL_OK; + + } else if ((strcmp(cmd, "address") == 0) && (argc > 3)) { +@@ -490,41 +493,41 @@ InedCompCmd(cmd, interp, argc, argv) + || (type == TKINED_BARCHART) || (type == TKINED_STRIPCHART) + || (type == TKINED_REFERENCE) || (type == TKINED_GRAPH) + || (type == TKINED_DATA)) +- Tcl_SetResult(interp, argv[3], TCL_VOLATILE); ++ Tcl_SetResult(interp, (char *)argv[3], TCL_VOLATILE); + return TCL_OK; + + } else if (strcmp(cmd, "oid") == 0) { + if ((type == TKINED_GROUP) && (argc > 3)) { +- Tcl_SetResult(interp, argv[3], TCL_VOLATILE); ++ Tcl_SetResult(interp, (char *)argv[3], TCL_VOLATILE); + } + if ((type == TKINED_NODE || type == TKINED_NETWORK) && (argc > 4)) { +- Tcl_SetResult(interp, argv[4], TCL_VOLATILE); ++ Tcl_SetResult(interp, (char *)argv[4], TCL_VOLATILE); + } + return TCL_OK; + + } else if ((strcmp(cmd, "links") == 0) && (argc > 5)) { + if ((type == TKINED_NODE) || (type == TKINED_NETWORK)) +- Tcl_SetResult(interp, argv[5], TCL_VOLATILE); ++ Tcl_SetResult(interp, (char *)argv[5], TCL_VOLATILE); + return TCL_OK; + + } else if ((strcmp(cmd, "member") == 0) && (argc > 4)) { + if (type == TKINED_GROUP) +- Tcl_SetResult(interp, argv[4], TCL_VOLATILE); ++ Tcl_SetResult(interp, (char *)argv[4], TCL_VOLATILE); + return TCL_OK; + + } else if ((strcmp(cmd, "src") == 0) && (argc > 2)) { + if (type == TKINED_LINK) +- Tcl_SetResult(interp, argv[2], TCL_VOLATILE); ++ Tcl_SetResult(interp, (char *)argv[2], TCL_VOLATILE); + return TCL_OK; + + } else if ((strcmp(cmd, "dst") == 0) && (argc > 3)) { + if (type == TKINED_LINK) +- Tcl_SetResult(interp, argv[3], TCL_VOLATILE); ++ Tcl_SetResult(interp, (char *)argv[3], TCL_VOLATILE); + return TCL_OK; + + } else if ((strcmp(cmd, "text") == 0) && (argc > 2)) { + if (type == TKINED_LINK) +- Tcl_SetResult(interp, argv[2], TCL_VOLATILE); ++ Tcl_SetResult(interp, (char *)argv[2], TCL_VOLATILE); + return TCL_OK; + + } +@@ -559,11 +562,11 @@ Tnm_InedCmd(clientData, interp, argc, ar + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Tcl_Channel channel; + int i; +- char *p; ++ const char *p; + static int initialized = 0; + + if (! initialized) { +@@ -600,7 +603,7 @@ Tnm_InedCmd(clientData, interp, argc, ar + + if (argc == 3) { + int largc; +- char **largv; ++ const char **largv; + int rc = Tcl_SplitList(interp, argv[2], &largc, &largv); + if (rc == TCL_OK && largc > 0) { + if (InedCompCmd(argv[1], interp, largc, largv) == TCL_OK) { +@@ -651,15 +654,15 @@ Tnm_InedCmd(clientData, interp, argc, ar + while ((p = InedGets(interp)) != (char *) NULL) { + if (*p == '\0') continue; + if (strncmp(p, "ined ok", 7) == 0) { +- char *r = p+7; ++ const char *r = p+7; + while (*r && isspace(*r)) r++; +- Tcl_SetResult(interp, r, TCL_VOLATILE); ++ Tcl_SetResult(interp, (char*)r, TCL_VOLATILE); + ckfree(p); + return TCL_OK; + } else if (strncmp(p, "ined error", 10) == 0) { +- char *r = p+10; ++ const char *r = p+10; + while (*r && isspace(*r)) r++; +- Tcl_SetResult(interp, r, TCL_VOLATILE); ++ Tcl_SetResult(interp, (char*)r, TCL_VOLATILE); + ckfree(p); + return TCL_ERROR; + } else { diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmInit.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmInit.c new file mode 100644 index 00000000000..89ea38e848a --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmInit.c @@ -0,0 +1,82 @@ +$NetBSD: patch-tnm_generic_tnmInit.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. +Do not encode OS version in path for library. + +--- tnm/generic/tnmInit.c.orig 1999-03-05 22:32:26.000000000 +0000 ++++ tnm/generic/tnmInit.c +@@ -52,7 +52,8 @@ static void + InitVars(interp) + Tcl_Interp *interp; + { +- char *machine, *os, *vers, *user, *tmp, *p, *path, *cacheName; ++ const char *machine, *os; ++ char *vers, *user, *tmp, *p, *path, *cacheName; + Tcl_DString arch, cache, dst; + + path = getenv("TNM_LIBRARY"); +@@ -106,15 +107,12 @@ InitVars(interp) + + machine = Tcl_GetVar2(interp, "tcl_platform", "machine", TCL_GLOBAL_ONLY); + os = Tcl_GetVar2(interp, "tcl_platform", "os", TCL_GLOBAL_ONLY); +- vers = Tcl_GetVar2(interp, "tcl_platform", "osVersion", TCL_GLOBAL_ONLY); + + Tcl_DStringInit(&arch); +- if (machine && os && vers) { ++ if (machine && os) { + Tcl_DStringAppend(&arch, machine, -1); + Tcl_DStringAppend(&arch, "-", 1); + Tcl_DStringAppend(&arch, os, -1); +- Tcl_DStringAppend(&arch, "-", 1); +- Tcl_DStringAppend(&arch, vers, -1); + } else { + Tcl_DStringAppend(&arch, "unknown-os", -1); + } +@@ -192,8 +190,8 @@ static int + InitRc(interp) + Tcl_Interp *interp; + { +- char *fileName, *library; +- char **libArgv = NULL; ++ const char *fileName, *library; ++ const char **libArgv = NULL; + int libArgc; + + library = Tcl_GetVar2(interp, "tnm", "library", TCL_GLOBAL_ONLY); +@@ -204,7 +202,8 @@ InitRc(interp) + if (library) { + + int tmpArgc; +- char **tmpArgv = (char **) ckalloc((libArgc + 4) * sizeof(char *)); ++ const char **tmpArgv = (const char **) ckalloc((libArgc + 4) * ++ sizeof(char *)); + Tcl_DString buffer; + + Tcl_DStringInit(&buffer); +@@ -237,7 +236,7 @@ InitRc(interp) + + if (fileName) { + if (Tcl_EvalFile(interp, fileName) != TCL_OK) { +- TnmWriteMessage(interp, interp->result); ++ TnmWriteMessage(interp, Tcl_GetStringResult(interp)); + TnmWriteMessage(interp, "\n"); + } + } +@@ -272,7 +271,7 @@ InitRc(interp) + Tcl_DStringInit(&temp); + fullName = Tcl_TranslateFileName(interp, fileName, &temp); + if (fullName == NULL) { +- TnmWriteMessage(interp, interp->result); ++ TnmWriteMessage(interp, Tcl_GetStringResult(interp)); + TnmWriteMessage(interp, "\n"); + } else { + Tcl_Channel channel; +@@ -280,7 +279,7 @@ InitRc(interp) + if (channel) { + Tcl_Close((Tcl_Interp *) NULL, channel); + if (Tcl_EvalFile(interp, fullName) != TCL_OK) { +- TnmWriteMessage(interp, interp->result); ++ TnmWriteMessage(interp, Tcl_GetStringResult(interp)); + TnmWriteMessage(interp, "\n"); + } + } diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmInt.h b/net/tcl-scotty/patches/patch-tnm_generic_tnmInt.h new file mode 100644 index 00000000000..ae9f12867d9 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmInt.h @@ -0,0 +1,130 @@ +$NetBSD: patch-tnm_generic_tnmInt.h,v 1.1 2014/03/05 13:52:29 he Exp $ + +Make own TnmCreateDirectory. +Constify. + +--- tnm/generic/tnmInt.h.orig 1999-03-23 18:08:59.000000000 +0100 ++++ tnm/generic/tnmInt.h 2014-03-05 09:22:28.000000000 +0100 +@@ -36,7 +36,6 @@ + #define TnmGetTime TclpGetTime + #endif + +-#define TnmCreateDirectory TclpCreateDirectory + #if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 8 && TCL_RELEASE_SERIAL > 2 + #define TnmStat TclStat + #else +@@ -54,7 +53,7 @@ + TclpGetTime _ANSI_ARGS_((Tcl_Time *timePtr)); + + EXTERN int +-TnmCreateDirectory _ANSI_ARGS_((char *path)); ++TnmCreateDirectory _ANSI_ARGS_((const char *path)); + + EXTERN int + TnmStat _ANSI_ARGS_((CONST char *path, struct stat *buf)); +@@ -93,7 +92,7 @@ + TnmGetTableValue _ANSI_ARGS_((TnmTable *table, unsigned key)); + + EXTERN int +-TnmGetTableKey _ANSI_ARGS_((TnmTable *table, char *value)); ++TnmGetTableKey _ANSI_ARGS_((TnmTable *table, const char *value)); + + EXTERN char * + TnmGetTableValues _ANSI_ARGS_((TnmTable *table)); +@@ -106,10 +105,10 @@ + *---------------------------------------------------------------- + */ + +-typedef char * (TnmGetConfigProc) _ANSI_ARGS_((Tcl_Interp *interp, ++typedef const char * (TnmGetConfigProc) _ANSI_ARGS_((Tcl_Interp *interp, + ClientData clientData, int option)); + typedef int (TnmSetConfigProc) _ANSI_ARGS_((Tcl_Interp *interp, +- ClientData clientData, int option, char *value)); ++ ClientData clientData, int option, const char *value)); + + typedef struct TnmConfig { + TnmTable *optionTable; +@@ -119,10 +118,12 @@ + + EXTERN int + TnmSetConfig _ANSI_ARGS_((Tcl_Interp *interp, TnmConfig *config, +- ClientData obj, int argc, char **argv)); ++ ClientData obj, int argc, ++ const char **argv)); + EXTERN int + TnmGetConfig _ANSI_ARGS_((Tcl_Interp *interp, TnmConfig *config, +- ClientData obj, int argc, char **argv)); ++ ClientData obj, int argc, ++ const char **argv)); + + /* + *---------------------------------------------------------------- +@@ -132,28 +133,29 @@ + */ + + EXTERN int +-TnmGetUnsigned _ANSI_ARGS_((Tcl_Interp *interp, char *string, ++TnmGetUnsigned _ANSI_ARGS_((Tcl_Interp *interp, const char *string, + int *intPtr)); + EXTERN int +-TnmGetPositive _ANSI_ARGS_((Tcl_Interp *interp, char *string, ++TnmGetPositive _ANSI_ARGS_((Tcl_Interp *interp, const char *string, + int *intPtr)); + EXTERN int +-TnmSetIPAddress _ANSI_ARGS_((Tcl_Interp *interp, char *name, ++TnmSetIPAddress _ANSI_ARGS_((Tcl_Interp *interp, const char *name, + struct sockaddr_in *addr)); + EXTERN char * + TnmGetIPName _ANSI_ARGS_((Tcl_Interp *interp, + struct sockaddr_in *addr)); + EXTERN int +-TnmSetIPPort _ANSI_ARGS_((Tcl_Interp *interp, char *protocol, +- char *port, struct sockaddr_in *addr)); ++TnmSetIPPort _ANSI_ARGS_((Tcl_Interp *interp, const char *protocol, ++ const char *port, ++ struct sockaddr_in *addr)); + EXTERN char * +-TnmGetIPPort _ANSI_ARGS_((Tcl_Interp *interp, char *protocol, ++TnmGetIPPort _ANSI_ARGS_((Tcl_Interp *interp, const char *protocol, + struct sockaddr_in *addr)); + EXTERN int +-TnmValidateIpHostName _ANSI_ARGS_((Tcl_Interp *interp, char *name)); ++TnmValidateIpHostName _ANSI_ARGS_((Tcl_Interp *interp, const char *name)); + + EXTERN int +-TnmValidateIpAddress _ANSI_ARGS_((Tcl_Interp *interp, char *address)); ++TnmValidateIpAddress _ANSI_ARGS_((Tcl_Interp *interp, const char *address)); + + /* + *---------------------------------------------------------------- +@@ -175,10 +177,10 @@ + + EXTERN int + TnmWriteLogMessage _ANSI_ARGS_((Tcl_Interp *interp, int level, +- char *message)); ++ const char *message)); + + EXTERN void +-TnmWriteMessage _ANSI_ARGS_((Tcl_Interp *interp, char *msg)); ++TnmWriteMessage _ANSI_ARGS_((Tcl_Interp *interp, const char *msg)); + + /* + *---------------------------------------------------------------- +@@ -215,7 +217,7 @@ + int delay; /* The delay value (ms) for this request. */ + int size; /* The size of the ICMP packet. */ + int argc; /* The number of targets for this request. */ +- char **argv; /* The names of the targets. */ ++ const char **argv; /* The names of the targets. */ + TnmIcmpTarget *targets; /* The vector of targets. */ + struct TnmIcmpRequest *nextPtr; /* Next queued request. */ + } TnmIcmpRequest; +@@ -242,7 +244,7 @@ + TnmSocketBind _ANSI_ARGS_((int s, struct sockaddr *name, + int namelen)); + EXTERN int +-TnmSocketSendTo _ANSI_ARGS_((int s, char *buf, int len, int flags, ++TnmSocketSendTo _ANSI_ARGS_((int s, const char *buf, int len, int flags, + struct sockaddr *to, int tolen)); + EXTERN int + TnmSocketRecvFrom _ANSI_ARGS_((int s, char *buf, int len, int flags, diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmJob.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmJob.c new file mode 100644 index 00000000000..29f03cfd320 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmJob.c @@ -0,0 +1,113 @@ +$NetBSD: patch-tnm_generic_tnmJob.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/generic/tnmJob.c~ 1999-12-02 09:52:56.000000000 +0100 ++++ tnm/generic/tnmJob.c 2014-03-05 10:06:11.000000000 +0100 +@@ -96,20 +96,20 @@ + Schedule _ANSI_ARGS_((Tcl_Interp *interp, JobControl *control)); + + static int +-CreateJob _ANSI_ARGS_((Tcl_Interp *interp, int argc, char **argv)); ++CreateJob _ANSI_ARGS_((Tcl_Interp *interp, int argc, const char **argv)); + + static int + Attributes _ANSI_ARGS_((Job *jobPtr, Tcl_Interp *interp, +- int argc, char **argv)); +-static char * ++ int argc, const char **argv)); ++static const char * + GetOption _ANSI_ARGS_((Tcl_Interp *interp, ClientData object, + int option)); + static int + SetOption _ANSI_ARGS_((Tcl_Interp *interp, ClientData object, +- int option, char *value)); ++ int option, const char *value)); + static int + JobCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + + /* + * The options used to configure job objects. +@@ -481,7 +481,7 @@ + repeat: + for (jobPtr = control->jobList; jobPtr != NULL; jobPtr = jobPtr->nextPtr) { + if (jobPtr->status == TNM_JOB_EXPIRED) { +- char *name = Tcl_GetCommandName(interp, jobPtr->token); ++ const char *name = Tcl_GetCommandName(interp, jobPtr->token); + #if 0 + char cmd[40]; + sprintf(cmd, "event raise %s", name); +@@ -523,7 +523,7 @@ + CreateJob(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + static unsigned lastid = 0; + Job *jobPtr, *p; +@@ -603,7 +603,7 @@ + Job *jobPtr; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Tcl_HashTable *tablePtr = &(jobPtr->attributes); + Tcl_HashEntry *entryPtr; +@@ -655,7 +655,7 @@ + *---------------------------------------------------------------------- + */ + +-static char * ++static const char * + GetOption(interp, object, option) + Tcl_Interp *interp; + ClientData object; +@@ -709,7 +709,7 @@ + Tcl_Interp *interp; + ClientData object; + int option; +- char *value; ++ const char *value; + { + Job *jobPtr = (Job *) object; + int num, status; +@@ -783,7 +783,7 @@ + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + int result = TCL_OK; + Job *job = (Job *) clientData; +@@ -831,7 +831,7 @@ + if (control) { + repeat: + for (job = control->jobList; job; job = job->nextPtr) { +- char *name = Tcl_GetCommandName(interp, job->token); ++ const char *name = Tcl_GetCommandName(interp, job->token); + if (job->status == TNM_JOB_WAITING + && (strcmp(name, argv[0]) == 0)) { + Tcl_DoOneEvent(0); +@@ -878,7 +878,7 @@ + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Job *job; + JobControl *control = (JobControl *) +@@ -914,7 +914,7 @@ + } + if (currentJob && currentJob->interp == interp) { + Tcl_SetResult(interp, +- Tcl_GetCommandName(interp, currentJob->token), ++ (char*)Tcl_GetCommandName(interp, currentJob->token), + TCL_VOLATILE); + } + return TCL_OK; diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmNetdb.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmNetdb.c new file mode 100644 index 00000000000..5ae2762740d --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmNetdb.c @@ -0,0 +1,138 @@ +$NetBSD: patch-tnm_generic_tnmNetdb.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Avoid use of interp->result. +Constify. + +--- tnm/generic/tnmNetdb.c.orig 1998-09-23 16:47:43.000000000 +0200 ++++ tnm/generic/tnmNetdb.c 2014-03-04 18:05:58.000000000 +0100 +@@ -36,22 +36,22 @@ + + static int + NetdbHosts _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + NetdbIp _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + NetdbNetworks _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + NetdbProtocols _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + NetdbServices _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + NetdbSunrpcs _ANSI_ARGS_((Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + + + /* +@@ -75,7 +75,7 @@ + NetdbHosts(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + /* + * Process the "netdb hosts" command option: +@@ -177,7 +177,7 @@ + NetdbIp(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + struct in_addr ipaddr; + +@@ -289,7 +289,7 @@ + NetdbNetworks(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + /* + * Process the "netdb networks" command option: +@@ -399,8 +399,10 @@ + NetdbProtocols(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { ++ char res[20]; ++ + /* + * Process the "netdb protocols" command option: + */ +@@ -462,7 +464,8 @@ + (char *) NULL); + return TCL_ERROR; + } +- sprintf(interp->result, "%d", proto->p_proto); ++ sprintf(res, "%d", proto->p_proto); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_OK; + } + +@@ -492,8 +495,10 @@ + NetdbServices(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { ++ char res[20]; ++ + /* + * Process the "netdb services" command option: + */ +@@ -554,7 +559,8 @@ + if (TnmSetIPPort(interp, argv[4], argv[3], &addr) != TCL_OK) { + return TCL_ERROR; + } +- sprintf(interp->result, "%d", ntohs(addr.sin_port)); ++ sprintf(res, "%d", ntohs(addr.sin_port)); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_OK; + } + +@@ -584,8 +590,10 @@ + NetdbSunrpcs(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { ++ char res[20]; ++ + /* + * Process the "netdb sunrpcs" command option: + */ +@@ -649,7 +657,8 @@ + (char *) NULL); + return TCL_ERROR; + } +- sprintf(interp->result, "%d", rpc->r_number); ++ sprintf(res, "%d", rpc->r_number); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_OK; + } + +@@ -680,7 +689,7 @@ + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + if (argc < 2) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmNtp.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmNtp.c new file mode 100644 index 00000000000..6a1df39a233 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmNtp.c @@ -0,0 +1,68 @@ +$NetBSD: patch-tnm_generic_tnmNtp.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Avoid use of interp->result. +Constify. + +--- tnm/generic/tnmNtp.c~ 1996-09-18 23:33:54.000000000 +0200 ++++ tnm/generic/tnmNtp.c 2014-03-04 16:04:08.000000000 +0100 +@@ -74,7 +74,7 @@ + int op, int retries, int timeo, + char *buf, int assoc)); + static int +-NtpSplit _ANSI_ARGS_((Tcl_Interp *interp, char *varname, ++NtpSplit _ANSI_ARGS_((Tcl_Interp *interp, const char *varname, + char *pfix, char *buf)); + static int + NtpGetPeer _ANSI_ARGS_((char *data, int *assoc)); +@@ -349,11 +349,12 @@ + static int + NtpSplit(interp, varname, pfix, buf) + Tcl_Interp *interp; +- char *varname; ++ const char *varname; + char *pfix; + char *buf; + { +- char *d, *s, *g, *r; ++ char *d, *s, *g; ++ const char *r; + char var [256]; + + for (s = buf, d = buf; *s; s++) { +@@ -440,9 +441,9 @@ + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char *argv[]; ++ const char *argv[]; + { +- char *cmd = argv[0]; ++ const char *cmd = argv[0]; + struct sockaddr_in daddr; + int code, assoc; + char data1 [1024], data2 [1024]; +@@ -472,10 +473,13 @@ + argc--; argv++; + + while (argc > 0 && (*argv[0] == '-')) { ++ char res[20]; ++ + if (strcmp(argv [0], "-retries") == 0) { + argc--, argv++; + if (argc < 1) { +- sprintf(interp->result, "%d", control->retries); ++ sprintf(res, "%d", control->retries); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_OK; + } + if (TnmGetUnsigned(interp, argv[0], &actRetries) != TCL_OK) { +@@ -484,7 +488,8 @@ + } else if (strcmp(argv [0], "-timeout") == 0) { + argc--, argv++; + if (argc < 1) { +- sprintf(interp->result, "%d", control->timeout); ++ sprintf(res, "%d", control->timeout); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_OK; + } + if (TnmGetPositive(interp, argv [0], &actTimeout) != TCL_OK) { diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmRpc.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmRpc.c new file mode 100644 index 00000000000..3bbe5a0f54a --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmRpc.c @@ -0,0 +1,24 @@ +$NetBSD: patch-tnm_generic_tnmRpc.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/generic/tnmRpc.c~ 1997-12-23 09:49:11.000000000 +0100 ++++ tnm/generic/tnmRpc.c 2014-03-04 14:14:17.000000000 +0100 +@@ -263,7 +263,7 @@ + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + return TCL_OK; + } +@@ -1152,7 +1152,7 @@ + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + int len; + diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmSunRpc.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmSunRpc.c new file mode 100644 index 00000000000..047063fb02b --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmSunRpc.c @@ -0,0 +1,296 @@ +$NetBSD: patch-tnm_generic_tnmSunRpc.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Avoid use of interp->result. +Constify. + +--- tnm/generic/tnmSunRpc.c~ 1996-10-23 12:26:17.000000000 +0200 ++++ tnm/generic/tnmSunRpc.c 2014-03-04 15:59:47.000000000 +0100 +@@ -84,52 +84,52 @@ + SunrpcError _ANSI_ARGS_((Tcl_Interp *interp, int res)); + + static char* +-SunrpcGetHostname _ANSI_ARGS_((Tcl_Interp *interp, char *str)); ++SunrpcGetHostname _ANSI_ARGS_((Tcl_Interp *interp, const char *str)); + + static int +-SunrpcOpenEtherd _ANSI_ARGS_((Tcl_Interp *interp, char *host)); ++SunrpcOpenEtherd _ANSI_ARGS_((Tcl_Interp *interp, const char *host)); + + static int +-SunrpcCloseEtherd _ANSI_ARGS_((Tcl_Interp *interp, char *host)); ++SunrpcCloseEtherd _ANSI_ARGS_((Tcl_Interp *interp, const char *host)); + + static int +-SunrpcEtherd _ANSI_ARGS_((Tcl_Interp *interp, char *host)); ++SunrpcEtherd _ANSI_ARGS_((Tcl_Interp *interp, const char *host)); + + static int +-SunrpcRstat _ANSI_ARGS_((Tcl_Interp *interp, char *host)); ++SunrpcRstat _ANSI_ARGS_((Tcl_Interp *interp, const char *host)); + + static int +-SunrpcInfo _ANSI_ARGS_((Tcl_Interp *interp, char *host)); ++SunrpcInfo _ANSI_ARGS_((Tcl_Interp *interp, const char *host)); + + static int +-SunrpcMount _ANSI_ARGS_((Tcl_Interp *interp, char *host)); ++SunrpcMount _ANSI_ARGS_((Tcl_Interp *interp, const char *host)); + + static int +-SunrpcExports _ANSI_ARGS_((Tcl_Interp *interp, char *host)); ++SunrpcExports _ANSI_ARGS_((Tcl_Interp *interp, const char *host)); + + static int +-SunrpcProbe _ANSI_ARGS_((Tcl_Interp *interp, char *host, ++SunrpcProbe _ANSI_ARGS_((Tcl_Interp *interp, const char *host, + unsigned long prognum, + unsigned long version, + unsigned protocol)); + #if 0 + static int +-SunrpcQuota _ANSI_ARGS_((Tcl_Interp *interp, char *host, +- char *user)); ++SunrpcQuota _ANSI_ARGS_((Tcl_Interp *interp, const char *host, ++ const char *user)); + #endif + + static int +-PcnfsInfo _ANSI_ARGS_((Tcl_Interp *interp, char *host, ++PcnfsInfo _ANSI_ARGS_((Tcl_Interp *interp, const char *host, + char *array)); + static int +-PcnfsQueue _ANSI_ARGS_((Tcl_Interp *interp, char *host, +- char *printer, char *array)); ++PcnfsQueue _ANSI_ARGS_((Tcl_Interp *interp, const char *host, ++ const char *printer, char *array)); + static int +-PcnfsList _ANSI_ARGS_((Tcl_Interp *interp, char *host, ++PcnfsList _ANSI_ARGS_((Tcl_Interp *interp, const char *host, + char *array)); + static int +-PcnfsStatus _ANSI_ARGS_((Tcl_Interp *interp, char *host, +- char *printer, char *array)); ++PcnfsStatus _ANSI_ARGS_((Tcl_Interp *interp, const char *host, ++ const char *printer, char *array)); + + + /* +@@ -208,7 +208,7 @@ + static char* + SunrpcGetHostname(interp, str) + Tcl_Interp *interp; +- char *str; ++ const char *str; + { + struct sockaddr_in addr; + +@@ -238,7 +238,7 @@ + static int + SunrpcOpenEtherd(interp, host) + Tcl_Interp *interp; +- char *host; ++ const char *host; + { + int dummy; + CLIENT *clnt; +@@ -312,7 +312,7 @@ + static int + SunrpcCloseEtherd(interp, host) + Tcl_Interp *interp; +- char *host; ++ const char *host; + { + int dummy; + EtherClient *p; +@@ -365,7 +365,7 @@ + static int + SunrpcEtherd(interp, host) + Tcl_Interp *interp; +- char *host; ++ const char *host; + { + int dummy, tdiff, i; + EtherClient *p; +@@ -473,7 +473,7 @@ + static int + SunrpcRstat(interp, host) + Tcl_Interp *interp; +- char *host; ++ const char *host; + { + struct statstime statp; + struct timeval timeout; +@@ -583,7 +583,7 @@ + static int + SunrpcInfo(interp, host) + Tcl_Interp *interp; +- char *host; ++ const char *host; + { + struct sockaddr_in _addr; + struct sockaddr_in *addr = &_addr; +@@ -630,7 +630,7 @@ + static int + SunrpcMount(interp, host) + Tcl_Interp *interp; +- char *host; ++ const char *host; + { + mountlist ml = NULL; + struct timeval timeout; +@@ -691,7 +691,7 @@ + static int + SunrpcExports(interp, host) + Tcl_Interp *interp; +- char *host; ++ const char *host; + { + exports ex = NULL; + groups gr; +@@ -775,7 +775,7 @@ + static int + SunrpcProbe(interp, host, prognum, version, protocol) + Tcl_Interp *interp; +- char *host; ++ const char *host; + unsigned long prognum; + unsigned long version; + unsigned protocol; +@@ -800,7 +800,7 @@ + } + + if ((protocol != IPPROTO_UDP) && (protocol != IPPROTO_TCP)) { +- interp->result = "unknown protocol"; ++ Tcl_SetResult(interp, "unknown protocol", TCL_STATIC); + return TCL_ERROR; + } + +@@ -847,8 +847,8 @@ + static int + SunrpcQuota(interp, host, user) + Tcl_Interp *interp; +- char *host; +- char *user; ++ const char *host; ++ const char *user; + { + struct sockaddr_in _addr; + struct sockaddr_in *addr = &_addr; +@@ -914,7 +914,7 @@ + static int + PcnfsInfo(interp, host, array) + Tcl_Interp *interp; +- char *host; ++ const char *host; + char *array; + { + struct sockaddr_in _addr; +@@ -1012,8 +1012,8 @@ + static int + PcnfsQueue(interp, host, printer, array) + Tcl_Interp *interp; +- char *host; +- char *printer; ++ const char *host; ++ const char *printer; + char *array; + { + struct sockaddr_in _addr; +@@ -1024,9 +1024,10 @@ + v2_pr_queue_results *pr_qr; + v2_pr_queue_args pr_args; + pr_queue_item *pr_item; ++ char res[20]; + +- pr_args.pn = printer; +- pr_args.system = host; ++ pr_args.pn = (char*)printer; ++ pr_args.system = (char*) host; + pr_args.user = "doug"; + pr_args.just_mine = FALSE; + pr_args.cm = ""; +@@ -1109,7 +1110,9 @@ + } + } + } +- sprintf(interp->result, "%d", pr_qr->qlen); ++ ++ sprintf(res, "%d", pr_qr->qlen); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + } + + return TCL_OK; +@@ -1134,7 +1137,7 @@ + static int + PcnfsList(interp, host, array) + Tcl_Interp *interp; +- char *host; ++ const char *host; + char *array; + { + struct sockaddr_in _addr; +@@ -1219,8 +1222,8 @@ + static int + PcnfsStatus(interp, host, printer, array) + Tcl_Interp *interp; +- char *host; +- char *printer; ++ const char *host; ++ const char *printer; + char *array; + { + struct sockaddr_in _addr; +@@ -1231,7 +1234,7 @@ + v2_pr_status_args pr_stat; + v2_pr_status_results *pr_sr; + +- pr_stat.pn = printer; ++ pr_stat.pn = (char*)printer; + pr_stat.cm = ""; + + timeout.tv_sec = 5; timeout.tv_usec = 0; +@@ -1317,7 +1320,7 @@ + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + if (argc < 3) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], +@@ -1366,7 +1369,7 @@ + return TCL_ERROR; + } + +- return PcnfsInfo(interp, argv[2], argv[4]); ++ return PcnfsInfo(interp, argv[2], (char*)argv[4]); + + } else if (strcmp(argv[3], "list") == 0) { + if (argc < 4 || argc > 5) { +@@ -1376,7 +1379,7 @@ + return TCL_ERROR; + } + +- return PcnfsList(interp, argv[2], argv[4]); ++ return PcnfsList(interp, argv[2], (char*)argv[4]); + + } else if (strcmp(argv[3], "status") == 0) { + if (argc != 6) { +@@ -1386,7 +1389,7 @@ + return TCL_ERROR; + } + +- return PcnfsStatus(interp, argv[2], argv[4], argv[5]); ++ return PcnfsStatus(interp, argv[2], argv[4], (char*)argv[5]); + + } else if (strcmp (argv[3], "queue") == 0) { + if (argc < 5 || argc > 6) { +@@ -1396,7 +1399,7 @@ + return TCL_ERROR; + } + +- return PcnfsQueue(interp, argv[2], argv[4], argv[5]); ++ return PcnfsQueue(interp, argv[2], argv[4], (char*)argv[5]); + + } else { + Tcl_AppendResult(interp, "bad option \"", argv[3], diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmSyslog.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmSyslog.c new file mode 100644 index 00000000000..45e0492f1f1 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmSyslog.c @@ -0,0 +1,15 @@ +$NetBSD: patch-tnm_generic_tnmSyslog.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/generic/tnmSyslog.c~ 1996-07-31 08:37:31.000000000 +0200 ++++ tnm/generic/tnmSyslog.c 2014-03-04 16:04:23.000000000 +0100 +@@ -47,7 +47,7 @@ + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + int level; + diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmUdp.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmUdp.c new file mode 100644 index 00000000000..1e937eeec64 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmUdp.c @@ -0,0 +1,203 @@ +$NetBSD: patch-tnm_generic_tnmUdp.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Correct typo. +Constify. + +--- tnm/generic/tnmUdp.c.orig 2000-07-06 11:47:02.000000000 +0200 ++++ tnm/generic/tnmUdp.c 2014-03-04 15:49:15.000000000 +0100 +@@ -40,33 +40,33 @@ + UdpEventProc _ANSI_ARGS_((ClientData clientData, int mask)); + + static Socket* +-UdpSocket _ANSI_ARGS_((Tcl_Interp *interp, char *fileId)); ++UdpSocket _ANSI_ARGS_((Tcl_Interp *interp, const char *fileId)); + + static int +-UdpOpen _ANSI_ARGS_((Tcl_Interp *interp, int argc, char **argv)); ++UdpOpen _ANSI_ARGS_((Tcl_Interp *interp, int argc, const char **argv)); + + static int +-UdpConnect _ANSI_ARGS_((Tcl_Interp *interp, int argc, char **argv)); ++UdpConnect _ANSI_ARGS_((Tcl_Interp *interp, int argc, const char **argv)); + + static int +-UdpSend _ANSI_ARGS_((Tcl_Interp *interp, int argc, char **argv)); ++UdpSend _ANSI_ARGS_((Tcl_Interp *interp, int argc, const char **argv)); + + static int +-UdpReceive _ANSI_ARGS_((Tcl_Interp *interp, int argc, char **argv)); ++UdpReceive _ANSI_ARGS_((Tcl_Interp *interp, int argc, const char **argv)); + + static int +-UdpClose _ANSI_ARGS_((Tcl_Interp *interp, int argc, char **argv)); ++UdpClose _ANSI_ARGS_((Tcl_Interp *interp, int argc, const char **argv)); + + #ifdef HAVE_MULTICAST + static int +-UdpMulticast _ANSI_ARGS_((Tcl_Interp *interp, int argc, char **argv)); ++UdpMulticast _ANSI_ARGS_((Tcl_Interp *interp, int argc, const char **argv)); + #endif + + static int +-UdpInfo _ANSI_ARGS_((Tcl_Interp *interp, int argc, char **argv)); ++UdpInfo _ANSI_ARGS_((Tcl_Interp *interp, int argc, const char **argv)); + + static int +-UdpBind _ANSI_ARGS_((Tcl_Interp *interp, int argc, char **argv)); ++UdpBind _ANSI_ARGS_((Tcl_Interp *interp, int argc, const char **argv)); + + /* + * Procedure to be called by the event dispatcher whenever a UDP +@@ -111,7 +111,7 @@ + static Socket * + UdpSocket(interp, name) + Tcl_Interp *interp; +- char *name; ++ const char *name; + { + Tcl_HashEntry *entryPtr; + Socket *usock; +@@ -136,12 +136,12 @@ + UdpOpen(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + int sock, isNew, code; + struct sockaddr_in name; + Socket *usock; +- char *port = "0"; ++ const char *port = "0"; + Tcl_HashEntry *entryPtr; + + if (argc < 2 || argc > 3) { +@@ -200,7 +200,7 @@ + UdpConnect(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + int sock, isNew; + Socket *usock; +@@ -259,7 +259,7 @@ + UdpSend(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + struct sockaddr_in name; + Socket *usock; +@@ -333,7 +333,7 @@ + UdpReceive(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Socket *usock; + int sock; +@@ -403,7 +403,7 @@ + UdpClose(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Tcl_HashEntry *entryPtr; + Socket *usock; +@@ -454,7 +454,7 @@ + UdpInfo(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Socket *usock; + +@@ -476,7 +476,7 @@ + } + + } else { +- ++ char res[128]; + int sock, rc; + struct sockaddr_in server; + int length = sizeof(server); +@@ -489,15 +489,17 @@ + + rc = getsockname(sock, (struct sockaddr *) &server, &length); + if (rc == 0) { +- sprintf(interp->result, "%s %d ", ++ sprintf(res, "%s %d ", + inet_ntoa(server.sin_addr), + (int) ntohs(server.sin_port)); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + } else { +- sprintf(interp->result, "{} {} "); ++ Tcl_SetResult(interp, "{} {} ", TCL_STATIC); + } +- sprintf(interp->result+strlen(interp->result), "%s %d", ++ sprintf(res, "%s %d", + inet_ntoa(usock->client.sin_addr), + (int) ntohs(usock->client.sin_port)); ++ Tcl_AppendResult(interp, res, NULL); + } + + return TCL_OK; +@@ -512,7 +514,7 @@ + UdpBind(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + int mask = 0; + Socket *usock; +@@ -570,7 +572,7 @@ + UdpMulticast(interp, argc, argv) + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + Socket* usock; + struct ip_mreq mreq; +@@ -578,6 +580,7 @@ + int tmp, optlen, sock, isNew, code; + unsigned char ttl; + Tcl_HashEntry *entryPtr; ++ char res[20]; + + if (argc < 3) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], +@@ -622,7 +625,8 @@ + return TCL_ERROR; + } + tmp = ttl; +- sprintf(interp->result, "%d", tmp); ++ sprintf(res, "%d", tmp); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_OK; + + } else if (strcmp(argv[2], "open") == 0) { +@@ -643,7 +647,7 @@ + } + + mreq.imr_multiaddr.s_addr = name.sin_addr.s_addr; +- name.imr_interface.s_addr = htonl(INADDR_ANY); ++ mreq.imr_interface.s_addr = htonl(INADDR_ANY); + + sock = TnmSocket(PF_INET, SOCK_DGRAM, 0); + if (sock == TNM_SOCKET_ERROR) { +@@ -732,7 +736,7 @@ + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + char c; + diff --git a/net/tcl-scotty/patches/patch-tnm_generic_tnmUtil.c b/net/tcl-scotty/patches/patch-tnm_generic_tnmUtil.c new file mode 100644 index 00000000000..68516ced20d --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_generic_tnmUtil.c @@ -0,0 +1,160 @@ +$NetBSD: patch-tnm_generic_tnmUtil.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. +Implement TnmCreateDirectory. + +--- tnm/generic/tnmUtil.c.orig 1999-03-08 08:42:26.000000000 +0000 ++++ tnm/generic/tnmUtil.c +@@ -70,7 +70,7 @@ TnmGetTableValue(table, key) + int + TnmGetTableKey(table, value) + TnmTable *table; +- char *value; ++ const char *value; + { + TnmTable *elemPtr; + +@@ -188,7 +188,7 @@ TnmSetConfig(interp, config, object, arg + TnmConfig *config; + ClientData object; + int argc; +- char **argv; ++ const char **argv; + { + int i, option, code; + TnmTable *elemPtr; +@@ -274,7 +274,7 @@ TnmGetConfig(interp, config, object, arg + TnmConfig *config; + ClientData object; + int argc; +- char **argv; ++ const char **argv; + { + int option; + char *value; +@@ -326,7 +326,7 @@ TnmGetConfig(interp, config, object, arg + int + TnmGetUnsigned(interp, string, intPtr) + Tcl_Interp *interp; +- char *string; ++ const char *string; + int *intPtr; + { + if (Tcl_GetInt(interp, string, intPtr) != TCL_OK) { +@@ -361,7 +361,7 @@ TnmGetUnsigned(interp, string, intPtr) + int + TnmGetPositive(interp, string, intPtr) + Tcl_Interp *interp; +- char *string; ++ const char *string; + int *intPtr; + { + if (Tcl_GetInt(interp, string, intPtr) != TCL_OK) { +@@ -400,7 +400,7 @@ TnmGetPositive(interp, string, intPtr) + int + TnmSetIPAddress(interp, host, addr) + Tcl_Interp *interp; +- char *host; ++ const char *host; + struct sockaddr_in *addr; + { + static Tcl_HashTable *hostTable = NULL; +@@ -585,8 +585,8 @@ TnmGetIPName(interp, addr) + int + TnmSetIPPort(interp, protocol, port, addr) + Tcl_Interp *interp; +- char *protocol; +- char *port; ++ const char *protocol; ++ const char *port; + struct sockaddr_in* addr; + { + if (strcmp(protocol, "udp") != 0 && strcmp(protocol, "tcp") != 0) { +@@ -642,7 +642,7 @@ TnmSetIPPort(interp, protocol, port, add + char * + TnmGetIPPort(interp, protocol, addr) + Tcl_Interp *interp; +- char *protocol; ++ const char *protocol; + struct sockaddr_in *addr; + { + struct servent *serv; +@@ -697,9 +697,10 @@ TnmGetIPPort(interp, protocol, addr) + int + TnmValidateIpHostName(interp, name) + Tcl_Interp *interp; +- char *name; ++ const char *name; + { +- char *p = name, last = ' '; ++ const char *p = name; ++ char last = ' '; + int dots = 0, alpha = 0; + + /* +@@ -757,9 +758,9 @@ TnmValidateIpHostName(interp, name) + int + TnmValidateIpAddress(interp, address) + Tcl_Interp *interp; +- char *address; ++ const char *address; + { +- char *p = address; ++ const char *p = address; + unsigned dots = 0, a; + + dots = 0; +@@ -811,7 +812,7 @@ TnmValidateIpAddress(interp, address) + void + TnmWriteMessage(interp, msg) + Tcl_Interp *interp; +- char *msg; ++ const char *msg; + { + Tcl_DString buffer; + Tcl_Channel channel; +@@ -833,6 +834,34 @@ TnmWriteMessage(interp, msg) + /* + *---------------------------------------------------------------------- + * ++ * TnmCreateDirectory -- ++ * ++ * This procedure creates a directory. The parent must already ++ * exist. ++ * ++ * Results: ++ * A standard Tcl result. ++ * ++ * Side effects: ++ * Creates a directory in the file system. ++ * ++ *---------------------------------------------------------------------- ++ */ ++int ++TnmCreateDirectory(path) ++ const char *path; ++{ ++ Tcl_Obj *po = Tcl_NewStringObj(path, -1); ++ Tcl_IncrRefCount(po); ++ int s = Tcl_FSCreateDirectory(po); ++ Tcl_DecrRefCount(po); ++ return s; ++} ++ ++ ++/* ++ *---------------------------------------------------------------------- ++ * + * TnmMkDir -- + * + * This procedure creates a path of directories. This is largely +@@ -854,7 +883,8 @@ TnmMkDir(interp, pathname) + { + Tcl_DString nameBuffer, targetBuffer; + int result, j, pargc; +- char *name, **pargv; ++ char *name; ++ const char **pargv; + struct stat statBuf; + + pargv = NULL; diff --git a/net/tcl-scotty/patches/patch-ag b/net/tcl-scotty/patches/patch-tnm_snmp_straps.c index 67ae9e1a666..6476523dbef 100644 --- a/net/tcl-scotty/patches/patch-ag +++ b/net/tcl-scotty/patches/patch-tnm_snmp_straps.c @@ -1,10 +1,10 @@ -$NetBSD: patch-ag,v 1.3 2012/08/21 21:54:19 marino Exp $ +$NetBSD: patch-tnm_snmp_straps.c,v 1.1 2014/03/05 13:52:29 he Exp $ Provide more robustness for the straps helper program. ---- tnm/snmp/straps.c.orig 1999-03-09 17:06:10.000000000 +0000 -+++ tnm/snmp/straps.c -@@ -246,6 +246,17 @@ main(argc, argv) +--- tnm/snmp/straps.c.orig 1999-03-09 18:06:10.000000000 +0100 ++++ tnm/snmp/straps.c 2014-03-04 13:25:45.000000000 +0100 +@@ -246,6 +246,17 @@ #endif /* @@ -22,7 +22,7 @@ Provide more robustness for the straps helper program. * Fine everything is ready; lets listen for events: * the for(;;) loop aborts, if the last client went away. */ -@@ -271,7 +282,25 @@ main(argc, argv) +@@ -271,7 +282,25 @@ perror("straps: select failed"); } @@ -49,7 +49,7 @@ Provide more robustness for the straps helper program. /* read trap message and forward to clients: */ llen = sizeof(laddr); if ((rc = recvfrom(trap_s, buf, sizeof(buf), 0, -@@ -329,24 +358,6 @@ main(argc, argv) +@@ -329,24 +358,6 @@ go_on += cl_addr [i] > 0; } diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmAsn1.c b/net/tcl-scotty/patches/patch-tnm_snmp_tnmAsn1.c new file mode 100644 index 00000000000..184d3374354 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmAsn1.c @@ -0,0 +1,50 @@ +$NetBSD: patch-tnm_snmp_tnmAsn1.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/snmp/tnmAsn1.c.orig 1996-07-29 21:33:44.000000000 +0000 ++++ tnm/snmp/tnmAsn1.c +@@ -107,7 +107,7 @@ Tnm_OidDup(buflen, oid, oidLen) + + char* + Tnm_OidToStr(oid, oidLen) +- Tnm_Oid *oid; ++ const Tnm_Oid *oid; + int oidLen; + { + int i; +@@ -157,7 +157,7 @@ Tnm_OidToStr(oid, oidLen) + + Tnm_Oid* + Tnm_StrToOid(str, len) +- char *str; ++ const char *str; + int *len; + { + static Tnm_Oid oid[TNM_OIDMAXLEN]; +@@ -204,9 +204,9 @@ Tnm_StrToOid(str, len) + + int + Tnm_IsOid(str) +- char *str; ++ const char *str; + { +- char *cp; ++ const char *cp; + + for (cp = str; *cp != '\0'; cp++) { + if (!isdigit(*cp) && *cp != '.') return 0; +@@ -236,10 +236,11 @@ Tnm_IsOid(str) + + char* + Tnm_HexToOid(str) +- char *str; ++ const char *str; + { + static char expstr[TNM_OIDMAXLEN * 8]; +- char *p, *s; ++ const char *p; ++ char *s; + int convert = 0; + + if (! str) return NULL; diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmAsn1.h b/net/tcl-scotty/patches/patch-tnm_snmp_tnmAsn1.h new file mode 100644 index 00000000000..e0a03389718 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmAsn1.h @@ -0,0 +1,30 @@ +$NetBSD: patch-tnm_snmp_tnmAsn1.h,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/snmp/tnmAsn1.h.orig 2014-03-05 10:06:28.000000000 +0000 ++++ tnm/snmp/tnmAsn1.h +@@ -85,19 +85,19 @@ typedef u_int Tnm_Oid; + */ + + EXTERN char* +-Tnm_OidToStr _ANSI_ARGS_((Tnm_Oid *oid, int len)); ++Tnm_OidToStr _ANSI_ARGS_((const Tnm_Oid *oid, int len)); + + EXTERN Tnm_Oid* +-Tnm_StrToOid _ANSI_ARGS_((char *str, int *len)); ++Tnm_StrToOid _ANSI_ARGS_((const char *str, int *len)); + + EXTERN Tnm_Oid* + Tnm_OidDup _ANSI_ARGS_((int *buflen, Tnm_Oid *oid, int oidLen)); + + EXTERN int +-Tnm_IsOid _ANSI_ARGS_((char *str)); ++Tnm_IsOid _ANSI_ARGS_((const char *str)); + + EXTERN char* +-Tnm_HexToOid _ANSI_ARGS_((char *str)); ++Tnm_HexToOid _ANSI_ARGS_((const char *str)); + + /* + *---------------------------------------------------------------- diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmMib.h b/net/tcl-scotty/patches/patch-tnm_snmp_tnmMib.h new file mode 100644 index 00000000000..286fa0b4c6f --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmMib.h @@ -0,0 +1,117 @@ +$NetBSD: patch-tnm_snmp_tnmMib.h,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/snmp/tnmMib.h.orig 1996-10-02 06:33:57.000000000 +0000 ++++ tnm/snmp/tnmMib.h +@@ -123,59 +123,61 @@ EXTERN Tnm_MibTC *tnm_MibTCSaveMark; /* + *---------------------------------------------------------------- + */ + +-EXTERN char* +-Tnm_MibGetOid _ANSI_ARGS_((char *name, int exact)); ++EXTERN const char* ++Tnm_MibGetOid _ANSI_ARGS_((const char *name, int exact)); + + EXTERN char* +-Tnm_MibGetName _ANSI_ARGS_((char *oid, int exact)); ++Tnm_MibGetName _ANSI_ARGS_((const char *oid, int exact)); + + EXTERN char* +-Tnm_MibGetSyntax _ANSI_ARGS_((char *name, int exact)); ++Tnm_MibGetSyntax _ANSI_ARGS_((const char *name, int exact)); + + EXTERN int +-Tnm_MibGetBaseSyntax _ANSI_ARGS_((char *name, int exact)); ++Tnm_MibGetBaseSyntax _ANSI_ARGS_((const char *name, int exact)); + + EXTERN char* +-Tnm_MibGetDescription _ANSI_ARGS_((char *name, int exact)); ++Tnm_MibGetDescription _ANSI_ARGS_((const char *name, int exact)); + + EXTERN char* +-Tnm_MibGetAccess _ANSI_ARGS_((char *name, int exact)); ++Tnm_MibGetAccess _ANSI_ARGS_((const char *name, int exact)); + + EXTERN char* +-Tnm_MibGetMacro _ANSI_ARGS_((char *name, int exact)); ++Tnm_MibGetMacro _ANSI_ARGS_((const char *name, int exact)); + + EXTERN char* +-Tnm_MibGetModule _ANSI_ARGS_((char *name, int exact)); ++Tnm_MibGetModule _ANSI_ARGS_((const char *name, int exact)); + + EXTERN char* +-Tnm_MibGetSucc _ANSI_ARGS_((char *name)); ++Tnm_MibGetSucc _ANSI_ARGS_((const char *name)); + + EXTERN char* +-Tnm_MibGetParent _ANSI_ARGS_((char *name, int exact)); ++Tnm_MibGetParent _ANSI_ARGS_((const char *name, int exact)); + + EXTERN char* +-Tnm_MibGetTC _ANSI_ARGS_((char *name, int exact)); ++Tnm_MibGetTC _ANSI_ARGS_((const char *name, int exact)); + + EXTERN char* +-Tnm_MibGetFile _ANSI_ARGS_((char *name, int exact)); ++Tnm_MibGetFile _ANSI_ARGS_((const char *name, int exact)); + + EXTERN char* +-Tnm_MibGetIndex _ANSI_ARGS_((char *name, int exact)); ++Tnm_MibGetIndex _ANSI_ARGS_((const char *name, int exact)); + + EXTERN char* +-Tnm_MibGetDefault _ANSI_ARGS_((char *name, int exact)); ++Tnm_MibGetDefault _ANSI_ARGS_((const char *name, int exact)); + + EXTERN int +-Tnm_MibNodeGetOid _ANSI_ARGS_((Tnm_MibNode *nodePtr, Tnm_Oid *oid)); ++Tnm_MibNodeGetOid _ANSI_ARGS_((const Tnm_MibNode *nodePtr, Tnm_Oid *oid)); + + EXTERN Tnm_MibNode* +-Tnm_MibFindNode _ANSI_ARGS_((char *name, int *offset, int exact)); +- +-EXTERN char* +-Tnm_MibFormat _ANSI_ARGS_((char *name, int exact, char *arg)); ++Tnm_MibFindNode _ANSI_ARGS_((const char *name, int *offset, int exact)); + +-EXTERN char* +-Tnm_MibScan _ANSI_ARGS_((char *name, int exact, char *arg)); ++EXTERN const char* ++Tnm_MibFormat _ANSI_ARGS_((const char *name, int exact, ++ const char *arg)); ++ ++EXTERN const char* ++Tnm_MibScan _ANSI_ARGS_((const char *name, int exact, ++ const char *arg)); + + /* + *---------------------------------------------------------------- +@@ -184,7 +186,7 @@ Tnm_MibScan _ANSI_ARGS_((char *name, in + */ + + EXTERN Tnm_MibNode* +-Tnm_MibParse _ANSI_ARGS_((char *file, char *frozen, ++Tnm_MibParse _ANSI_ARGS_((const char *file, const char *frozen, + Tnm_MibNode *root)); + EXTERN Tnm_MibNode* + Tnm_MibReadFrozen _ANSI_ARGS_((FILE *fp)); +@@ -200,7 +202,7 @@ Tnm_MibWriteFrozen _ANSI_ARGS_((FILE *fp + */ + + EXTERN Tnm_MibNode* +-Tnm_MibNewNode _ANSI_ARGS_((char *label)); ++Tnm_MibNewNode _ANSI_ARGS_((const char *label)); + + EXTERN void + Tnm_MibAddNode _ANSI_ARGS_((Tnm_MibNode **rootPtr, +@@ -209,7 +211,7 @@ EXTERN Tnm_MibTC* + Tnm_MibAddTC _ANSI_ARGS_((Tnm_MibTC *tcPtr)); + + EXTERN Tnm_MibTC* +-Tnm_MibFindTC _ANSI_ARGS_((char *name)); ++Tnm_MibFindTC _ANSI_ARGS_((const char *name)); + + /* + *---------------------------------------------------------------- diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmMibParser.c b/net/tcl-scotty/patches/patch-tnm_snmp_tnmMibParser.c new file mode 100644 index 00000000000..9758d451456 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmMibParser.c @@ -0,0 +1,17 @@ +$NetBSD: patch-tnm_snmp_tnmMibParser.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/snmp/tnmMibParser.c.orig 1998-10-20 15:51:08.000000000 +0000 ++++ tnm/snmp/tnmMibParser.c +@@ -336,8 +336,8 @@ AddNewNode (nodeList, label, parentName, + + Tnm_MibNode* + Tnm_MibParse(file, frozen, root) +- char *file; +- char *frozen; ++ const char *file; ++ const char *frozen; + Tnm_MibNode *root; + { + FILE *fp; /* The current FILE pointer. */ diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmMibQuery.c b/net/tcl-scotty/patches/patch-tnm_snmp_tnmMibQuery.c new file mode 100644 index 00000000000..e855c3497a3 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmMibQuery.c @@ -0,0 +1,339 @@ +$NetBSD: patch-tnm_snmp_tnmMibQuery.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/snmp/tnmMibQuery.c~ 1999-12-09 16:17:00.000000000 +0100 ++++ tnm/snmp/tnmMibQuery.c 2014-03-04 23:18:46.000000000 +0100 +@@ -57,29 +57,29 @@ + * Forward declarations for procedures defined later in this file: + */ + +-static char * +-FormatOctetTC _ANSI_ARGS_((char *val, char *fmt)); ++static const char * ++FormatOctetTC _ANSI_ARGS_((const char *val, char *fmt)); + +-static char * +-FormatIntTC _ANSI_ARGS_((char *val, char *fmt)); ++static const char * ++FormatIntTC _ANSI_ARGS_((const char *val, char *fmt)); + +-static char * +-FormatTimeTicks _ANSI_ARGS_((char *val)); ++static const char * ++FormatTimeTicks _ANSI_ARGS_((const char *val)); + +-static char * +-FormatOID _ANSI_ARGS_((char *val)); ++static const char * ++FormatOID _ANSI_ARGS_((const char *val)); + +-static char * +-ScanOctetTC _ANSI_ARGS_((char *val, char *fmt)); ++static const char * ++ScanOctetTC _ANSI_ARGS_((const char *val, char *fmt)); + +-static char * +-ScanIntTC _ANSI_ARGS_((char *val, char *fmt)); ++static const char * ++ScanIntTC _ANSI_ARGS_((const char *val, char *fmt)); + +-static char * +-ScanTimeTicks _ANSI_ARGS_((char *val)); ++static const char * ++ScanTimeTicks _ANSI_ARGS_((const char *val)); + + static void +-GetMibPath _ANSI_ARGS_((Tnm_MibNode *nodePtr, char *soid)); ++GetMibPath _ANSI_ARGS_((const Tnm_MibNode *nodePtr, char *soid)); + + static void + FormatUnsigned _ANSI_ARGS_((unsigned u, char *s)); +@@ -141,7 +141,7 @@ + + static void + GetMibPath(nodePtr, s) +- Tnm_MibNode *nodePtr; ++ const Tnm_MibNode *nodePtr; + char *s; + { + if (! nodePtr) return; +@@ -173,7 +173,7 @@ + + static void + GetMibPath2(nodePtr, oid, oidLen) +- Tnm_MibNode *nodePtr; ++ const Tnm_MibNode *nodePtr; + Tnm_Oid *oid; + int *oidLen; + { +@@ -203,7 +203,7 @@ + + int + Tnm_MibNodeGetOid(nodePtr, oid) +- Tnm_MibNode *nodePtr; ++ const Tnm_MibNode *nodePtr; + Tnm_Oid *oid; + { + int len = 0; +@@ -230,9 +230,9 @@ + *---------------------------------------------------------------------- + */ + +-char* ++const char* + Tnm_MibGetOid(label, exact) +- char *label; ++ const char *label; + int exact; + { + char *expanded = Tnm_HexToOid(label); +@@ -275,7 +275,7 @@ + + char* + Tnm_MibGetName(label, exact) +- char *label; ++ const char *label; + int exact; + { + char *expanded = Tnm_HexToOid(label); +@@ -321,7 +321,7 @@ + + char* + Tnm_MibGetDescription(name, exact) +- char *name; ++ const char *name; + int exact; + { + FILE *fp; +@@ -407,7 +407,7 @@ + + char* + Tnm_MibGetSucc(name) +- char *name; ++ const char *name; + { + Tnm_MibNode *nodePtr; + int retoid; +@@ -467,7 +467,7 @@ + + char* + Tnm_MibGetSyntax(name, exact) +- char *name; ++ const char *name; + int exact; + { + Tnm_MibNode *nodePtr = Tnm_MibFindNode(name, NULL, exact); +@@ -517,7 +517,7 @@ + + int + Tnm_MibGetBaseSyntax(name, exact) +- char *name; ++ const char *name; + int exact; + { + int syntax = ASN1_OTHER; +@@ -561,7 +561,7 @@ + + char* + Tnm_MibGetAccess(name, exact) +- char *name; ++ const char *name; + int exact; + { + Tnm_MibNode *nodePtr = Tnm_MibFindNode(name, NULL, exact); +@@ -594,7 +594,7 @@ + + char* + Tnm_MibGetMacro(name, exact) +- char *name; ++ const char *name; + int exact; + { + Tnm_MibNode *nodePtr = Tnm_MibFindNode(name, NULL, exact); +@@ -627,7 +627,7 @@ + + char* + Tnm_MibGetModule(name, exact) +- char *name; ++ const char *name; + int exact; + { + Tnm_MibNode *nodePtr = Tnm_MibFindNode(name, NULL, exact); +@@ -657,9 +657,9 @@ + *---------------------------------------------------------------------- + */ + +-static char * ++static const char * + FormatOctetTC(val, fmt) +- char *val; ++ const char *val; + char *fmt; + { + int pfx, have_pfx; /* counter prefix */ +@@ -850,9 +850,9 @@ + *---------------------------------------------------------------------- + */ + +-static char * ++static const char * + FormatIntTC(val, fmt) +- char *val; ++ const char *val; + char *fmt; + { + static char *ret = NULL; +@@ -988,9 +988,9 @@ + *---------------------------------------------------------------------- + */ + +-static char * ++static const char * + FormatTimeTicks(value) +- char *value; ++ const char *value; + { + u_int d, h, m, s, f; + static char buf[80]; +@@ -1026,9 +1026,9 @@ + *---------------------------------------------------------------------- + */ + +-static char * ++static const char * + FormatOID(value) +- char *value; ++ const char *value; + { + Tnm_MibNode *nodePtr = Tnm_MibFindNode(value, NULL, 1); + static char *buffer = NULL; +@@ -1069,9 +1069,9 @@ + *---------------------------------------------------------------------- + */ + +-static char * ++static const char * + ScanOctetTC(val, fmt) +- char *val; ++ const char *val; + char *fmt; + { + int pfx, have_pfx; /* counter prefix */ +@@ -1261,9 +1261,9 @@ + *---------------------------------------------------------------------- + */ + +-static char * ++static const char * + ScanIntTC(val, fmt) +- char *val; ++ const char *val; + char *fmt; + { + static char ret [100]; +@@ -1367,9 +1367,9 @@ + *---------------------------------------------------------------------- + */ + +-static char * ++static const char * + ScanTimeTicks(value) +- char *value; ++ const char *value; + { + u_int u, d, h, m, s, f, n; + static char str[20]; +@@ -1419,11 +1419,11 @@ + *---------------------------------------------------------------------- + */ + +-char * ++const char * + Tnm_MibFormat(name, exact, value) +- char *name; ++ const char *name; + int exact; +- char *value; ++ const char *value; + { + Tnm_MibNode *nodePtr = Tnm_MibFindNode(name, NULL, exact); + +@@ -1447,7 +1447,7 @@ + */ + + if (nodePtr->tc->displayHint) { +- char *ret = NULL; ++ const char *ret = NULL; + if (nodePtr->syntax == ASN1_OCTET_STRING) { + ret = FormatOctetTC(value, nodePtr->tc->displayHint); + } else if (nodePtr->syntax == ASN1_INTEGER) { +@@ -1489,11 +1489,11 @@ + *---------------------------------------------------------------------- + */ + +-char* ++const char* + Tnm_MibScan(name, exact, value) +- char *name; ++ const char *name; + int exact; +- char *value; ++ const char *value; + { + Tnm_MibNode *nodePtr = Tnm_MibFindNode(name, NULL, exact); + +@@ -1518,7 +1518,7 @@ + */ + + if (nodePtr->tc->displayHint) { +- char *ret = NULL; ++ const char *ret = NULL; + if (nodePtr->syntax == ASN1_OCTET_STRING) { + ret = ScanOctetTC(value, nodePtr->tc->displayHint); + } else if (nodePtr->syntax == ASN1_INTEGER) { +@@ -1563,7 +1563,7 @@ + + char* + Tnm_MibGetTC(name, exact) +- char *name; ++ const char *name; + int exact; + { + Tnm_MibNode *nodePtr = Tnm_MibFindNode(name, NULL, exact); +@@ -1635,7 +1635,7 @@ + + char* + Tnm_MibGetFile(name, exact) +- char *name; ++ const char *name; + int exact; + { + Tnm_MibNode *nodePtr = Tnm_MibFindNode(name, NULL, exact); +@@ -1669,7 +1669,7 @@ + + char* + Tnm_MibGetIndex(name, exact) +- char *name; ++ const char *name; + int exact; + { + Tnm_MibNode *nodePtr; +@@ -1712,7 +1712,7 @@ + + char* + Tnm_MibGetParent(name, exact) +- char *name; ++ const char *name; + int exact; + { + Tnm_MibNode *nodePtr; +@@ -1755,7 +1755,7 @@ + + char* + Tnm_MibGetDefault(name, exact) +- char *name; ++ const char *name; + int exact; + { + Tnm_MibNode *nodePtr = Tnm_MibFindNode(name, NULL, exact); diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmMibTcl.c b/net/tcl-scotty/patches/patch-tnm_snmp_tnmMibTcl.c new file mode 100644 index 00000000000..9438cfe0196 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmMibTcl.c @@ -0,0 +1,140 @@ +$NetBSD: patch-tnm_snmp_tnmMibTcl.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. +Avoid use of interp->errorLine. + +--- tnm/snmp/tnmMibTcl.c.orig 1999-03-08 08:39:23.000000000 +0000 ++++ tnm/snmp/tnmMibTcl.c +@@ -18,16 +18,16 @@ + + static int + MibCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int +-LoadFileList _ANSI_ARGS_((Tcl_Interp *interp, char *fileList)); ++LoadFileList _ANSI_ARGS_((Tcl_Interp *interp, const char *fileList)); + + static int +-LoadFile _ANSI_ARGS_((Tcl_Interp *interp, char *file)); ++LoadFile _ANSI_ARGS_((Tcl_Interp *interp, const char *file)); + + static int +-WalkTree _ANSI_ARGS_((Tcl_Interp *interp, char *name, +- char *label, char *body, int exact, ++WalkTree _ANSI_ARGS_((Tcl_Interp *interp, const char *name, ++ const char *label, const char *body, int exact, + Tnm_MibNode* nodePtr, Tnm_Oid *oid, int len)); + + /* +@@ -77,11 +77,11 @@ MibCmd(clientData, interp, argc, argv) + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + int exact = 0; +- char *cmd, *name, *arg; +- char *result = NULL; ++ const char *cmd, *name, *arg; ++ const char *result = NULL; + static int initialized = 0; + + if (argc > 1 && strcmp(argv[1], "-exact") == 0) { +@@ -107,7 +107,7 @@ MibCmd(clientData, interp, argc, argv) + */ + + if (! initialized) { +- char *mibFileList; ++ const char *mibFileList; + + initialized = 1; + mibFileList = Tcl_GetVar2(interp, "tnm", "mibs:core", TCL_GLOBAL_ONLY); +@@ -166,7 +166,7 @@ MibCmd(clientData, interp, argc, argv) + return TCL_ERROR; + } + if (! result) goto notFound; +- Tcl_SetResult(interp, result, TCL_VOLATILE); ++ Tcl_SetResult(interp, (char*)result, TCL_VOLATILE); + return TCL_OK; + } + +@@ -179,7 +179,7 @@ MibCmd(clientData, interp, argc, argv) + return TCL_ERROR; + } + if (! result) goto notFound; +- Tcl_SetResult(interp, result, TCL_VOLATILE); ++ Tcl_SetResult(interp, (char*)result, TCL_VOLATILE); + return TCL_OK; + } + +@@ -240,7 +240,7 @@ MibCmd(clientData, interp, argc, argv) + + if (! result) goto notFound; + +- Tcl_SetResult(interp, result, TCL_VOLATILE); ++ Tcl_SetResult(interp, (char*)result, TCL_VOLATILE); + return TCL_OK; + + notFound: +@@ -268,10 +268,10 @@ notFound: + static int + LoadFileList(interp, fileList) + Tcl_Interp *interp; +- char *fileList; ++ const char *fileList; + { + int i, code, argc; +- char **argv; ++ const char **argv; + + if (fileList == NULL) { + return TCL_OK; +@@ -315,11 +315,11 @@ LoadFileList(interp, fileList) + static int + LoadFile(interp, file) + Tcl_Interp *interp; +- char *file; ++ const char *file; + { + Tcl_DString fileBuffer, frozenFileBuffer; +- char *library, *cache, *arch, *fileName, *frozenFileName = NULL; +- char **fileArgv = NULL; ++ const char *library, *cache, *arch, *fileName, *frozenFileName = NULL; ++ const char **fileArgv = NULL; + int fileArgc; + int code = TCL_OK; + +@@ -465,9 +465,9 @@ LoadFile(interp, file) + static int + WalkTree(interp, varName, label, body, exact, nodePtr, oid, len) + Tcl_Interp *interp; +- char *varName; +- char *label; +- char *body; ++ const char *varName; ++ const char *label; ++ const char *body; + int exact; + Tnm_MibNode* nodePtr; + Tnm_Oid *oid; +@@ -487,8 +487,7 @@ WalkTree(interp, varName, label, body, e + } + + while (nodePtr) { +- +- char *val, *label; ++ const char *val, *label; + + if (doall && oid) { + oid[len-1] = nodePtr->subid; +@@ -522,7 +521,7 @@ WalkTree(interp, varName, label, body, e + } else if (result == TCL_ERROR) { + char msg[100]; + sprintf(msg, "\n (\"mib walk\" body line %d)", +- interp->errorLine); ++ Tcl_GetErrorLine(interp)); + Tcl_AddErrorInfo(interp, msg); + goto loopDone; + } else { diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmMibTree.c b/net/tcl-scotty/patches/patch-tnm_snmp_tnmMibTree.c new file mode 100644 index 00000000000..77e00aa23e7 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmMibTree.c @@ -0,0 +1,99 @@ +$NetBSD: patch-tnm_snmp_tnmMibTree.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/snmp/tnmMibTree.c.orig 1996-07-16 19:29:56.000000000 +0000 ++++ tnm/snmp/tnmMibTree.c +@@ -36,14 +36,14 @@ static Tcl_HashTable *nodeHashTable = NU + */ + + static Tnm_MibNode* +-LookupOID _ANSI_ARGS_((Tnm_MibNode *root, char *label, ++LookupOID _ANSI_ARGS_((Tnm_MibNode *root, const char *label, + int *offset, int exact)); + static Tnm_MibNode* +-LookupLabelOID _ANSI_ARGS_((Tnm_MibNode *root, char *label, ++LookupLabelOID _ANSI_ARGS_((Tnm_MibNode *root, const char *label, + int *offset, int exact)); + static Tnm_MibNode* +-LookupLabel _ANSI_ARGS_((Tnm_MibNode *root, char *start, +- char *label, char *moduleName, ++LookupLabel _ANSI_ARGS_((Tnm_MibNode *root, const char *start, ++ const char *label, const char *moduleName, + int *offset, int exact, int fuzzy)); + static void + HashNode _ANSI_ARGS_((Tnm_MibNode *node)); +@@ -84,14 +84,14 @@ HashNodeLabel _ANSI_ARGS_((char *label) + static Tnm_MibNode* + LookupOID(root, label, offset, exact) + Tnm_MibNode *root; +- char *label; ++ const char *label; + int *offset; + int exact; + { + Tnm_Oid *id; + int i, len; + Tnm_MibNode *p, *q = NULL; +- char *s = label; ++ const char *s = label; + + if (offset) *offset = -1; + +@@ -153,7 +153,7 @@ LookupOID(root, label, offset, exact) + static Tnm_MibNode* + LookupLabelOID(root, label, offset, exact) + Tnm_MibNode *root; +- char *label; ++ const char *label; + int *offset; + int exact; + { +@@ -212,15 +212,16 @@ LookupLabelOID(root, label, offset, exac + static Tnm_MibNode* + LookupLabel(root, start, label, moduleName, offset, exact, fuzzy) + Tnm_MibNode *root; +- char *start; +- char *label; +- char *moduleName; ++ const char *start; ++ const char *label; ++ const char *moduleName; + int *offset; + int exact; + int fuzzy; + { + char head[TNM_OIDMAXLEN * 8]; +- char *tail = label, *p = head; ++ const char *tail = label; ++ char *p = head; + Tnm_MibNode *tp = NULL, *brother; + int num = 1; + +@@ -295,7 +296,7 @@ LookupLabel(root, start, label, moduleNa + + Tnm_MibNode* + Tnm_MibFindNode(name, offset, exact) +- char *name; ++ const char *name; + int *offset; + int exact; + { +@@ -422,7 +423,7 @@ Tnm_MibAddTC(tcPtr) + + Tnm_MibTC* + Tnm_MibFindTC(name) +- char *name; ++ const char *name; + { + Tcl_HashEntry *entryPtr; + +@@ -457,7 +458,7 @@ Tnm_MibFindTC(name) + + Tnm_MibNode* + Tnm_MibNewNode(label) +- char *label; ++ const char *label; + { + Tnm_MibNode *nodePtr = (Tnm_MibNode *) ckalloc(sizeof(Tnm_MibNode)); + memset((char *) nodePtr, 0, sizeof(Tnm_MibNode)); diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmp.h b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmp.h new file mode 100644 index 00000000000..ca4944e94c9 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmp.h @@ -0,0 +1,104 @@ +$NetBSD: patch-tnm_snmp_tnmSnmp.h,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/snmp/tnmSnmp.h.orig 1998-04-23 11:16:19.000000000 +0000 ++++ tnm/snmp/tnmSnmp.h +@@ -213,9 +213,9 @@ EXTERN SNMP_Session *sessionList; + */ + + typedef struct SNMP_VarBind { +- char *soid; +- char *syntax; +- char *value; ++ const char *soid; ++ const char *syntax; ++ const char *value; + char *freePtr; + ClientData clientData; + int flags; +@@ -223,9 +223,9 @@ typedef struct SNMP_VarBind { + + EXTERN void + Tnm_SnmpFreeVBList _ANSI_ARGS_((int varBindSize, +- SNMP_VarBind *varBindPtr)); ++ const SNMP_VarBind *varBindPtr)); + EXTERN int +-Tnm_SnmpSplitVBList _ANSI_ARGS_((Tcl_Interp *interp, char *list, ++Tnm_SnmpSplitVBList _ANSI_ARGS_((Tcl_Interp *interp, const char *list, + int *varBindSizePtr, + SNMP_VarBind **varBindPtrPtr)); + EXTERN char* +@@ -355,11 +355,11 @@ Tnm_SnmpEvalBinding _ANSI_ARGS_((Tcl_Int + */ + + typedef struct TnmSnmpNode { +- char *label; /* The complete OID. */ ++ const char *label; /* The complete OID. */ + int offset; /* Offset to instance id. */ + int syntax; /* Syntax string from MIB. */ + int access; /* Access mode from MIB. */ +- char *tclVarName; /* Tcl variable name. */ ++ const char *tclVarName; /* Tcl variable name. */ + SNMP_Binding *bindings; /* List of bindings. */ + u_int subid; /* Sub identifier in Tree. */ + struct TnmSnmpNode *childPtr; /* List of child nodes. */ +@@ -367,25 +367,25 @@ typedef struct TnmSnmpNode { + } TnmSnmpNode; + + EXTERN int +-Tnm_SnmpCreateNode _ANSI_ARGS_((Tcl_Interp *interp, char *id, +- char *varName, char *defval)); ++Tnm_SnmpCreateNode _ANSI_ARGS_((Tcl_Interp *interp, const char *id, ++ const char *varName, const char *defval)); + EXTERN TnmSnmpNode* + Tnm_SnmpFindNode _ANSI_ARGS_((SNMP_Session *session, +- Tnm_Oid *oid, int len)); ++ const Tnm_Oid *oid, int len)); + EXTERN TnmSnmpNode* + Tnm_SnmpFindNextNode _ANSI_ARGS_((SNMP_Session *session, +- Tnm_Oid *oid, int len)); ++ const Tnm_Oid *oid, int len)); + EXTERN int + Tnm_SnmpSetNodeBinding _ANSI_ARGS_((SNMP_Session *session, +- Tnm_Oid *oid, int len, +- int event, char *command)); ++ const Tnm_Oid *oid, int len, ++ int event, const char *command)); + EXTERN char* + Tnm_SnmpGetNodeBinding _ANSI_ARGS_((SNMP_Session *session, +- Tnm_Oid *oid, int len, int event)); ++ const Tnm_Oid *oid, int len, int event)); + EXTERN int + Tnm_SnmpEvalNodeBinding _ANSI_ARGS_((SNMP_Session *session, + SNMP_PDU *pdu, TnmSnmpNode *inst, +- int operation, char *value, ++ int operation, const char *value, + char *oldValue)); + + /* +@@ -496,8 +496,9 @@ Tnm_SnmpAgentRequest _ANSI_ARGS_((Tcl_In + EXTERN int + Tnm_SnmpEvalCallback _ANSI_ARGS_((Tcl_Interp *interp, SNMP_Session *session, + SNMP_PDU *pdu, +- char *cmd, char *instance, char *oid, +- char *value, char* oldValue)); ++ const char *cmd, const char *instance, ++ const char *oid, ++ const char *value, char* oldValue)); + + /* + *---------------------------------------------------------------- +@@ -590,10 +591,10 @@ Tnm_SnmpUsecAuth _ANSI_ARGS_((SNMP_Sessi + #endif + + EXTERN void +-Tnm_SnmpBinToHex _ANSI_ARGS_((char *s, int n, char *d)); ++Tnm_SnmpBinToHex _ANSI_ARGS_((const char *s, int n, char *d)); + + EXTERN int +-Tnm_SnmpHexToBin _ANSI_ARGS_((char *s, char *d, int *n)); ++Tnm_SnmpHexToBin _ANSI_ARGS_((const char *s, char *d, int *n)); + + EXTERN void + Tnm_SnmpDumpPDU _ANSI_ARGS_((Tcl_Interp *interp, SNMP_PDU *pdu)); diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpAgent.c b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpAgent.c new file mode 100644 index 00000000000..d3b366ebcda --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpAgent.c @@ -0,0 +1,131 @@ +$NetBSD: patch-tnm_snmp_tnmSnmpAgent.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. +Avoid use of interp->result. + +--- tnm/snmp/tnmSnmpAgent.c.orig 1998-05-19 13:13:53.000000000 +0000 ++++ tnm/snmp/tnmSnmpAgent.c +@@ -52,18 +52,21 @@ CacheHit _ANSI_ARGS_((SNMP_Session *ses + static char* + TraceSysUpTime _ANSI_ARGS_((ClientData clientData, + Tcl_Interp *interp, +- char *name1, char *name2, int flags)); ++ const char *name1, const char *name2, ++ int flags)); + #ifdef TNM_SNMPv2U + static char* + TraceAgentTime _ANSI_ARGS_((ClientData clientData, + Tcl_Interp *interp, +- char *name1, char *name2, int flags)); ++ const char *name1, const char *name2, ++ int flags)); + #endif + + static char* + TraceUnsignedInt _ANSI_ARGS_((ClientData clientData, + Tcl_Interp *interp, +- char *name1, char *name2, int flags)); ++ const char *name1, const char *name2, ++ int flags)); + static TnmSnmpNode* + FindInstance _ANSI_ARGS_((SNMP_Session *session, + Tnm_Oid *oid, int oidlen)); +@@ -312,8 +315,8 @@ static char* + TraceSysUpTime(clientData, interp, name1, name2, flags) + ClientData clientData; + Tcl_Interp *interp; +- char *name1; +- char *name2; ++ const char *name1; ++ const char *name2; + int flags; + { + char buf[20]; +@@ -344,8 +347,8 @@ static char* + TraceAgentTime(clientData, interp, name1, name2, flags) + ClientData clientData; + Tcl_Interp *interp; +- char *name1; +- char *name2; ++ const char *name1; ++ const char *name2; + int flags; + { + char buf[20]; +@@ -377,8 +380,8 @@ static char* + TraceUnsignedInt(clientData, interp, name1, name2, flags) + ClientData clientData; + Tcl_Interp *interp; +- char *name1; +- char *name2; ++ const char *name1; ++ const char *name2; + int flags; + { + char buf[20]; +@@ -410,12 +413,15 @@ Tnm_SnmpAgentInit(interp, session) + SNMP_Session *session; + { + static int done = 0; +- char tclvar[80], buffer[255], *value; ++ char tclvar[80], buffer[255]; ++ const char *value; + struct StatReg *p; + + if (Tnm_SnmpAgentOpen(session->agentInterp, session) != TCL_OK) { + if (interp != session->agentInterp) { +- Tcl_SetResult(interp, session->agentInterp->result, TCL_STATIC); ++ Tcl_SetResult(interp, ++ (char*)Tcl_GetStringResult(session->agentInterp), ++ TCL_VOLATILE); + } + return TCL_ERROR; + } +@@ -618,7 +624,7 @@ GetRequest(interp, session, request, res + + for (i = 0; i < inVarBindSize; i++) { + +- char *value, *syntax; ++ const char *value, *syntax; + + oid = Tnm_StrToOid(inVarBindPtr[i].soid, &oidlen); + if (request->type == TNM_SNMP_GETNEXT +@@ -689,7 +695,7 @@ GetRequest(interp, session, request, res + + varBindTclError: + response->error_status = TnmGetTableKey(tnmSnmpErrorTable, +- interp->result); ++ Tcl_GetStringResult(interp)); + if (response->error_status < 0) { + response->error_status = TNM_SNMP_GENERR; + } +@@ -755,7 +761,7 @@ SetRequest(interp, session, request, res + + for (i = 0; i < inVarBindSize; i++) { + +- char *value, *syntax; ++ const char *value, *syntax; + int setAlreadyDone = 0; + varsToRollback = i; + +@@ -859,7 +865,7 @@ SetRequest(interp, session, request, res + + varBindTclError: + response->error_status = TnmGetTableKey(tnmSnmpErrorTable, +- interp->result); ++ Tcl_GetStringResult(interp)); + if (response->error_status < 0) { + response->error_status = TNM_SNMP_GENERR; + } +@@ -902,8 +908,9 @@ SetRequest(interp, session, request, res + } + + if (code != TCL_OK) { +- response->error_status = TnmGetTableKey(tnmSnmpErrorTable, +- interp->result); ++ response->error_status = ++ TnmGetTableKey(tnmSnmpErrorTable, ++ Tcl_GetStringResult(interp)); + if (response->error_status < 0) { + response->error_status = TNM_SNMP_GENERR; + } diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpInst.c b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpInst.c new file mode 100644 index 00000000000..57e388c695b --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpInst.c @@ -0,0 +1,164 @@ +$NetBSD: patch-tnm_snmp_tnmSnmpInst.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- tnm/snmp/tnmSnmpInst.c.orig 1997-09-09 21:17:12.000000000 +0200 ++++ tnm/snmp/tnmSnmpInst.c 2014-03-04 22:56:58.000000000 +0100 +@@ -30,20 +30,23 @@ + FreeNode _ANSI_ARGS_((TnmSnmpNode *inst)); + + static TnmSnmpNode* +-AddNode _ANSI_ARGS_((char *id, int offset, int syntax, +- int access, char *tclVarName)); ++AddNode _ANSI_ARGS_((const char *id, int offset, int syntax, ++ int access, const char *tclVarName)); + static void +-RemoveNode _ANSI_ARGS_((TnmSnmpNode *root, char *varname)); ++RemoveNode _ANSI_ARGS_((TnmSnmpNode *root, const char *varname)); + + static TnmSnmpNode* +-FindNode _ANSI_ARGS_((TnmSnmpNode *root, Tnm_Oid *oid, int len)); ++FindNode _ANSI_ARGS_((TnmSnmpNode *root, const Tnm_Oid *oid, ++ int len)); + + static TnmSnmpNode* +-FindNextNode _ANSI_ARGS_((TnmSnmpNode *root, Tnm_Oid *oid, int len)); ++FindNextNode _ANSI_ARGS_((TnmSnmpNode *root, const Tnm_Oid *oid, ++ int len)); + + static char* + DeleteNodeProc _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- char *name1, char *name2, int flags)); ++ const char *name1, const char *name2, ++ int flags)); + + + /* +@@ -138,11 +141,11 @@ + + static TnmSnmpNode* + AddNode(soid, offset, syntax, access, tclVarName) +- char *soid; ++ const char *soid; + int offset; + int syntax; + int access; +- char *tclVarName; ++ const char *tclVarName; + { + Tnm_Oid *oid; + int i, oidlen; +@@ -239,7 +242,7 @@ + static TnmSnmpNode* + FindNextNode(root, oid, len) + TnmSnmpNode *root; +- Tnm_Oid *oid; ++ const Tnm_Oid *oid; + int len; + { + TnmSnmpNode *p, *inst; +@@ -321,7 +324,7 @@ + static TnmSnmpNode* + FindNode(root, oid, len) + TnmSnmpNode *root; +- Tnm_Oid *oid; ++ const Tnm_Oid *oid; + int len; + { + TnmSnmpNode *p, *q = NULL; +@@ -359,7 +362,7 @@ + static void + RemoveNode(root, varName) + TnmSnmpNode *root; +- char *varName; ++ const char *varName; + { + TnmSnmpNode *p, *q; + +@@ -407,8 +410,8 @@ + DeleteNodeProc(clientData, interp, name1, name2, flags) + ClientData clientData; + Tcl_Interp *interp; +- char *name1; +- char *name2; ++ const char *name1; ++ const char *name2; + int flags; + { + int len = strlen(name1); +@@ -451,14 +454,14 @@ + int + Tnm_SnmpCreateNode(interp, label, tclVarName, defval) + Tcl_Interp *interp; +- char *label; +- char *tclVarName; +- char *defval; ++ const char *label; ++ const char *tclVarName; ++ const char *defval; + { + char *soid = NULL; + Tnm_MibNode *nodePtr = Tnm_MibFindNode(label, NULL, 0); + int access, offset = 0, syntax = 0; +- char *varName = NULL; ++ const char *varName = NULL; + + if (!nodePtr || nodePtr->childPtr) { + Tcl_AppendResult(interp, "unknown object type \"", label, "\"", +@@ -586,7 +589,7 @@ + TnmSnmpNode* + Tnm_SnmpFindNode(session, oid, oidlen) + SNMP_Session *session; +- Tnm_Oid *oid; ++ const Tnm_Oid *oid; + int oidlen; + { + return FindNode(instTree, oid, oidlen); +@@ -612,7 +615,7 @@ + TnmSnmpNode* + Tnm_SnmpFindNextNode(session, oid, oidlen) + SNMP_Session *session; +- Tnm_Oid *oid; ++ const Tnm_Oid *oid; + int oidlen; + { + return FindNextNode(instTree, oid, oidlen); +@@ -638,10 +641,10 @@ + int + Tnm_SnmpSetNodeBinding(session, oid, oidlen, event, command) + SNMP_Session *session; +- Tnm_Oid *oid; ++ const Tnm_Oid *oid; + int oidlen; + int event; +- char *command; ++ const char *command; + { + TnmSnmpNode *node = NULL; + SNMP_Binding *bindPtr = NULL; +@@ -713,7 +716,7 @@ + char* + Tnm_SnmpGetNodeBinding(session, oid, oidlen, event) + SNMP_Session *session; +- Tnm_Oid *oid; ++ const Tnm_Oid *oid; + int oidlen; + int event; + { +@@ -761,13 +764,13 @@ + SNMP_PDU *pdu; + TnmSnmpNode *inst; + int event; +- char *value; ++ const char *value; + char *oldValue; + { + int oidlen; +- Tnm_Oid *oid; ++ const Tnm_Oid *oid; + int code = TCL_OK; +- char *instOid; ++ const char *instOid; + + oid = Tnm_StrToOid(inst->label, &oidlen); + instOid = inst->label+inst->offset; diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpNet.c b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpNet.c new file mode 100644 index 00000000000..359adf3916c --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpNet.c @@ -0,0 +1,43 @@ +$NetBSD: patch-tnm_snmp_tnmSnmpNet.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. +Avoid use of interp->result. + +--- tnm/snmp/tnmSnmpNet.c.orig 1997-08-26 18:55:45.000000000 +0000 ++++ tnm/snmp/tnmSnmpNet.c +@@ -170,7 +170,7 @@ straps(interp) + Tcl_Interp *interp; + { + int *pidArray, argc = 1; +- static char *argv[2] = { NULL, 0 }; ++ static const char *argv[2] = { NULL, 0 }; + static Tcl_Channel channel = NULL; + static char *straps = NULL; + +@@ -1060,7 +1060,7 @@ ResponseProc(clientData, mask) + Tcl_BackgroundError(interp); + } + if (code == TCL_CONTINUE && hexdump) { +- TnmWriteMessage(interp, interp->result); ++ TnmWriteMessage(interp, Tcl_GetStringResult(interp)); + TnmWriteMessage(interp, "\n"); + } + } +@@ -1102,7 +1102,7 @@ TrapProc(clientData, mask) + Tcl_BackgroundError(interp); + } + if (code == TCL_CONTINUE && hexdump) { +- TnmWriteMessage(interp, interp->result); ++ TnmWriteMessage(interp, Tcl_GetStringResult(interp)); + TnmWriteMessage(interp, "\n"); + } + } +@@ -1147,7 +1147,7 @@ AgentProc(clientData, mask) + Tcl_BackgroundError(interp); + } + if (code == TCL_CONTINUE && hexdump) { +- TnmWriteMessage(interp, interp->result); ++ TnmWriteMessage(interp, Tcl_GetStringResult(interp)); + TnmWriteMessage(interp, "\n"); + } + } diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpRecv.c b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpRecv.c new file mode 100644 index 00000000000..8704f01b01b --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpRecv.c @@ -0,0 +1,197 @@ +$NetBSD: patch-tnm_snmp_tnmSnmpRecv.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. +Avoid use of interp->result. + +--- tnm/snmp/tnmSnmpRecv.c.orig 1999-05-17 16:15:33.000000000 +0000 ++++ tnm/snmp/tnmSnmpRecv.c +@@ -669,16 +669,18 @@ DecodeMessage(interp, msg, pdu, packet, + int buflen = 0; + u_int msglen = 0; + u_char *p = packet; ++ char res[128]; + + /* + * Decode "Packet Header" header ( SEQUENCE 0x30 msglen ) + */ + + if (*p++ != (ASN1_UNIVERSAL | ASN1_CONSTRUCTED | ASN1_SEQUENCE)) { +- sprintf(interp->result, ++ sprintf(res, + "Message header: invalid value 0x%.2x; expecting 0x%.2x", + *--p, (ASN1_UNIVERSAL | ASN1_CONSTRUCTED | ASN1_SEQUENCE)); + snmpStats.snmpInASNParseErrs++; ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_ERROR; + } + buflen += 1; +@@ -687,7 +689,8 @@ DecodeMessage(interp, msg, pdu, packet, + if (p == NULL) goto asn1Error; + + if ((buflen + msglen) != packetlen) { +- interp->result = "invalid length field in message header"; ++ Tcl_SetResult(interp, "invalid length field in message header", ++ TCL_STATIC); + return TCL_ERROR; + } + +@@ -717,8 +720,9 @@ DecodeMessage(interp, msg, pdu, packet, + #endif + default: + snmpStats.snmpInBadVersions++; +- sprintf(interp->result, ++ sprintf(res, + "received packet with unknown SNMP version %d", version); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_ERROR; + } + +@@ -727,10 +731,11 @@ DecodeMessage(interp, msg, pdu, packet, + */ + + if (*p != ASN1_OCTET_STRING) { +- sprintf(interp->result, ++ sprintf(res, + "Parameter string: invalid value 0x%.2x; expecting 0x%.2x", + *p, ASN1_OCTET_STRING); + snmpStats.snmpInASNParseErrs++; ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_ERROR; + } + p = Tnm_BerDecOctetString(p, &buflen, ASN1_OCTET_STRING, +@@ -756,10 +761,11 @@ DecodeMessage(interp, msg, pdu, packet, + } + + if (buflen != msglen) { +- sprintf(interp->result, ++ sprintf(res, + "Message sequence length (%d) differs from real length (%d).", + buflen, (int) msglen); + snmpStats.snmpInASNParseErrs++; ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_ERROR; + } + +@@ -986,6 +992,7 @@ DecodePDU(interp, pdu, packet, packetlen + char *snmpTrapEnterprise = NULL; + + u_char tag; ++ char res[128]; + + Tcl_DStringInit(&pdu->varbind); + +@@ -1022,9 +1029,10 @@ DecodePDU(interp, pdu, packet, packetlen + pdu->type = TNM_SNMP_REPORT; + break; + default: +- sprintf(interp->result, ++ sprintf(res, + "Response-PDU: invalid tag 0x%.2x.", *--packet); + snmpStats.snmpInASNParseErrs++; ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_ERROR; + } + pdulen = 1; +@@ -1139,14 +1147,14 @@ DecodePDU(interp, pdu, packet, packetlen + Tcl_DStringAppendElement(&pdu->varbind, "OBJECT IDENTIFIER"); + { + #if 1 +- char *tmp = Tnm_MibFormat("1.3.6.1.6.3.1.1.4.1.0", 0, toid); ++ const char *tmp = Tnm_MibFormat("1.3.6.1.6.3.1.1.4.1.0", 0, toid); + if (tmp) { + Tcl_DStringAppendElement(&pdu->varbind, tmp); + } else { + Tcl_DStringAppendElement(&pdu->varbind, toid); + } + #else +- char *tmp = Tnm_MibGetName(toid, 0); ++ const char *tmp = Tnm_MibGetName(toid, 0); + if (tmp) { + Tcl_DStringAppendElement(&pdu->varbind, tmp); + } else { +@@ -1201,10 +1209,11 @@ DecodePDU(interp, pdu, packet, packetlen + if (pdu->type == TNM_SNMPv1_TRAP) { + goto trapError; + } +- sprintf(interp->result, ++ sprintf(res, + "VarBindList: invalid tag 0x%.2x; expecting 0x%.2x", + *--packet, (ASN1_UNIVERSAL | ASN1_CONSTRUCTED | ASN1_SEQUENCE)); + snmpStats.snmpInASNParseErrs++; ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_ERROR; + } + pdulen += 1; +@@ -1213,7 +1222,7 @@ DecodePDU(interp, pdu, packet, packetlen + if (packet == NULL) goto asn1Error; + + if ((pdulen + asnlen) != deflen) { +- interp->result = "VarBindList: invalid length field"; ++ Tcl_SetResult(interp, "VarBindList: invalid length field", TCL_STATIC); + snmpStats.snmpInASNParseErrs++; + return TCL_ERROR; + } +@@ -1229,10 +1238,11 @@ DecodePDU(interp, pdu, packet, packetlen + */ + + if (*packet++ != (ASN1_UNIVERSAL | ASN1_CONSTRUCTED | ASN1_SEQUENCE)) { +- sprintf(interp->result, ++ sprintf(res, + "VarBind: invalid tag 0x%.2x; expecting 0x%.2x", + *--packet, (ASN1_UNIVERSAL | ASN1_CONSTRUCTED | ASN1_SEQUENCE)); + snmpStats.snmpInASNParseErrs++; ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_ERROR; + } + pdulen += 1; +@@ -1316,7 +1326,7 @@ DecodePDU(interp, pdu, packet, packetlen + case ASN1_INTEGER: + packet = Tnm_BerDecInt(packet, &pdulen, *packet, &int_val); + if (packet == NULL) goto asn1Error; +- { char *tmp; ++ { const char *tmp; + sprintf(buf, "%d", int_val); + tmp = Tnm_MibFormat(vboid, 0, buf); + if (tmp) { +@@ -1367,7 +1377,7 @@ DecodePDU(interp, pdu, packet, packetlen + if (packet == NULL) goto asn1Error; + #if 1 + { char *soid = Tnm_OidToStr(oid, oidlen); +- char *tmp = Tnm_MibFormat(vboid, 0, soid); ++ const char *tmp = Tnm_MibFormat(vboid, 0, soid); + if (tmp) { + Tcl_DStringAppendElement(&pdu->varbind, tmp); + } else { +@@ -1396,7 +1406,7 @@ DecodePDU(interp, pdu, packet, packetlen + packet = Tnm_BerDecOctetString(packet, &pdulen, tag, + (char **) &freeme, &int_val); + if (packet == NULL) goto asn1Error; +- { char *tmp; ++ { const char *tmp; + static char *hex = NULL; + static int hexLen = 0; + if (hexLen < int_val * 5 + 1) { +@@ -1418,8 +1428,9 @@ DecodePDU(interp, pdu, packet, packetlen + } + break; + default: +- sprintf(interp->result, "unknown asn1 type 0x%.2x", *packet); ++ sprintf(res, "unknown asn1 type 0x%.2x", *packet); + snmpStats.snmpInASNParseErrs++; ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_ERROR; + } + +@@ -1444,10 +1455,11 @@ DecodePDU(interp, pdu, packet, packetlen + *packetlen += pdulen; + + if (pdulen != deflen) { +- sprintf(interp->result, ++ sprintf(res, + "PDU sequence length (%d) differs from real length (%d).", + pdulen, (int) deflen); + snmpStats.snmpInASNParseErrs++; ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_ERROR; + } + diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpSend.c b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpSend.c new file mode 100644 index 00000000000..e5b3fd53e2a --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpSend.c @@ -0,0 +1,136 @@ +$NetBSD: patch-tnm_snmp_tnmSnmpSend.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. +Avoid use of interp->result. + +--- tnm/snmp/tnmSnmpSend.c.orig 1999-03-23 17:15:14.000000000 +0000 ++++ tnm/snmp/tnmSnmpSend.c +@@ -67,6 +67,7 @@ Tnm_SnmpEncode(interp, session, pdu, pro + { + int retry = 0, packetlen = 0, rc = 0; + u_char packet[TNM_SNMP_MAXSIZE]; ++ char res[20]; + + memset((char *) packet, 0, sizeof(packet)); + packetlen = 0; +@@ -166,7 +167,8 @@ Tnm_SnmpEncode(interp, session, pdu, pro + rPtr = Tnm_SnmpCreateRequest(pdu->request_id, packet, packetlen, + proc, clientData, interp); + Tnm_SnmpQueueRequest(session, rPtr); +- sprintf(interp->result, "%d", (int) pdu->request_id); ++ sprintf(res, "%d", (int) pdu->request_id); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return TCL_OK; + } + +@@ -230,7 +232,8 @@ Tnm_SnmpEncode(interp, session, pdu, pro + + if (rc == TCL_CONTINUE) { + if (hexdump) { +- fprintf(stderr, "%s\n", interp->result); ++ fprintf(stderr, "%s\n", ++ Tcl_GetStringResult(interp)); + } + continue; + } +@@ -320,7 +323,7 @@ EncodeMessage(interp, session, pdu, pack + + p = EncodePDU(interp, session, pdu, p, packetlen); + if (p == NULL) { +- if (*interp->result == '\0') { ++ if (*Tcl_GetStringResult(interp) == '\0') { + Tcl_SetResult(interp, Tnm_BerError(), TCL_STATIC); + } + return TCL_ERROR; +@@ -577,10 +580,10 @@ EncodePDU(interp, session, pdu, packet, + u_char *PDU_len = NULL, *VarBind_len = NULL, *VarBindList_len = NULL; + + int i, vblc, vbc; +- char **vblv, **vbv; +- ++ const char **vblv, **vbv; + Tnm_Oid *oid; + int oidlen; ++ char res[64]; + + /* + * encode pdu type ( tag: [pdu_type] IMPLICIT PDU ) +@@ -709,7 +712,7 @@ EncodePDU(interp, session, pdu, packet, + + for (i = 0; i < vblc; i++) { + +- char *value; ++ const char *value; + int asn1_type = ASN1_OTHER; + + /* +@@ -742,7 +745,7 @@ EncodePDU(interp, session, pdu, packet, + if (Tnm_IsOid(vbv[0])) { + oid = Tnm_StrToOid(vbv[0], &oidlen); + } else { +- char *tmp = Tnm_MibGetOid(vbv[0], 0); ++ const char *tmp = Tnm_MibGetOid(vbv[0], 0); + if (! tmp) { + Tcl_ResetResult(interp); + Tcl_AppendResult(interp, "invalid object identifier \"", +@@ -835,7 +838,7 @@ EncodePDU(interp, session, pdu, packet, + { int int_val, rc; + rc = Tcl_GetInt(interp, value, &int_val); + if (rc != TCL_OK) { +- char *tmp = Tnm_MibScan(vbv[0], 0, value); ++ const char *tmp = Tnm_MibScan(vbv[0], 0, value); + if (tmp && *tmp) { + Tcl_ResetResult(interp); + rc = Tcl_GetInt(interp, tmp, &int_val); +@@ -851,7 +854,7 @@ EncodePDU(interp, session, pdu, packet, + if (sizeof(int) >= 8) { + rc = Tcl_GetInt(interp, value, &int_val); + if (rc != TCL_OK) { +- char *tmp = Tnm_MibScan(vbv[0], 0, value); ++ const char *tmp = Tnm_MibScan(vbv[0], 0, value); + if (tmp && *tmp) { + Tcl_ResetResult(interp); + rc = Tcl_GetInt(interp, tmp, &int_val); +@@ -910,11 +913,11 @@ EncodePDU(interp, session, pdu, packet, + } + break; + case ASN1_OCTET_STRING: +- { char *hex = value; ++ { const char *hex = value; + int len; + static char *bin = NULL; + static int binLen = 0; +- char *scan = Tnm_MibScan(vbv[0], 0, value); ++ const char *scan = Tnm_MibScan(vbv[0], 0, value); + if (scan) hex = scan; + if (*hex) { + len = strlen(hex); +@@ -937,7 +940,7 @@ EncodePDU(interp, session, pdu, packet, + } + break; + case ASN1_OPAQUE: +- { char *hex = value; ++ { const char *hex = value; + int len; + static char *bin = NULL; + static int binLen = 0; +@@ -962,7 +965,7 @@ EncodePDU(interp, session, pdu, packet, + break; + case ASN1_OBJECT_IDENTIFIER: + if (! Tnm_IsOid(value)) { +- char *tmp = Tnm_MibGetOid(value, 0); ++ const char *tmp = Tnm_MibGetOid(value, 0); + if (!tmp) { + Tcl_AppendResult(interp, + "illegal object identifier \"", +@@ -982,8 +985,9 @@ EncodePDU(interp, session, pdu, packet, + packet = Tnm_BerEncNull(packet, packetlen, asn1_type); + break; + default: +- sprintf(interp->result, "unknown asn1 type 0x%.2x", ++ sprintf(res, "unknown asn1 type 0x%.2x", + asn1_type); ++ Tcl_SetResult(interp, res, TCL_VOLATILE); + return NULL; + } + } else { diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpTcl.c b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpTcl.c new file mode 100644 index 00000000000..6ad6756f76d --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpTcl.c @@ -0,0 +1,412 @@ +$NetBSD: patch-tnm_snmp_tnmSnmpTcl.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. +Avoid use of interp->result. + +--- tnm/snmp/tnmSnmpTcl.c.orig 2000-08-11 16:25:20.000000000 +0000 ++++ tnm/snmp/tnmSnmpTcl.c +@@ -36,12 +36,12 @@ static Tcl_HashTable aliasTable; + static void + EvalCmdProc _ANSI_ARGS_((SNMP_Session *session, SNMP_PDU *pdu, + ClientData clientData)); +-static char * ++static const char * + GetOption _ANSI_ARGS_((Tcl_Interp *interp, ClientData object, + int option)); + static int +-SetOption _ANSI_ARGS_((Tcl_Interp *interp, ClientData object, +- int option, char *value)); ++SetOption _ANSI_ARGS_((Tcl_Interp *interp, ClientData object, ++ int option, const char *value)); + static int + Configured _ANSI_ARGS_((Tcl_Interp *interp, SNMP_Session *session)); + +@@ -50,37 +50,37 @@ DeleteAgentInterp _ANSI_ARGS_((ClientDat + + static int + SnmpCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + SessionCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + WaitSession _ANSI_ARGS_((Tcl_Interp *interp, SNMP_Session *session, +- char *id)); ++ const char *id)); + static void + DestroySession _ANSI_ARGS_((ClientData clientdata)); + + static int + Request _ANSI_ARGS_((Tcl_Interp *interp, SNMP_Session *session, +- int pdu_type, int argc, char **argv)); ++ int pdu_type, int argc, const char **argv)); + static int + Walk _ANSI_ARGS_((Tcl_Interp *interp, SNMP_Session *session, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + ExpandTable _ANSI_ARGS_((Tcl_Interp *interp, +- char *tList, Tcl_DString *dst)); ++ const char *tList, Tcl_DString *dst)); + static int + ExpandScalars _ANSI_ARGS_((Tcl_Interp *interp, +- char *sList, Tcl_DString *dst)); ++ const char *sList, Tcl_DString *dst)); + static int + Table _ANSI_ARGS_((Tcl_Interp *interp, SNMP_Session *session, +- int argc, char **argv)); ++ int argc, const char **argv)); + static int + Scalars _ANSI_ARGS_((Tcl_Interp *interp, SNMP_Session *session, +- int argc, char **argv)); ++ int argc, const char **argv)); + static void +-ScalarSetVar _ANSI_ARGS_((Tcl_Interp *interp, char *vbl, +- char *varName, Tcl_DString *result)); ++ScalarSetVar _ANSI_ARGS_((Tcl_Interp *interp, const char *vbl, ++ const char *varName, Tcl_DString *result)); + + /* + * The options used to configure snmp session objects. +@@ -197,7 +197,7 @@ EvalCmdProc(session, pdu, clientData) + *---------------------------------------------------------------------- + */ + +-static char * ++static const char * + GetOption(interp, object, option) + Tcl_Interp *interp; + ClientData object; +@@ -280,7 +280,7 @@ GetOption(interp, object, option) + Tcl_ResetResult(interp); + code = Tcl_GetInterpPath(interp, session->agentInterp); + if (code == TCL_OK) { +- return interp->result; ++ return Tcl_GetStringResult(interp); + } + return ""; + case TNM_SNMP_OPT_TIMEOUT: +@@ -335,7 +335,7 @@ SetOption(interp, object, option, value) + Tcl_Interp *interp; + ClientData object; + int option; +- char *value; ++ const char *value; + { + SNMP_Session *session = (SNMP_Session *) object; + int num; +@@ -451,7 +451,7 @@ SetOption(interp, object, option, value) + { + Tcl_HashEntry *entryPtr; + int i, largc, code; +- char **largv, **argv; ++ const char **largv, **argv; + char *alias; + entryPtr = Tcl_FindHashEntry(&aliasTable, value); + if (! entryPtr) { +@@ -468,7 +468,7 @@ SetOption(interp, object, option, value) + return TCL_ERROR; + } + Tcl_SetHashValue(entryPtr, NULL); +- argv = (char **) ckalloc((largc + 3) * sizeof(char *)); ++ argv = (const char **) ckalloc((largc + 3) * sizeof(char *)); + argv[0] = session->name; + argv[1] = "configure"; + for (i = 0; i < largc; i++) { +@@ -531,7 +531,7 @@ Configured(interp, session) + Tcl_Interp *interp; + SNMP_Session *session; + { +- char *name = Tcl_GetCommandName(interp, session->token); ++ const char *name = Tcl_GetCommandName(interp, session->token); + + if (! session->version) { + Tcl_AppendResult(interp, "session \"", name, +@@ -660,7 +660,7 @@ SnmpCmd(clientData, interp, argc, argv) + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + static char mibCmd[20]; + SNMP_Session *session; +@@ -858,7 +858,7 @@ SessionCmd(clientData, interp, argc, arg + ClientData clientData; + Tcl_Interp *interp; + int argc; +- char **argv; ++ const char **argv; + { + SNMP_Session *session = (SNMP_Session *) clientData; + int code; +@@ -953,7 +953,7 @@ SessionCmd(clientData, interp, argc, arg + + } else if (strcmp(argv[1], "inform") == 0) { + if (session->version == TNM_SNMPv1) { +- char *name = Tcl_GetCommandName(interp, session->token); ++ const char *name = Tcl_GetCommandName(interp, session->token); + Tcl_AppendResult(interp, "inform option not allowed on ", + "SNMPv1 session \"", name, "\"", (char *) NULL); + return TCL_ERROR; +@@ -1023,7 +1023,7 @@ SessionCmd(clientData, interp, argc, arg + } + } else { + +- char *oidstr = Tnm_MibGetOid(argv[2], 0); ++ const char *oidstr = Tnm_MibGetOid(argv[2], 0); + Tnm_Oid *oid; + int code, oidlen; + +@@ -1069,7 +1069,7 @@ SessionCmd(clientData, interp, argc, arg + } + + if (! session->agentInterp) { +- char *name = Tcl_GetCommandName(interp, session->token); ++ const char *name = Tcl_GetCommandName(interp, session->token); + Tcl_AppendResult(interp, "invalid agent session \"", + name, "\"", (char *) NULL); + return TCL_ERROR; +@@ -1078,7 +1078,8 @@ SessionCmd(clientData, interp, argc, arg + (argc > 4) ? argv[4] : ""); + if (code != TCL_OK) { + if (interp != session->agentInterp) { +- Tcl_SetResult(interp, session->agentInterp->result, ++ Tcl_SetResult(interp, ++ (char*)Tcl_GetStringResult(session->agentInterp), + TCL_VOLATILE); + Tcl_ResetResult(session->agentInterp); + } +@@ -1116,17 +1117,17 @@ static int + WaitSession(interp, session, request) + Tcl_Interp *interp; + SNMP_Session *session; +- char *request; ++ const char *request; + { + u_int id = 0; +- char *name = Tcl_GetCommandName(interp, session->token); ++ const char *name = Tcl_GetCommandName(interp, session->token); + + if (! name) { + return TCL_OK; + } + + if (request) { +- char *p; ++ const char *p; + for (p = request; isdigit(*p); p++) { + id = 10 * id + *p - '0'; + } +@@ -1233,9 +1234,9 @@ Request(interp, session, pdu_type, argc, + SNMP_Session *session; + int pdu_type; + int argc; +- char **argv; ++ const char **argv; + { +- char *cmd = NULL; ++ const char *cmd = NULL; + SNMP_PDU _pdu; + SNMP_PDU *pdu = &_pdu; + +@@ -1288,7 +1289,7 @@ Request(interp, session, pdu_type, argc, + if (Tnm_IsOid (*++argv)) { + pdu->trapOID = ckstrdup(*argv); + } else { +- char *tmp = Tnm_MibGetOid(*argv, 0); ++ const char *tmp = Tnm_MibGetOid(*argv, 0); + if (! tmp) { + Tcl_AppendResult(interp, "no object \"", *argv, "\"", + (char *) NULL); +@@ -1383,11 +1384,11 @@ Walk(interp, session, argc, argv) + Tcl_Interp *interp; + SNMP_Session *session; + int argc; +- char **argv; ++ const char **argv; + { + int i, j, k, result; + int oidc, respc; +- char **oidv = NULL, **respv = NULL; ++ const char **oidv = NULL, **respv = NULL; + SNMP_PDU _pdu, *pdu = &_pdu; + int numRepeaters = 0; + +@@ -1424,7 +1425,7 @@ Walk(interp, session, argc, argv) + } + + for (i = 0; i < oidc; i++) { +- char *tmp = Tnm_MibGetOid(oidv[i], 0); ++ const char *tmp = Tnm_MibGetOid(oidv[i], 0); + if (!tmp) { + Tcl_AppendResult(interp, "no object \"", oidv[i], "\"", + (char *) NULL); +@@ -1432,9 +1433,10 @@ Walk(interp, session, argc, argv) + Tcl_DStringFree(&pdu->varbind); + return TCL_ERROR; + } +- oidv[i] = ckalloc(strlen(tmp) + 2); +- strcpy(oidv[i], tmp); +- strcat(oidv[i], "."); ++ char *tmp2 = ckalloc(strlen(tmp) + 2); ++ strcpy(tmp2, tmp); ++ strcat(tmp2, "."); ++ oidv[i] = tmp2; + Tcl_DStringAppendElement(&pdu->varbind, tmp); + } + +@@ -1468,7 +1470,7 @@ Walk(interp, session, argc, argv) + + result = Tnm_SnmpEncode(interp, session, pdu, NULL, NULL); + if (result == TCL_ERROR +- && (strncmp(interp->result, "noSuchName ", 11) == 0)) { ++ && (strncmp(Tcl_GetStringResult(interp), "noSuchName ", 11) == 0)) { + result = TCL_OK; + goto loopDone; + } +@@ -1477,7 +1479,8 @@ Walk(interp, session, argc, argv) + } + + if (respv) ckfree((char *) respv); +- result = Tcl_SplitList(interp, interp->result, &respc, &respv); ++ result = Tcl_SplitList(interp, ++ Tcl_GetStringResult(interp), &respc, &respv); + if (result != TCL_OK) { + goto loopDone; + } +@@ -1502,7 +1505,7 @@ Walk(interp, session, argc, argv) + Tcl_DStringFree(&pdu->varbind); + for (k = j * oidc; k < (j+1) * oidc; k++) { + int vbc; +- char **vbv; ++ const char **vbv; + result = Tcl_SplitList(interp, respv[k], &vbc, &vbv); + if (result != TCL_OK) { + goto loopDone; +@@ -1532,7 +1535,7 @@ Walk(interp, session, argc, argv) + } else if (result == TCL_ERROR) { + char msg[100]; + sprintf(msg, "\n (\"%s walk\" body line %d)", +- session->name, interp->errorLine); ++ session->name, Tcl_GetErrorLine(interp)); + Tcl_AddErrorInfo(interp, msg); + goto loopDone; + } else { +@@ -1556,7 +1559,7 @@ Walk(interp, session, argc, argv) + */ + + if (result == TCL_ERROR +- && (strncmp(interp->result, "noSuchName", 10) == 0)) { ++ && (strncmp(Tcl_GetStringResult(interp), "noSuchName", 10) == 0)) { + result = TCL_OK; + } + +@@ -1586,11 +1589,11 @@ Walk(interp, session, argc, argv) + static int + ExpandTable(interp, tList, dst) + Tcl_Interp *interp; +- char *tList; ++ const char *tList; + Tcl_DString *dst; + { + int i, argc, code; +- char **argv = NULL; ++ const char **argv = NULL; + Tnm_MibNode *nodePtr, *entryPtr = NULL, *tablePtr = NULL; + + code = Tcl_SplitList(interp, tList, &argc, &argv); +@@ -1702,12 +1705,12 @@ Table(interp, session, argc, argv) + Tcl_Interp *interp; + SNMP_Session *session; + int argc; +- char **argv; ++ const char **argv; + { + int i, largc, code; + SNMP_PDU _pdu, *pdu = &_pdu; + Tcl_DString varList; +- char **largv; ++ const char **largv; + + if (argc != 3) { + Tcl_AppendResult(interp, "wrong # args: should be \"", +@@ -1791,11 +1794,11 @@ Table(interp, session, argc, argv) + static int + ExpandScalars(interp, sList, dst) + Tcl_Interp *interp; +- char *sList; ++ const char *sList; + Tcl_DString *dst; + { + int argc, code, i; +- char **argv = NULL; ++ const char **argv = NULL; + Tnm_MibNode *nodePtr; + Tnm_Oid oid[TNM_OIDMAXLEN]; + int oidLen; +@@ -1881,13 +1884,13 @@ Scalars(interp, session, argc, argv) + Tcl_Interp *interp; + SNMP_Session *session; + int argc; +- char **argv; ++ const char **argv; + { + int i, largc, code; + SNMP_PDU _pdu, *pdu = &_pdu; + Tcl_DString varList; + Tcl_DString result; +- char **largv; ++ const char **largv; + + if (argc != 3) { + Tcl_AppendResult(interp, "wrong # args: should be \"", +@@ -1941,7 +1944,7 @@ Scalars(interp, session, argc, argv) + Tcl_DStringLength(&varList)); + code = Tnm_SnmpEncode(interp, session, pdu, NULL, NULL); + if (code == TCL_OK) { +- ScalarSetVar(interp, interp->result, argv[2], &result); ++ ScalarSetVar(interp, Tcl_GetStringResult(interp), argv[2], &result); + Tcl_DStringFree(&varList); + Tcl_DStringResult(interp, &result); + return TCL_OK; +@@ -1952,7 +1955,7 @@ Scalars(interp, session, argc, argv) + * talking to us. This saves some time-outs. + */ + +- if (strcmp(interp->result, "noResponse") == 0) { ++ if (strcmp(Tcl_GetStringResult(interp), "noResponse") == 0) { + return TCL_ERROR; + } + +@@ -1982,7 +1985,7 @@ Scalars(interp, session, argc, argv) + continue; + } + +- ScalarSetVar(interp, interp->result, argv[2], &result); ++ ScalarSetVar(interp, Tcl_GetStringResult(interp), argv[2], &result); + } + ckfree((char *) largv); + Tcl_DStringFree(&varList); +@@ -2011,8 +2014,8 @@ Scalars(interp, session, argc, argv) + static void + ScalarSetVar(interp, vbl, varName, result) + Tcl_Interp *interp; +- char *vbl; +- char *varName; ++ const char *vbl; ++ const char *varName; + Tcl_DString *result; + { + int i, code, varBindSize; +@@ -2025,7 +2028,7 @@ ScalarSetVar(interp, vbl, varName, resul + + for (i = 0; i < varBindSize; i++) { + Tnm_MibNode *nodePtr = Tnm_MibFindNode(varBindPtr[i].soid, NULL, 0); +- char *name = nodePtr ? nodePtr->label : varBindPtr[i].soid; ++ const char *name = nodePtr ? nodePtr->label : varBindPtr[i].soid; + + if ((strcmp(varBindPtr[i].syntax, "noSuchObject") == 0) + || (strcmp(varBindPtr[i].syntax, "noSuchInstance") == 0) diff --git a/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpUtil.c b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpUtil.c new file mode 100644 index 00000000000..0dc3a9fa1d4 --- /dev/null +++ b/net/tcl-scotty/patches/patch-tnm_snmp_tnmSnmpUtil.c @@ -0,0 +1,100 @@ +$NetBSD: patch-tnm_snmp_tnmSnmpUtil.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. +Avoid use of interp->result. + +--- tnm/snmp/tnmSnmpUtil.c.orig 1998-04-23 11:18:13.000000000 +0000 ++++ tnm/snmp/tnmSnmpUtil.c +@@ -569,16 +569,17 @@ Tnm_SnmpEvalCallback(interp, session, pd + Tcl_Interp *interp; + SNMP_Session *session; + SNMP_PDU *pdu; +- char *cmd; +- char *instance; +- char *oid; +- char *value; ++ const char *cmd; ++ const char *instance; ++ const char *oid; ++ const char *value; + char *last; + { + char buf[20]; + int code; + Tcl_DString tclCmd; +- char *startPtr, *scanPtr, *name; ++ char *name; ++ const char *startPtr, *scanPtr; + + Tcl_DStringInit(&tclCmd); + startPtr = cmd; +@@ -676,7 +677,7 @@ Tnm_SnmpEvalCallback(interp, session, pd + */ + + if (code == TCL_ERROR && oid == NULL) { +- char *errorMsg = ckstrdup(interp->result); ++ char *errorMsg = ckstrdup(Tcl_GetStringResult(interp)); + Tcl_AddErrorInfo(interp, "\n (snmp callback)"); + Tcl_BackgroundError(interp); + Tcl_SetResult(interp, errorMsg, TCL_DYNAMIC); +@@ -752,7 +753,7 @@ Tnm_SnmpDumpPDU(interp, pdu) + if (hexdump) { + + int i, code, argc; +- char **argv; ++ const char **argv; + char *name, *status; + + name = TnmGetTableValue(tnmSnmpPDUTable, pdu->type); +@@ -1234,12 +1235,12 @@ TnmSnmpGetRequestId() + int + Tnm_SnmpSplitVBList(interp, list, varBindSizePtr, varBindPtrPtr) + Tcl_Interp *interp; +- char *list; ++ const char *list; + int *varBindSizePtr; + SNMP_VarBind **varBindPtrPtr; + { + int code, vblc, i; +- char **vblv; ++ const char **vblv; + int varBindSize; + SNMP_VarBind *varBindPtr; + +@@ -1260,7 +1261,7 @@ Tnm_SnmpSplitVBList(interp, list, varBin + + for (i = 0; i < varBindSize; i++) { + int vbc; +- char **vbv; ++ const char **vbv; + code = Tcl_SplitList(interp, vblv[i], &vbc, &vbv); + if (code != TCL_OK) { + Tnm_SnmpFreeVBList(varBindSize, varBindPtr); +@@ -1346,7 +1347,7 @@ Tnm_SnmpMergeVBList(varBindSize, varBind + void + Tnm_SnmpFreeVBList(varBindSize, varBindPtr) + int varBindSize; +- SNMP_VarBind *varBindPtr; ++ const SNMP_VarBind *varBindPtr; + { + int i; + +@@ -1409,7 +1410,7 @@ Tnm_SnmpSysUpTime() + + void + Tnm_SnmpBinToHex(s, n, d) +- char *s; ++ const char *s; + int n; + char *d; + { +@@ -1446,7 +1447,8 @@ Tnm_SnmpBinToHex(s, n, d) + + int + Tnm_SnmpHexToBin(s, d, n) +- char *s, *d; ++ const char *s; ++ char *d; + int *n; + { + int v; diff --git a/net/tcl-scotty/patches/patch-ab b/net/tcl-scotty/patches/patch-unix-Makefile.in index 5a6211dadc3..772c409bd98 100644 --- a/net/tcl-scotty/patches/patch-ab +++ b/net/tcl-scotty/patches/patch-unix-Makefile.in @@ -1,4 +1,4 @@ -$NetBSD: patch-ab,v 1.7 2012/08/22 22:18:23 marino Exp $ +$NetBSD: patch-unix-Makefile.in,v 1.1 2014/03/05 13:52:29 he Exp $ Put installed files under lib/tcl, so that tcl more easily picks it up using e.g. "package require Tnm". diff --git a/net/tcl-scotty/patches/patch-aa b/net/tcl-scotty/patches/patch-unix_configure index ebffed49afb..f30acf59bab 100644 --- a/net/tcl-scotty/patches/patch-aa +++ b/net/tcl-scotty/patches/patch-unix_configure @@ -1,4 +1,4 @@ -$NetBSD: patch-aa,v 1.3 2011/09/02 08:06:55 he Exp $ +$NetBSD: patch-unix_configure,v 1.1 2014/03/05 13:52:29 he Exp $ Default target to build & install scotty & tkined. Append TCL_LIBS to library setting, so that tcl library is picked up. diff --git a/net/tcl-scotty/patches/patch-unix_scotty.c b/net/tcl-scotty/patches/patch-unix_scotty.c new file mode 100644 index 00000000000..e6f5d3b5243 --- /dev/null +++ b/net/tcl-scotty/patches/patch-unix_scotty.c @@ -0,0 +1,94 @@ +$NetBSD: patch-unix_scotty.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Avoid use of interp->result. +Constify. + +--- unix/scotty.c~ 1996-09-19 19:17:19.000000000 +0200 ++++ unix/scotty.c 2014-03-04 23:24:02.000000000 +0100 +@@ -94,7 +94,8 @@ + } + + if (Tcl_PkgRequire(interp, "Tnm", TNM_VERSION, 1) == NULL) { +- if (Tcl_StringMatch(interp->result, "*can't find package*")) { ++ if (Tcl_StringMatch(Tcl_GetStringResult(interp), ++ "*can't find package*")) { + Tcl_AppendResult(interp, "\n", + "This usually means that you have to define the TCLLIBPATH environment\n", + "variable to point to the tnm library directory or you have to include\n", +@@ -127,9 +128,10 @@ + int + main(argc, argv) + int argc; +- char **argv; ++ const char **argv; + { +- char buffer[512], *args, *fileName = NULL; ++ char buffer[512], *args; ++ const char *fileName = NULL; + Tcl_Channel inChannel, errChannel; + Tcl_DString temp; + int code, exitCode = 0; +@@ -180,7 +182,7 @@ + errChannel = Tcl_GetChannel(interp, "stderr", NULL); + if (errChannel) { + Tcl_Write(errChannel, "initialization failed: ", -1); +- Tcl_Write(errChannel, interp->result, -1); ++ Tcl_Write(errChannel, Tcl_GetStringResult(interp), -1); + Tcl_Write(errChannel, "\n", 1); + } + exitCode = 1; +@@ -217,7 +219,7 @@ + if (fullName == NULL) { + errChannel = Tcl_GetStdChannel(TCL_STDERR); + if (errChannel) { +- Tcl_Write(errChannel, interp->result, -1); ++ Tcl_Write(errChannel, Tcl_GetStringResult(interp), -1); + Tcl_Write(errChannel, "\n", 1); + } + } else { +@@ -232,7 +234,8 @@ + if (Tcl_EvalFile(interp, fullName) != TCL_OK) { + errChannel = Tcl_GetStdChannel(TCL_STDERR); + if (errChannel) { +- Tcl_Write(errChannel, interp->result, -1); ++ Tcl_Write(errChannel, ++ Tcl_GetStringResult(interp), -1); + Tcl_Write(errChannel, "\n", 1); + } + } +@@ -365,7 +368,7 @@ + Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc, + (ClientData) chan); + Tcl_DStringFree(&command); +- if (*interp->result != 0) { ++ if (*Tcl_GetStringResult(interp) != 0) { + if ((code != TCL_OK) || (tty)) { + /* + * The statement below used to call "printf", but that resulted +@@ -374,7 +377,7 @@ + * NOTE: This probably will not work under Windows either. + */ + +- puts(interp->result); ++ puts(Tcl_GetStringResult(interp)); + } + } + +@@ -414,7 +417,7 @@ + * exists a partial command, so use + * the secondary prompt. */ + { +- char *promptCmd; ++ const char *promptCmd; + int code; + Tcl_Channel outChannel, errChannel; + +@@ -449,7 +452,7 @@ + */ + + if (errChannel != (Tcl_Channel) NULL) { +- Tcl_Write(errChannel, interp->result, -1); ++ Tcl_Write(errChannel, Tcl_GetStringResult(interp), -1); + Tcl_Write(errChannel, "\n", 1); + } + goto defaultPrompt; diff --git a/net/tcl-scotty/patches/patch-unix_tnmUnixIcmp.c b/net/tcl-scotty/patches/patch-unix_tnmUnixIcmp.c new file mode 100644 index 00000000000..201e1074ca1 --- /dev/null +++ b/net/tcl-scotty/patches/patch-unix_tnmUnixIcmp.c @@ -0,0 +1,15 @@ +$NetBSD: patch-unix_tnmUnixIcmp.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- unix/tnmUnixIcmp.c~ 1997-08-26 18:55:44.000000000 +0000 ++++ unix/tnmUnixIcmp.c +@@ -61,7 +61,7 @@ ForkNtping(interp) + Tcl_Interp *interp; + { + int argc = 2; +- static char *argv[3] = { NULL, "-b", 0 }; ++ static const char *argv[3] = { NULL, "-b", 0 }; + static char* ntping = NULL; + + if (! ntping) { diff --git a/net/tcl-scotty/patches/patch-unix_tnmUnixLog.c b/net/tcl-scotty/patches/patch-unix_tnmUnixLog.c new file mode 100644 index 00000000000..5bbc71ea067 --- /dev/null +++ b/net/tcl-scotty/patches/patch-unix_tnmUnixLog.c @@ -0,0 +1,15 @@ +$NetBSD: patch-unix_tnmUnixLog.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- unix/tnmUnixLog.c~ 1996-09-10 11:35:33.000000000 +0200 ++++ unix/tnmUnixLog.c 2014-03-04 18:06:44.000000000 +0100 +@@ -36,7 +36,7 @@ + TnmWriteLogMessage(interp, level, message) + Tcl_Interp *interp; + int level; +- char *message; ++ const char *message; + { + switch (level) { + case TNM_LOG_EMERG: diff --git a/net/tcl-scotty/patches/patch-unix_tnmUnixSocket.c b/net/tcl-scotty/patches/patch-unix_tnmUnixSocket.c new file mode 100644 index 00000000000..429abe29b66 --- /dev/null +++ b/net/tcl-scotty/patches/patch-unix_tnmUnixSocket.c @@ -0,0 +1,15 @@ +$NetBSD: patch-unix_tnmUnixSocket.c,v 1.1 2014/03/05 13:52:29 he Exp $ + +Constify. + +--- unix/tnmUnixSocket.c~ 1998-10-29 14:59:07.000000000 +0100 ++++ unix/tnmUnixSocket.c 2014-03-04 15:48:11.000000000 +0100 +@@ -44,7 +44,7 @@ + int + TnmSocketSendTo(s, buf, len, flags, to, tolen) + int s; +- char *buf; ++ const char *buf; + int len; + int flags; + struct sockaddr *to; |