summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile.in11
-rwxr-xr-xunix/configure28
-rw-r--r--unix/configure.in10
-rw-r--r--unix/dltest/pkga.c17
-rw-r--r--unix/dltest/pkgb.c3
-rw-r--r--unix/dltest/pkgc.c23
-rw-r--r--unix/dltest/pkgd.c23
-rw-r--r--unix/dltest/pkge.c15
-rw-r--r--unix/dltest/pkgooa.c12
-rw-r--r--unix/dltest/pkgua.c23
-rw-r--r--unix/tcl.m42
-rw-r--r--unix/tcl.spec2
-rw-r--r--unix/tclConfig.h.in6
-rw-r--r--unix/tclUnixChan.c4
-rw-r--r--unix/tclUnixCompat.c4
-rw-r--r--unix/tclUnixFCmd.c8
-rw-r--r--unix/tclUnixInit.c8
-rw-r--r--unix/tclUnixNotfy.c4
-rw-r--r--unix/tclUnixPipe.c6
-rw-r--r--unix/tclUnixTest.c50
-rw-r--r--unix/tclUnixThrd.c56
-rw-r--r--unix/tclUnixTime.c200
22 files changed, 109 insertions, 406 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 69dd14f..a2dc1c6 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -139,8 +139,8 @@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@
# To compile without backward compatibility and deprecated code uncomment the
# following
-NO_DEPRECATED_FLAGS =
-#NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED
+#NO_DEPRECATED_FLAGS =
+NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED
# Some versions of make, like SGI's, use the following variable to determine
# which shell to use for executing commands:
@@ -337,7 +337,6 @@ TOMMATH_OBJS = bncore.o bn_reverse.o bn_fast_s_mp_mul_digs.o \
STUB_LIB_OBJS = tclStubLib.o \
tclTomMathStubLib.o \
- tclOOStubLib.o \
${COMPAT_OBJS}
UNIX_OBJS = tclUnixChan.o tclUnixEvent.o tclUnixFCmd.o \
@@ -475,8 +474,7 @@ OO_SRCS = \
STUB_SRCS = \
$(GENERIC_DIR)/tclStubLib.c \
- $(GENERIC_DIR)/tclTomMathStubLib.c \
- $(GENERIC_DIR)/tclOOStubLib.c
+ $(GENERIC_DIR)/tclTomMathStubLib.c
TOMMATH_SRCS = \
$(TOMMATH_DIR)/bncore.c \
@@ -1700,9 +1698,6 @@ tclStubLib.o: $(GENERIC_DIR)/tclStubLib.c
tclTomMathStubLib.o: $(GENERIC_DIR)/tclTomMathStubLib.c
$(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclTomMathStubLib.c
-tclOOStubLib.o: $(GENERIC_DIR)/tclOOStubLib.c
- $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclOOStubLib.c
-
.c.o:
$(CC) -c $(CC_SWITCHES) $<
diff --git a/unix/configure b/unix/configure
index cfa8451..47a1a30 100755
--- a/unix/configure
+++ b/unix/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for tcl 8.6.
+# Generated by GNU Autoconf 2.59 for tcl 9.0.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
@@ -267,8 +267,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='tcl'
PACKAGE_TARNAME='tcl'
-PACKAGE_VERSION='8.6'
-PACKAGE_STRING='tcl 8.6'
+PACKAGE_VERSION='9.0'
+PACKAGE_STRING='tcl 9.0'
PACKAGE_BUGREPORT=''
# Factoring default headers for most tests.
@@ -777,7 +777,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures tcl 8.6 to adapt to many kinds of systems.
+\`configure' configures tcl 9.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -834,7 +834,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of tcl 8.6:";;
+ short | recursive ) echo "Configuration of tcl 9.0:";;
esac
cat <<\_ACEOF
@@ -978,7 +978,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-tcl configure 8.6
+tcl configure 9.0
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -992,7 +992,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by tcl $as_me 8.6, which was
+It was created by tcl $as_me 9.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1332,10 +1332,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-TCL_VERSION=8.6
-TCL_MAJOR_VERSION=8
-TCL_MINOR_VERSION=6
-TCL_PATCH_LEVEL=".1"
+TCL_VERSION=9.0
+TCL_MAJOR_VERSION=9
+TCL_MINOR_VERSION=0
+TCL_PATCH_LEVEL="a0"
VERSION=${TCL_VERSION}
#------------------------------------------------------------------------
@@ -6706,7 +6706,7 @@ fi
if test "$GCC" = yes; then
CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall"
+ CFLAGS_WARNING="-Wall -Wwrite-strings"
else
@@ -19676,7 +19676,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by tcl $as_me 8.6, which was
+This file was extended by tcl $as_me 9.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -19734,7 +19734,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-tcl config.status 8.6
+tcl config.status 9.0
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/unix/configure.in b/unix/configure.in
index 61ad30f..e2daccd 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tcl installation
dnl to configure the system for the local environment.
-AC_INIT([tcl],[8.6])
+AC_INIT([tcl],[9.0])
AC_PREREQ(2.59)
dnl This is only used when included from macosx/configure.ac
@@ -22,10 +22,10 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [
#endif /* _TCLCONFIG */])
])
-TCL_VERSION=8.6
-TCL_MAJOR_VERSION=8
-TCL_MINOR_VERSION=6
-TCL_PATCH_LEVEL=".1"
+TCL_VERSION=9.0
+TCL_MAJOR_VERSION=9
+TCL_MINOR_VERSION=0
+TCL_PATCH_LEVEL="a0"
VERSION=${TCL_VERSION}
#------------------------------------------------------------------------
diff --git a/unix/dltest/pkga.c b/unix/dltest/pkga.c
index c4d3f32..d21ef95 100644
--- a/unix/dltest/pkga.c
+++ b/unix/dltest/pkga.c
@@ -10,18 +10,9 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
/*
- * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the
- * Pkga_Init declaration is in the source file itself, which is only
- * accessed when we are building a library.
- */
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-
-/*
* Prototypes for procedures defined later in this file:
*/
@@ -71,7 +62,7 @@ Pkga_EqObjCmd(
} else {
result = 0;
}
- Tcl_SetObjResult(interp, Tcl_NewIntObj(result));
+ Tcl_SetObjResult(interp, Tcl_NewLongObj(result));
return TCL_OK;
}
@@ -124,17 +115,17 @@ Pkga_QuoteObjCmd(
*----------------------------------------------------------------------
*/
-EXTERN int
+DLLEXPORT int
Pkga_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+ if (Tcl_InitStubs(interp, "9.0", 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "Pkga", "1.0");
+ code = Tcl_PkgProvideEx(interp, "Pkga", "1.0", NULL);
if (code != TCL_OK) {
return code;
}
diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c
index f102496..3629027 100644
--- a/unix/dltest/pkgb.c
+++ b/unix/dltest/pkgb.c
@@ -11,7 +11,6 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
/*
@@ -66,7 +65,7 @@ Pkgb_SubObjCmd(
Tcl_AppendResult(interp, " in line: ", buf, NULL);
return TCL_ERROR;
}
- Tcl_SetObjResult(interp, Tcl_NewIntObj(first - second));
+ Tcl_SetObjResult(interp, Tcl_NewLongObj(first - second));
return TCL_OK;
}
diff --git a/unix/dltest/pkgc.c b/unix/dltest/pkgc.c
index 557f21b..a1d9ba0 100644
--- a/unix/dltest/pkgc.c
+++ b/unix/dltest/pkgc.c
@@ -11,18 +11,9 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
/*
- * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the
- * Pkgc_Init declaration is in the source file itself, which is only
- * accessed when we are building a library.
- */
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-
-/*
* Prototypes for procedures defined later in this file:
*/
@@ -65,7 +56,7 @@ Pkgc_SubObjCmd(
|| (Tcl_GetIntFromObj(interp, objv[2], &second) != TCL_OK)) {
return TCL_ERROR;
}
- Tcl_SetObjResult(interp, Tcl_NewIntObj(first - second));
+ Tcl_SetObjResult(interp, Tcl_NewLongObj(first - second));
return TCL_OK;
}
@@ -114,17 +105,17 @@ Pkgc_UnsafeObjCmd(
*----------------------------------------------------------------------
*/
-EXTERN int
+DLLEXPORT int
Pkgc_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+ if (Tcl_InitStubs(interp, "9.0", 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "Pkgc", "1.7.2");
+ code = Tcl_PkgProvideEx(interp, "Pkgc", "1.7.2", NULL);
if (code != TCL_OK) {
return code;
}
@@ -151,17 +142,17 @@ Pkgc_Init(
*----------------------------------------------------------------------
*/
-EXTERN int
+DLLEXPORT int
Pkgc_SafeInit(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+ if (Tcl_InitStubs(interp, "9.0", 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "Pkgc", "1.7.2");
+ code = Tcl_PkgProvideEx(interp, "Pkgc", "1.7.2", NULL);
if (code != TCL_OK) {
return code;
}
diff --git a/unix/dltest/pkgd.c b/unix/dltest/pkgd.c
index 6e114e9..3718dfb 100644
--- a/unix/dltest/pkgd.c
+++ b/unix/dltest/pkgd.c
@@ -11,18 +11,9 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
/*
- * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the
- * Pkgd_Init declaration is in the source file itself, which is only
- * accessed when we are building a library.
- */
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-
-/*
* Prototypes for procedures defined later in this file:
*/
@@ -65,7 +56,7 @@ Pkgd_SubObjCmd(
|| (Tcl_GetIntFromObj(interp, objv[2], &second) != TCL_OK)) {
return TCL_ERROR;
}
- Tcl_SetObjResult(interp, Tcl_NewIntObj(first - second));
+ Tcl_SetObjResult(interp, Tcl_NewLongObj(first - second));
return TCL_OK;
}
@@ -114,17 +105,17 @@ Pkgd_UnsafeObjCmd(
*----------------------------------------------------------------------
*/
-EXTERN int
+DLLEXPORT int
Pkgd_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+ if (Tcl_InitStubs(interp, "9.0", 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "Pkgd", "7.3");
+ code = Tcl_PkgProvideEx(interp, "Pkgd", "7.3", NULL);
if (code != TCL_OK) {
return code;
}
@@ -151,17 +142,17 @@ Pkgd_Init(
*----------------------------------------------------------------------
*/
-EXTERN int
+DLLEXPORT int
Pkgd_SafeInit(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
int code;
- if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+ if (Tcl_InitStubs(interp, "9.0", 0) == NULL) {
return TCL_ERROR;
}
- code = Tcl_PkgProvide(interp, "Pkgd", "7.3");
+ code = Tcl_PkgProvideEx(interp, "Pkgd", "7.3", NULL);
if (code != TCL_OK) {
return code;
}
diff --git a/unix/dltest/pkge.c b/unix/dltest/pkge.c
index d616352..c3380a7 100644
--- a/unix/dltest/pkge.c
+++ b/unix/dltest/pkge.c
@@ -11,17 +11,8 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
-/*
- * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the
- * Pkge_Init declaration is in the source file itself, which is only
- * accessed when we are building a library.
- */
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-
/*
*----------------------------------------------------------------------
@@ -40,15 +31,15 @@
*----------------------------------------------------------------------
*/
-EXTERN int
+DLLEXPORT int
Pkge_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
{
static const char script[] = "if 44 {open non_existent}";
- if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+ if (Tcl_InitStubs(interp, "9.0", 0) == NULL) {
return TCL_ERROR;
}
- return Tcl_Eval(interp, script);
+ return Tcl_EvalEx(interp, script, -1, 0);
}
diff --git a/unix/dltest/pkgooa.c b/unix/dltest/pkgooa.c
index 78af376..a715fbc 100644
--- a/unix/dltest/pkgooa.c
+++ b/unix/dltest/pkgooa.c
@@ -78,7 +78,7 @@ static TclOOStubs stubsCopy = {
(Tcl_Object (*) (Tcl_Interp *, Tcl_Object, const char *,
const char *t)) Pkgooa_StubsOKObjCmd
/* More entries could be here, but those are not used
- * for this test-case. So, being NULL is OK. */
+ * needed for this test-case. So, being NULL is OK. */
};
extern DLLEXPORT int
@@ -88,15 +88,7 @@ Pkgooa_Init(
{
int code;
- /* Any TclOO extension which uses stubs, calls
- * both Tcl_InitStubs and Tcl_OOInitStubs() and
- * does not use any Tcl 8.6 features should be
- * loadable in Tcl 8.5 as well, provided the
- * TclOO extension (for Tcl 8.5) is installed.
- * This worked in Tcl 8.6.0, and is expected
- * to keep working in all future Tcl 8.x releases.
- */
- if (Tcl_InitStubs(interp, "8.5", 0) == NULL) {
+ if (Tcl_InitStubs(interp, "9.0", 0) == NULL) {
return TCL_ERROR;
}
if (tclStubsPtr == NULL) {
diff --git a/unix/dltest/pkgua.c b/unix/dltest/pkgua.c
index 417bedb..a320bce 100644
--- a/unix/dltest/pkgua.c
+++ b/unix/dltest/pkgua.c
@@ -11,18 +11,9 @@
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#undef STATIC_BUILD
#include "tcl.h"
/*
- * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the
- * Pkgua_Init declaration is in the source file itself, which is only
- * accessed when we are building a library.
- */
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-
-/*
* Prototypes for procedures defined later in this file:
*/
@@ -147,7 +138,7 @@ PkguaEqObjCmd(
} else {
result = 0;
}
- Tcl_SetObjResult(interp, Tcl_NewIntObj(result));
+ Tcl_SetObjResult(interp, Tcl_NewLongObj(result));
return TCL_OK;
}
@@ -200,7 +191,7 @@ PkguaQuoteObjCmd(
*----------------------------------------------------------------------
*/
-EXTERN int
+DLLEXPORT int
Pkgua_Init(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
@@ -208,7 +199,7 @@ Pkgua_Init(
int code, cmdIndex = 0;
Tcl_Command *cmdTokens;
- if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+ if (Tcl_InitStubs(interp, "9.0", 0) == NULL) {
return TCL_ERROR;
}
@@ -219,7 +210,7 @@ Pkgua_Init(
PkguaInitTokensHashTable();
- code = Tcl_PkgProvide(interp, "Pkgua", "1.0");
+ code = Tcl_PkgProvideEx(interp, "Pkgua", "1.0", NULL);
if (code != TCL_OK) {
return code;
}
@@ -253,7 +244,7 @@ Pkgua_Init(
*----------------------------------------------------------------------
*/
-EXTERN int
+DLLEXPORT int
Pkgua_SafeInit(
Tcl_Interp *interp) /* Interpreter in which the package is to be
* made available. */
@@ -278,7 +269,7 @@ Pkgua_SafeInit(
*----------------------------------------------------------------------
*/
-EXTERN int
+DLLEXPORT int
Pkgua_Unload(
Tcl_Interp *interp, /* Interpreter from which the package is to be
* unloaded. */
@@ -331,7 +322,7 @@ Pkgua_Unload(
*----------------------------------------------------------------------
*/
-EXTERN int
+DLLEXPORT int
Pkgua_SafeUnload(
Tcl_Interp *interp, /* Interpreter from which the package is to be
* unloaded. */
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index d81af1a..3f00e5b 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1096,7 +1096,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG=-g
AS_IF([test "$GCC" = yes], [
CFLAGS_OPTIMIZE=-O2
- CFLAGS_WARNING="-Wall"
+ CFLAGS_WARNING="-Wall -Wwrite-strings"
], [
CFLAGS_OPTIMIZE=-O
CFLAGS_WARNING=""
diff --git a/unix/tcl.spec b/unix/tcl.spec
index 678222c..f4839ce 100644
--- a/unix/tcl.spec
+++ b/unix/tcl.spec
@@ -4,7 +4,7 @@
Name: tcl
Summary: Tcl scripting language development environment
-Version: 8.6.1
+Version: 9.0a0
Release: 2
License: BSD
Group: Development/Languages
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index e55dcd0..23d6026 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -115,9 +115,6 @@
/* Define to 1 if you have the `gmtime_r' function. */
#undef HAVE_GMTIME_R
-/* Compiler support for module scope symbols */
-#undef HAVE_HIDDEN
-
/* Do we have the intptr_t type? */
#undef HAVE_INTPTR_T
@@ -346,6 +343,9 @@
/* Do we have <values.h>? */
#undef NO_VALUES_H
+/* Compiler support for module scope symbols */
+#undef HAVE_HIDDEN
+
/* Do we have wait3() */
#undef NO_WAIT3
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index fdc9d1d..9b4d690 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -61,7 +61,7 @@
* This structure describes per-instance state of a file based channel.
*/
-typedef struct FileState {
+typedef struct {
Tcl_Channel channel; /* Channel associated with this file. */
int fd; /* File handle. */
int validMask; /* OR'ed combination of TCL_READABLE,
@@ -76,7 +76,7 @@ typedef struct FileState {
* a platform-independant manner.
*/
-typedef struct TtyAttrs {
+typedef struct {
int baud;
int parity;
int data;
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index 2a68f7f..e5929ba 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -8,8 +8,6 @@
*/
#include "tclInt.h"
-#include <pwd.h>
-#include <grp.h>
#include <errno.h>
#include <string.h>
@@ -49,7 +47,7 @@
#ifdef TCL_THREADS
-typedef struct ThreadSpecificData {
+typedef struct {
struct passwd pwd;
#if defined(HAVE_GETPWNAM_R_5) || defined(HAVE_GETPWUID_R_5)
#define NEED_PW_CLEANER 1
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 3b1b6ca..774f0f7 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -41,8 +41,6 @@
*/
#include "tclInt.h"
-#include <utime.h>
-#include <grp.h>
#ifndef HAVE_STRUCT_STAT_ST_BLKSIZE
#ifndef NO_FSTATFS
#include <sys/statfs.h>
@@ -1369,7 +1367,7 @@ GetGroupAttribute(
groupPtr = TclpGetGrGid(statBuf.st_gid);
if (groupPtr == NULL) {
- *attributePtrPtr = Tcl_NewIntObj((int) statBuf.st_gid);
+ *attributePtrPtr = Tcl_NewLongObj((long) statBuf.st_gid);
} else {
Tcl_DString ds;
const char *utf;
@@ -1423,7 +1421,7 @@ GetOwnerAttribute(
pwPtr = TclpGetPwUid(statBuf.st_uid);
if (pwPtr == NULL) {
- *attributePtrPtr = Tcl_NewIntObj((int) statBuf.st_uid);
+ *attributePtrPtr = Tcl_NewLongObj((long) statBuf.st_uid);
} else {
Tcl_DString ds;
@@ -2441,7 +2439,7 @@ GetUnixFileAttributes(
return TCL_ERROR;
}
- *attributePtrPtr = Tcl_NewBooleanObj(statBuf.st_flags&UF_IMMUTABLE);
+ *attributePtrPtr = Tcl_NewLongObj((statBuf.st_flags&UF_IMMUTABLE)!=0);
return TCL_OK;
}
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index 1617cba..8207612 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -45,12 +45,12 @@ static const char *const platforms[NUMPLATFORMS] = {
};
#define NUMPROCESSORS 11
-static const char *const processors[NUMPROCESSORS] = {
+static const char *const processors[NUMPROCESSORS] = {
"intel", "mips", "alpha", "ppc", "shx", "arm", "ia64", "alpha64", "msil",
"amd64", "ia32_on_win64"
};
-typedef struct _SYSTEM_INFO {
+typedef struct {
union {
DWORD dwOemId;
struct {
@@ -69,7 +69,7 @@ typedef struct _SYSTEM_INFO {
int wProcessorRevision;
} SYSTEM_INFO;
-typedef struct _OSVERSIONINFOW {
+typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
@@ -115,7 +115,7 @@ static char pkgPath[sizeof(TCL_PACKAGE_PATH)+200] = TCL_PACKAGE_PATH;
* first list checked for a mapping from env encoding to Tcl encoding name.
*/
-typedef struct LocaleTable {
+typedef struct {
const char *lang;
const char *encoding;
} LocaleTable;
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index b234667..043735a 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -39,7 +39,7 @@ typedef struct FileHandler {
* handlers are ready to fire.
*/
-typedef struct FileHandlerEvent {
+typedef struct {
Tcl_Event header; /* Information that is standard for all
* events. */
int fd; /* File descriptor that is ready. Used to find
@@ -54,7 +54,7 @@ typedef struct FileHandlerEvent {
* writable, and exception conditions.
*/
-typedef struct SelectMasks {
+typedef struct {
fd_set readable;
fd_set writable;
fd_set exception;
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c
index 9c21b28..ac9ba77 100644
--- a/unix/tclUnixPipe.c
+++ b/unix/tclUnixPipe.c
@@ -30,7 +30,7 @@
* This structure describes per-instance state of a pipe based channel.
*/
-typedef struct PipeState {
+typedef struct {
Tcl_Channel channel; /* Channel associated with this file. */
TclFile inFile; /* Output from pipe. */
TclFile outFile; /* Input to pipe. */
@@ -870,7 +870,7 @@ TclGetAndDetachPids(
pipePtr = Tcl_GetChannelInstanceData(chan);
TclNewObj(pidsObj);
for (i = 0; i < pipePtr->numPids; i++) {
- Tcl_ListObjAppendElement(NULL, pidsObj, Tcl_NewIntObj(
+ Tcl_ListObjAppendElement(NULL, pidsObj, Tcl_NewLongObj(
PTR2INT(pipePtr->pidPtr[i])));
Tcl_DetachPids(1, &pipePtr->pidPtr[i]);
}
@@ -1288,7 +1288,7 @@ Tcl_PidObjCmd(
resultPtr = Tcl_NewObj();
for (i = 0; i < pipePtr->numPids; i++) {
Tcl_ListObjAppendElement(NULL, resultPtr,
- Tcl_NewIntObj(PTR2INT(TclpGetPid(pipePtr->pidPtr[i]))));
+ Tcl_NewLongObj(PTR2INT(TclpGetPid(pipePtr->pidPtr[i]))));
}
Tcl_SetObjResult(interp, resultPtr);
}
diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c
index 4b0f369..31a0719 100644
--- a/unix/tclUnixTest.c
+++ b/unix/tclUnixTest.c
@@ -37,7 +37,7 @@
* exercised by the "testfilehandler" command.
*/
-typedef struct Pipe {
+typedef struct {
TclFile readFile; /* File handle for reading from the pipe. NULL
* means pipe doesn't exist yet. */
TclFile writeFile; /* File handle for writing from the pipe. */
@@ -68,10 +68,10 @@ static Tcl_CmdProc TestfilehandlerCmd;
static Tcl_CmdProc TestfilewaitCmd;
static Tcl_CmdProc TestfindexecutableCmd;
static Tcl_ObjCmdProc TestforkObjCmd;
-static Tcl_CmdProc TestgetdefencdirCmd;
+static Tcl_ObjCmdProc TestgetdefencdirCmd;
static Tcl_CmdProc TestgetopenfileCmd;
static Tcl_CmdProc TestgotsigCmd;
-static Tcl_CmdProc TestsetdefencdirCmd;
+static Tcl_ObjCmdProc TestsetdefencdirCmd;
static Tcl_FileProc TestFileHandlerProc;
static void AlarmHandler(int signum);
@@ -108,9 +108,9 @@ TclplatformtestInit(
NULL, NULL);
Tcl_CreateCommand(interp, "testgetopenfile", TestgetopenfileCmd,
NULL, NULL);
- Tcl_CreateCommand(interp, "testgetdefenc", TestgetdefencdirCmd,
+ Tcl_CreateObjCommand(interp, "testgetdefenc", TestgetdefencdirCmd,
NULL, NULL);
- Tcl_CreateCommand(interp, "testsetdefenc", TestsetdefencdirCmd,
+ Tcl_CreateObjCommand(interp, "testsetdefenc", TestsetdefencdirCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testalarm", TestalarmCmd,
NULL, NULL);
@@ -517,16 +517,22 @@ static int
TestsetdefencdirCmd(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- const char **argv) /* Argument strings. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const *objv) /* Argument strings. */
{
- if (argc != 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " defaultDir\"", NULL);
+ Tcl_Obj *searchPath;
+
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "defaultDir");
return TCL_ERROR;
}
- Tcl_SetDefaultEncodingDir(argv[1]);
+ searchPath = Tcl_GetEncodingSearchPath();
+
+ searchPath = Tcl_DuplicateObj(searchPath);
+ Tcl_ListObjReplace(NULL, searchPath, 0, 0, 1, &objv[1]);
+ Tcl_SetEncodingSearchPath(searchPath);
+
return TCL_OK;
}
@@ -596,15 +602,25 @@ static int
TestgetdefencdirCmd(
ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- const char **argv) /* Argument strings. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const *objv) /* Argument strings. */
{
- if (argc != 1) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], NULL);
- return TCL_ERROR;
+ int numDirs;
+ Tcl_Obj *first, *searchPath;
+
+ if (objc != 1) {
+ Tcl_WrongNumArgs(interp, 1, objv, NULL);
+ return TCL_ERROR;
+ }
+
+ searchPath = Tcl_GetEncodingSearchPath();
+ Tcl_ListObjLength(interp, searchPath, &numDirs);
+ if (numDirs == 0) {
+ return TCL_ERROR;
}
+ Tcl_ListObjIndex(NULL, searchPath, 0, &first);
- Tcl_AppendResult(interp, Tcl_GetDefaultEncodingDir(), NULL);
+ Tcl_SetObjResult(interp, first);
return TCL_OK;
}
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index f469341..c943b77 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -15,12 +15,6 @@
#ifdef TCL_THREADS
-typedef struct ThreadSpecificData {
- char nabuf[16];
-} ThreadSpecificData;
-
-static Tcl_ThreadDataKey dataKey;
-
/*
* masterLock is used to serialize creation of mutexes, condition variables,
* and thread local storage. This is the only place that can count on the
@@ -631,50 +625,6 @@ TclpFinalizeCondition(
}
#endif /* TCL_THREADS */
-/*
- *----------------------------------------------------------------------
- *
- * TclpReaddir, TclpInetNtoa --
- *
- * These procedures replace core C versions to be used in a threaded
- * environment.
- *
- * Results:
- * See documentation of C functions.
- *
- * Side effects:
- * See documentation of C functions.
- *
- * Notes:
- * TclpReaddir is no longer used by the core (see 1095909), but it
- * appears in the internal stubs table (see #589526).
- *
- *----------------------------------------------------------------------
- */
-
-Tcl_DirEntry *
-TclpReaddir(
- DIR * dir)
-{
- return TclOSreaddir(dir);
-}
-
-#undef TclpInetNtoa
-char *
-TclpInetNtoa(
- struct in_addr addr)
-{
-#ifdef TCL_THREADS
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- unsigned char *b = (unsigned char*) &addr.s_addr;
-
- sprintf(tsdPtr->nabuf, "%u.%u.%u.%u", b[0], b[1], b[2], b[3]);
- return tsdPtr->nabuf;
-#else
- return inet_ntoa(addr);
-#endif
-}
-
#ifdef TCL_THREADS
/*
* Additions by AOL for specialized thread memory allocator.
@@ -684,7 +634,7 @@ TclpInetNtoa(
static volatile int initialized = 0;
static pthread_key_t key;
-typedef struct allocMutex {
+typedef struct {
Tcl_Mutex tlock;
pthread_mutex_t plock;
} allocMutex;
@@ -692,10 +642,10 @@ typedef struct allocMutex {
Tcl_Mutex *
TclpNewAllocMutex(void)
{
- struct allocMutex *lockPtr;
+ allocMutex *lockPtr;
register pthread_mutex_t *plockPtr;
- lockPtr = malloc(sizeof(struct allocMutex));
+ lockPtr = malloc(sizeof(allocMutex));
if (lockPtr == NULL) {
Tcl_Panic("could not allocate lock");
}
diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c
index 926e8f4..27b6a58 100644
--- a/unix/tclUnixTime.c
+++ b/unix/tclUnixTime.c
@@ -16,38 +16,10 @@
#include <mach/mach_time.h>
#endif
-#define TM_YEAR_BASE 1900
-#define IsLeapYear(x) (((x)%4 == 0) && ((x)%100 != 0 || (x)%400 == 0))
-
-/*
- * TclpGetDate is coded to return a pointer to a 'struct tm'. For thread
- * safety, this structure must be in thread-specific data. The 'tmKey'
- * variable is the key to this buffer.
- */
-
-static Tcl_ThreadDataKey tmKey;
-typedef struct ThreadSpecificData {
- struct tm gmtime_buf;
- struct tm localtime_buf;
-} ThreadSpecificData;
-
-/*
- * If we fall back on the thread-unsafe versions of gmtime and localtime, use
- * this mutex to try to protect them.
- */
-
-TCL_DECLARE_MUTEX(tmMutex)
-
-static char *lastTZ = NULL; /* Holds the last setting of the TZ
- * environment variable, or an empty string if
- * the variable was not set. */
-
/*
* Static functions declared in this file.
*/
-static void SetTZIfNecessary(void);
-static void CleanupMemory(ClientData clientData);
static void NativeScaleTime(Tcl_Time *timebuf,
ClientData clientData);
static void NativeGetTime(Tcl_Time *timebuf,
@@ -251,114 +223,6 @@ Tcl_GetTime(
/*
*----------------------------------------------------------------------
*
- * TclpGetDate --
- *
- * This function converts between seconds and struct tm. If useGMT is
- * true, then the returned date will be in Greenwich Mean Time (GMT).
- * Otherwise, it will be in the local time zone.
- *
- * Results:
- * Returns a static tm structure.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-struct tm *
-TclpGetDate(
- const time_t *time,
- int useGMT)
-{
- if (useGMT) {
- return TclpGmtime(time);
- } else {
- return TclpLocaltime(time);
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpGmtime --
- *
- * Wrapper around the 'gmtime' library function to make it thread safe.
- *
- * Results:
- * Returns a pointer to a 'struct tm' in thread-specific data.
- *
- * Side effects:
- * Invokes gmtime or gmtime_r as appropriate.
- *
- *----------------------------------------------------------------------
- */
-
-struct tm *
-TclpGmtime(
- const time_t *timePtr) /* Pointer to the number of seconds since the
- * local system's epoch */
-{
- /*
- * Get a thread-local buffer to hold the returned time.
- */
-
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&tmKey);
-
-#ifdef HAVE_GMTIME_R
- gmtime_r(timePtr, &tsdPtr->gmtime_buf);
-#else
- Tcl_MutexLock(&tmMutex);
- memcpy(&tsdPtr->gmtime_buf, gmtime(timePtr), sizeof(struct tm));
- Tcl_MutexUnlock(&tmMutex);
-#endif
-
- return &tsdPtr->gmtime_buf;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * TclpLocaltime --
- *
- * Wrapper around the 'localtime' library function to make it thread
- * safe.
- *
- * Results:
- * Returns a pointer to a 'struct tm' in thread-specific data.
- *
- * Side effects:
- * Invokes localtime or localtime_r as appropriate.
- *
- *----------------------------------------------------------------------
- */
-
-struct tm *
-TclpLocaltime(
- const time_t *timePtr) /* Pointer to the number of seconds since the
- * local system's epoch */
-{
- /*
- * Get a thread-local buffer to hold the returned time.
- */
-
- ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&tmKey);
-
- SetTZIfNecessary();
-#ifdef HAVE_LOCALTIME_R
- localtime_r(timePtr, &tsdPtr->localtime_buf);
-#else
- Tcl_MutexLock(&tmMutex);
- memcpy(&tsdPtr->localtime_buf, localtime(timePtr), sizeof(struct tm));
- Tcl_MutexUnlock(&tmMutex);
-#endif
-
- return &tsdPtr->localtime_buf;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* Tcl_SetTimeProc --
*
* TIP #233 (Virtualized Time): Registers two handlers for the
@@ -470,70 +334,6 @@ NativeGetTime(
timePtr->sec = tv.tv_sec;
timePtr->usec = tv.tv_usec;
}
-/*
- *----------------------------------------------------------------------
- *
- * SetTZIfNecessary --
- *
- * Determines whether a call to 'tzset' is needed prior to the next call
- * to 'localtime' or examination of the 'timezone' variable.
- *
- * Results:
- * None.
- *
- * Side effects:
- * If 'tzset' has never been called in the current process, or if the
- * value of the environment variable TZ has changed since the last call
- * to 'tzset', then 'tzset' is called again.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-SetTZIfNecessary(void)
-{
- const char *newTZ = getenv("TZ");
-
- Tcl_MutexLock(&tmMutex);
- if (newTZ == NULL) {
- newTZ = "";
- }
- if (lastTZ == NULL || strcmp(lastTZ, newTZ)) {
- tzset();
- if (lastTZ == NULL) {
- Tcl_CreateExitHandler(CleanupMemory, NULL);
- } else {
- ckfree(lastTZ);
- }
- lastTZ = ckalloc(strlen(newTZ) + 1);
- strcpy(lastTZ, newTZ);
- }
- Tcl_MutexUnlock(&tmMutex);
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * CleanupMemory --
- *
- * Releases the private copy of the TZ environment variable upon exit
- * from Tcl.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Frees allocated memory.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-CleanupMemory(
- ClientData ignored)
-{
- ckfree(lastTZ);
-}
/*
* Local Variables: