Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcl/tcl/ChangeLog,v
retrieving revision 1.723
diff -u -3 -r1.723 ChangeLog
--- ChangeLog	2001/11/21 17:37:49	1.723
+++ ChangeLog	2001/11/23 01:01:47
@@ -1,3 +1,210 @@
+2001-11-23  Daniel Steffen <das@users.sourceforge.net>
+
+	**  upport to 8.4 of mac code changes for 8.3.3 & various new
+	**  changes for 8.4, some already backported to 8.3.4 (patch #435658)
+
+	* generic/tclObj.c: added #include to fix missing prototype errors
+
+	* generic/tcl.h: MAC_TCL: addition of ConditionalMacros.h and use of
+	DLLIMPORT and DLLEXPORT like on other platforms.  ( => no longer need
+	the .exp files and can remove use of #pragma export that never worked
+	well)
+	removed line continuation in #if clause as this breaks the mac
+	resource compiler (note that *.r files include tcl.h)
+
+	* mac/tclMacFile.c: fixed bug in permission checking code
+
+	* mac/tclMacLoad.c: corrected utf8 handling, comparison of
+	package names to code fragment names changed to only match on the
+	length of package name, this allows for fragment names with version
+	numbers appended
+
+	* mac/tclMacInt.h:
+	* generic/tclInt.h:
+	* mac/tclMacTime.c:
+	* generic/tclIOUtil.c: moved declaration of TclpGetGMTOffset()
+
+	* mac/tclMacShLib.exp:
+	* mac/tclMacOSA.exp:
+	* mac/tclMacMSLPrefix.h: removed files
+
+	* unix/Makefile.in: removed reference to .exp files
+
+	* mac/MW_TclBuildLibHeader.h:
+	* mac/MW_TclBuildLibHeader.pch:
+	* mac/MW_TclHeaderCommon.h:
+	* mac/MW_TclStaticHeader.h:
+	* mac/MW_TclStaticHeader.pch: new precompiled header files
+
+	* mac/MW_TclAppleScriptHeader.pch:
+	* mac/MW_TclHeader.pch:
+	* mac/MW_TclTestHeader.pch:
+	* mac/tclMacCommonPch.h: revised precompiled header handling: now
+	include a common header file 'MW_TclHeaderCommon.h' from all .pch
+	files, the .pch files themselves now only setup #defines (e.g.
+	BUILD_tcl, STATIC_BUILD, TCL_DEBUG, TCL_THREADS) like in makefiles on
+	other platforms.
+
+	* mac/tclMac.h:
+	* mac/tclMacPort.h:
+	* mac/tclMacInt.h: use of BUILD_tcl and TCL_STORAGE_CLASS like on other
+	platforms, standardize #include'd files to what's done on other
+	platforms, removed use of #pragma export.
+
+	* mac/tcltkMacBuildSupport.sea.hqx: new archive of mac build support
+	files & suggested build environment directory hierarchy: 
+	- 'Building MacTclTk' & 'CW Pro6 changes' readme's.
+	- projects for MoreFiles 1.5.2 static & shared libraries.
+	- project & sources for 'pseudoCarbonSupport', see below.
+	- included XML versions of the projects for CW Pro5 or Pro7 users.
+
+	* mac/tclMacProjects.sea.hqx: updated mac build project files:
+	- build support for CodeWarrior Pro6, UnivIntf 3.4 & shared runtime
+	libraries: the MSL libraries and MoreFiles are no longer compiled into
+	Tcl.shlb, all non-static binaries now use the Pro6 shared runtime
+	libraries and MoreFiles.shlb.  These shlbs are merged into the standard
+	Wish and TclShell, but 3rd party applications linking with Tcl.shlb or
+	Tk.shlb need to setup access to them.  (see the "(sh-ppc)" targets
+	for how to do this.)
+	- included XML versions of the projects for CW Pro5 or Pro7 users.
+	- use compat/strtod.c instead of MSL's strtod()
+	- use WASTE versions of MSL for tcl test target to avoid text buffer
+	cutoff at 32k.
+	- Merging the full MSL.shlb and the other shlbs into Wish & TclShell
+	makes them a bit larger than before, use unmerged binaries to avoid
+	copying the shared code with every application, e.g. when deploying
+	numerous Wish based droplets.
+	- Note that using CW Pro5 to compile extensions is in principle still
+	possible, but need to link with Pro6 runtime libraries.
+	- Tclapplescript now loads and runs on CFM68k.
+	- Highly experimental "pseudoCarbon" support for Tcl only on OS 8/9:
+	binaries in "Build:(Carbon):" link against CarbonLib instead of
+	InterfaceLib, however the actual code has not been carbonized! i.e. it
+	will not run on OSX and may not even run properly with CarbonLib. 
+	This should in principle allow you to build & test OS9 CFM Carbon
+	binaries that need to link with Tcl.shlb.  On OSX you can use the
+	native Tcl.framework, but you have to build a MachO binary as there
+	is no CFM glue lib for Tcl.framework.
+	the library pseudoCarbonSupport.shlb manually loads the symbols
+	from InterfaceLib that are not in CarbonLib but are needed by the
+	uncarbonized code in Tcl.shlb and TclShell.
+
+	* generic/tclMain.c: MAC_TCL: workaround for broken/non-standard isatty
+	on MW Pro6, #include <unistd.h> instead of defining isatty
+
+	* mac/tclMacPort.h: MW Pro6 changes for MSL fcntl.h, stat.h & isatty
+
+	* mac/tclMacAppInit.c: add EXTERN to InstallConsole to enable DLL
+	export via the TCL_STORAGE_CLASS mechanism.
+
+	* mac/tclMacFCmd.c: fix for FSpDirectoryCopy API change
+
+	* mac/tclMacLibrary.c: emit compile time error when
+	TCL_REGISTER_LIBRARY and USE_TCL_STUBS are both defined at the same
+	time in an extension, this use is not currently supported and will
+	result in a crash when dynamically loading the extension.
+
+	* mac/tclMacApplication.r:
+	* mac/tclMacLibrary.r:
+	* mac/tclMacOSA.r:
+	* mac/tclMacResource.r: fixed obsolete copyrights/dates in version
+	strings; updated version strings to standard usage; added support for
+	'(Support Libraries)' subfolder for shared runtime libraries in
+	unmerged binaries; commented out demo setting of "Tcl Environment
+	Variables"; reorganized resources among these files to avoid 
+	multiple copies in applications and shared libraries, the script
+	libraries are now no longer duplicated in Tclsh but are only included 
+	in the resources of Tcl.shlb.
+
+	* mac/tclMacChan.c:
+	* mac/tclMacSock.c: cast for *BlockMode
+
+	* mac/tclMacUtil.c:
+	* mac/tclMacMath.h: removed obsolete hypot() definition
+
+	* generic/tclIntPlatDecls.h:
+	* generic/tclInt.decls:
+	* generic/tclStubInit.c:
+	* mac/tclMacNotify.c:
+	* mac/tclMacOSA.c:
+	* mac/tclMacUtil.c:
+	* generic/tclThreadTest.c: renamed routines conflicting with standard
+	Apple or MoreFiles headers (at compile or link time):
+	    GetGlobalMouse         -> GetGlobalMouseTcl
+    	FSpGetDirectoryID      -> FSpGetDirectoryIDTcl
+    	FSpOpenResFileCompat   -> FSpOpenResFileCompatTcl
+    	FSpCreateResFileCompat -> FSpCreateResFileCompatTcl
+		NewThread              -> NewTestThread
+	the renamed MoreFiles *Tcl routines are just wrappers calling into the
+	MoreFiles DLL.
+
+	* mac/tclMacCommonPch.h:
+	* mac/tclMacThrd.c:
+	* mac/tclMacPanic.c: removed OLDROUTINENAMES define, renamed obsolete
+	apple API names to modern equivalents; UH3.4 support: added #include
+	<ControlDefinitions.h>, updated New*Proc() calls to New*UPP().
+
+	* mac/tclMacUnix.c: added missing (Tcl_Obj ***) cast to
+	Tcl_ListObjGetElements call
+
+	* mac/tclMacAlloc.c: modernized TclpSysAlloc() to use temporary
+	memory instead of system heap memory when available (MacOS
+	>= 7.5 and possibly earlier, use of system heap has been
+	discouraged for a long time and has many disadvantages, e.g. memory
+	isn't paged out, and errors can very easily bring the system down);
+	fixed crashing bug in TclpSysRealloc() and CleanUpExitProc() where
+	memory was being accessed after having been deallocated; fixed
+	memory leak in (de)allocation code (for every block ever allocated
+	with TclpSysAlloc, a Ptr was leaked), if temporary memory is
+	available, don't track allocated memory, instead use
+	RecoverHandle() to get Handle from Ptr, otherwise use doubly linked
+	list to correctly track memory and free all allocated memory; added
+	new option for ConfigureMemory: MEMORY_DONT_USE_TEMPMEM, disables
+	use of temporary memory even when it would be available, only
+	necessary when writing e.g. a driver (using tcl??); increased
+	fraction of application heap reserved for OS routines to 512K
+
+	* compat/strftime.c: 
+	* mac/tclMacTime.c:
+	* mac/tclMacPort.h:
+	* generic/tclInt.decls: 
+	* generic/tclIntPlatDecls.h:
+	* generic/tclStubInit.c: timezone support for mac via 
+	TclpGetTZName() like on windows, using an inverse timezone table
+	adapted from tclDate.c to map gmtoffset in seconds gotten from
+	the MacOS APIs to a  timezone string, as there is no good way to get
+	this info from MacOS. I had to make up some unusual timezones and
+	arbitrarily decide on the most standard of the multiple choices
+	available for every timezone.
+
+	* generic/tclExecute.c: workaround for a MSL bug/misfeature: for
+	very small floats, MSL can return errno ERANGE but a
+	non-zero value ( < LDBL_MIN however)
+	
+	* mac/tclMacAppInit.c: support for WASTE text library using
+	temporary memory, setting has no effect if WASTE is not used.
+	
+	* mac/tclMacPanic.c: removed duplicate code from generic/tclPanic.c
+	and added that file to projects instead.
+
+	* tests/all.tcl: set tcltest::singleProcess 1 as multiple processes
+	are not available on the mac.
+	
+	* tests/cmdAH.test: access time not available on the mac, skip the 
+	atime touch test
+	
+	* tests/appendComp.test:
+	* tests/cmdMZ.test:
+	* tests/compile.test:
+	* tests/exec.test:
+	* tests/fileName.test:
+	* tests/lset.test:
+	* tests/namespace.test:
+	* tests/tcltest.test: added missing cleanups/tests/catches that
+	caused tests to fail on the mac.
+
+	* doc/tclvars.n: doc bug, env(PWD) should be env(HOME) [Bug 463834]
+	
 2001-11-21  Don Porter	<dgp@users.sourceforge.net>
 
 	* tests/trace.test (trace-8.8): Corrected test for Bug 219393.
Index: compat/strftime.c
===================================================================
RCS file: /cvsroot/tcl/tcl/compat/strftime.c,v
retrieving revision 1.7
diff -u -3 -r1.7 strftime.c
--- compat/strftime.c	2000/01/15 01:50:43	1.7
+++ compat/strftime.c	2001/11/23 01:00:52
@@ -324,7 +324,6 @@
 		    if (!_conv((t->tm_year + TM_YEAR_BASE), 4, '0'))
 			return(0);
 		    continue;
-#ifndef MAC_TCL
 		case 'Z': {
 		    char *name = TclpGetTZName(t->tm_isdst);
 		    if (name && !_add(name)) {
@@ -332,7 +331,6 @@
 		    }
 		    continue;
 		}
-#endif
 		case '%':
 		    /*
 		     * X311J/88-090 (4.12.3.5): if conversion char is
Index: compat/strtod.c
===================================================================
RCS file: /cvsroot/tcl/tcl/compat/strtod.c,v
retrieving revision 1.3
diff -u -3 -r1.3 strtod.c
--- compat/strtod.c	2001/09/04 23:16:18	1.3
+++ compat/strtod.c	2001/11/23 01:00:52
@@ -13,6 +13,7 @@
  */
 
 #include "tcl.h"
+#include "tclPort.h"
 #ifdef NO_STDLIB_H
 #   include "../compat/stdlib.h"
 #else
Index: doc/tclvars.n
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/tclvars.n,v
retrieving revision 1.9
diff -u -3 -r1.9 tclvars.n
--- doc/tclvars.n	2001/09/17 11:51:58	1.9
+++ doc/tclvars.n	2001/11/23 01:00:54
@@ -87,7 +87,7 @@
 \fBSTART_UP_FOLDER\fR
 The path to the start up directory.
 .TP
-\fBPWD\fR
+\fBHOME\fR
 The path to the application's default directory.
 .PP
 You can also create your own environment variables for the Macintosh.
Index: generic/tcl.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.h,v
retrieving revision 1.105
diff -u -3 -r1.105 tcl.h
--- generic/tcl.h	2001/11/19 14:35:54	1.105
+++ generic/tcl.h	2001/11/23 01:00:55
@@ -71,8 +71,7 @@
  */
 
 #ifndef __WIN32__
-#   if defined(_WIN32) || defined(WIN32) || \
-       defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__)
+#   if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__)
 #	define __WIN32__
 #	ifndef WIN32
 #	    define WIN32
@@ -102,6 +101,7 @@
  */
 
 #ifdef MAC_TCL
+#include <ConditionalMacros.h>
 #   ifndef HAS_STDARG
 #	define HAS_STDARG 1
 #   endif
@@ -222,7 +222,7 @@
 #   define DLLIMPORT
 #   define DLLEXPORT
 #else
-#   if defined(__WIN32__) && (defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || (defined(__GNUC__) && defined(__declspec)))
+#   if (defined(__WIN32__) && (defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || (defined(__GNUC__) && defined(__declspec)))) || (defined(MAC_TCL) && FUNCTION_DECLSPEC)
 #	define DLLIMPORT __declspec(dllimport)
 #	define DLLEXPORT __declspec(dllexport)
 #   else
@@ -244,7 +244,7 @@
  * name of a library we are building, is set on the compile line for sources
  * that are to be placed in the library.  When this macro is set, the
  * storage class will be set to DLLEXPORT.  At the end of the header file, the
- * storage class will be reset to DLLIMPORt.
+ * storage class will be reset to DLLIMPORT.
  */
 
 #undef TCL_STORAGE_CLASS
@@ -2149,7 +2149,20 @@
  * accessible via the stubs table.
  */
 
+/*
+ * tclPlatDecls.h can't be included here on the Mac, as we need
+ * Mac specific headers to define the Mac types used in this file,
+ * but these Mac haders conflict with a number of tk types
+ * and thus can't be included in the globally read tcl.h
+ * This header was originally added here as a fix for bug 5241
+ * (stub link error for symbols in TclPlatStubs table), as a work-
+ * around for the bug on the mac, tclMac.h is included immediately 
+ * after tcl.h in the tcl precompiled header (with DLLEXPORT set).
+ */
+
+#if !defined(MAC_TCL)
 #include "tclPlatDecls.h"
+#endif
 
 /*
  * Public functions that are not accessible via the stubs table.
Index: generic/tclIOUtil.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIOUtil.c,v
retrieving revision 1.25
diff -u -3 -r1.25 tclIOUtil.c
--- generic/tclIOUtil.c	2001/11/02 12:06:27	1.25
+++ generic/tclIOUtil.c	2001/11/23 01:01:05
@@ -22,6 +22,9 @@
 
 #include "tclInt.h"
 #include "tclPort.h"
+#ifdef MAC_TCL
+#include "tclMacInt.h"
+#endif
 
 /*
  * Prototypes for procedures defined later in this file.  The last
Index: generic/tclInt.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.decls,v
retrieving revision 1.37
diff -u -3 -r1.37 tclInt.decls
--- generic/tclInt.decls	2001/11/21 02:36:20	1.37
+++ generic/tclInt.decls	2001/11/23 01:00:59
@@ -696,7 +696,7 @@
 	    Boolean createFolder, FSSpec *spec)
 }
 declare 7 mac {
-    void GetGlobalMouse(Point *mouse)
+    void GetGlobalMouseTcl(Point *mouse)
 }
 
 # The following routines are utility functions in Tcl.  They are exported
@@ -704,15 +704,15 @@
 # however.  The first set are from the MoreFiles package.
 
 declare 8 mac {
-    pascal OSErr FSpGetDirectoryID(CONST FSSpec *spec, long *theDirID, \
+    pascal OSErr FSpGetDirectoryIDTcl(CONST FSSpec *spec, long *theDirID, \
 	    Boolean *isDirectory)
 }
 declare 9 mac {
-    pascal short FSpOpenResFileCompat(CONST FSSpec *spec, \
+    pascal short FSpOpenResFileCompatTcl(CONST FSSpec *spec, \
 	    SignedByte permission)
 }
 declare 10 mac {
-    pascal void FSpCreateResFileCompat(CONST FSSpec *spec, OSType creator, \
+    pascal void FSpCreateResFileCompatTcl(CONST FSSpec *spec, OSType creator, \
 	    OSType fileType, ScriptCode scriptTag)
 }
 
@@ -767,6 +767,9 @@
 #  declare 24 mac {
 #      int TclMacReadlink(char *path, char *buf, int size)
 #  }
+declare 24 mac {
+    char * TclpGetTZName(int isdst)
+}
 declare 25 mac {
     int TclMacChmod(char *path, int mode)
 }
Index: generic/tclInt.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.h,v
retrieving revision 1.70
diff -u -3 -r1.70 tclInt.h
--- generic/tclInt.h	2001/11/21 02:36:20	1.70
+++ generic/tclInt.h	2001/11/23 01:01:01
@@ -1799,7 +1799,6 @@
 EXTERN void		TclpFree _ANSI_ARGS_((char *ptr));
 EXTERN unsigned long	TclpGetClicks _ANSI_ARGS_((void));
 EXTERN Tcl_Channel	TclpGetDefaultStdChannel _ANSI_ARGS_((int type));
-EXTERN long		TclpGetGMTOffset _ANSI_ARGS_((void));
 EXTERN unsigned long	TclpGetSeconds _ANSI_ARGS_((void));
 EXTERN int		TclpGetTimeZone _ANSI_ARGS_((unsigned long time));
 EXTERN char *		TclpGetUserHome _ANSI_ARGS_((CONST char *name,
Index: generic/tclIntPlatDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIntPlatDecls.h,v
retrieving revision 1.12
diff -u -3 -r1.12 tclIntPlatDecls.h
--- generic/tclIntPlatDecls.h	2001/09/10 17:17:41	1.12
+++ generic/tclIntPlatDecls.h	2001/11/23 01:01:01
@@ -149,15 +149,15 @@
 				OSType folderType, Boolean createFolder, 
 				FSSpec * spec));
 /* 7 */
-EXTERN void		GetGlobalMouse _ANSI_ARGS_((Point * mouse));
+EXTERN void		GetGlobalMouseTcl _ANSI_ARGS_((Point * mouse));
 /* 8 */
-EXTERN pascal OSErr	FSpGetDirectoryID _ANSI_ARGS_((CONST FSSpec * spec, 
+EXTERN pascal OSErr	FSpGetDirectoryIDTcl _ANSI_ARGS_((CONST FSSpec * spec, 
 				long * theDirID, Boolean * isDirectory));
 /* 9 */
-EXTERN pascal short	FSpOpenResFileCompat _ANSI_ARGS_((
+EXTERN pascal short	FSpOpenResFileCompatTcl _ANSI_ARGS_((
 				CONST FSSpec * spec, SignedByte permission));
 /* 10 */
-EXTERN pascal void	FSpCreateResFileCompat _ANSI_ARGS_((
+EXTERN pascal void	FSpCreateResFileCompatTcl _ANSI_ARGS_((
 				CONST FSSpec * spec, OSType creator, 
 				OSType fileType, ScriptCode scriptTag));
 /* 11 */
@@ -193,7 +193,8 @@
 /* 23 */
 EXTERN FILE *		TclMacFOpenHack _ANSI_ARGS_((CONST char * path, 
 				CONST char * mode));
-/* Slot 24 is reserved */
+/* 24 */
+EXTERN char *		TclpGetTZName _ANSI_ARGS_((int isdst));
 /* 25 */
 EXTERN int		TclMacChmod _ANSI_ARGS_((char * path, int mode));
 #endif /* MAC_TCL */
@@ -252,10 +253,10 @@
     int (*fSpGetDefaultDir) _ANSI_ARGS_((FSSpecPtr theSpec)); /* 4 */
     int (*fSpSetDefaultDir) _ANSI_ARGS_((FSSpecPtr theSpec)); /* 5 */
     OSErr (*fSpFindFolder) _ANSI_ARGS_((short vRefNum, OSType folderType, Boolean createFolder, FSSpec * spec)); /* 6 */
-    void (*getGlobalMouse) _ANSI_ARGS_((Point * mouse)); /* 7 */
-    pascal OSErr (*fSpGetDirectoryID) _ANSI_ARGS_((CONST FSSpec * spec, long * theDirID, Boolean * isDirectory)); /* 8 */
-    pascal short (*fSpOpenResFileCompat) _ANSI_ARGS_((CONST FSSpec * spec, SignedByte permission)); /* 9 */
-    pascal void (*fSpCreateResFileCompat) _ANSI_ARGS_((CONST FSSpec * spec, OSType creator, OSType fileType, ScriptCode scriptTag)); /* 10 */
+    void (*getGlobalMouseTcl) _ANSI_ARGS_((Point * mouse)); /* 7 */
+    pascal OSErr (*fSpGetDirectoryIDTcl) _ANSI_ARGS_((CONST FSSpec * spec, long * theDirID, Boolean * isDirectory)); /* 8 */
+    pascal short (*fSpOpenResFileCompatTcl) _ANSI_ARGS_((CONST FSSpec * spec, SignedByte permission)); /* 9 */
+    pascal void (*fSpCreateResFileCompatTcl) _ANSI_ARGS_((CONST FSSpec * spec, OSType creator, OSType fileType, ScriptCode scriptTag)); /* 10 */
     int (*fSpLocationFromPath) _ANSI_ARGS_((int length, CONST char * path, FSSpecPtr theSpec)); /* 11 */
     OSErr (*fSpPathFromLocation) _ANSI_ARGS_((FSSpecPtr theSpec, int * length, Handle * fullPath)); /* 12 */
     void (*tclMacExitHandler) _ANSI_ARGS_((void)); /* 13 */
@@ -455,21 +456,21 @@
 #define FSpFindFolder \
 	(tclIntPlatStubsPtr->fSpFindFolder) /* 6 */
 #endif
-#ifndef GetGlobalMouse
-#define GetGlobalMouse \
-	(tclIntPlatStubsPtr->getGlobalMouse) /* 7 */
-#endif
-#ifndef FSpGetDirectoryID
-#define FSpGetDirectoryID \
-	(tclIntPlatStubsPtr->fSpGetDirectoryID) /* 8 */
-#endif
-#ifndef FSpOpenResFileCompat
-#define FSpOpenResFileCompat \
-	(tclIntPlatStubsPtr->fSpOpenResFileCompat) /* 9 */
-#endif
-#ifndef FSpCreateResFileCompat
-#define FSpCreateResFileCompat \
-	(tclIntPlatStubsPtr->fSpCreateResFileCompat) /* 10 */
+#ifndef GetGlobalMouseTcl
+#define GetGlobalMouseTcl \
+	(tclIntPlatStubsPtr->getGlobalMouseTcl) /* 7 */
+#endif
+#ifndef FSpGetDirectoryIDTcl
+#define FSpGetDirectoryIDTcl \
+	(tclIntPlatStubsPtr->fSpGetDirectoryIDTcl) /* 8 */
+#endif
+#ifndef FSpOpenResFileCompatTcl
+#define FSpOpenResFileCompatTcl \
+	(tclIntPlatStubsPtr->fSpOpenResFileCompatTcl) /* 9 */
+#endif
+#ifndef FSpCreateResFileCompatTcl
+#define FSpCreateResFileCompatTcl \
+	(tclIntPlatStubsPtr->fSpCreateResFileCompatTcl) /* 10 */
 #endif
 #ifndef FSpLocationFromPath
 #define FSpLocationFromPath \
@@ -523,7 +524,10 @@
 #define TclMacFOpenHack \
 	(tclIntPlatStubsPtr->tclMacFOpenHack) /* 23 */
 #endif
-/* Slot 24 is reserved */
+#ifndef TclpGetTZName
+#define TclpGetTZName \
+	(tclIntPlatStubsPtr->tclpGetTZName) /* 24 */
+#endif
 #ifndef TclMacChmod
 #define TclMacChmod \
 	(tclIntPlatStubsPtr->tclMacChmod) /* 25 */
Index: generic/tclMain.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclMain.c,v
retrieving revision 1.13
diff -u -3 -r1.13 tclMain.c
--- generic/tclMain.c	2001/09/24 21:10:32	1.13
+++ generic/tclMain.c	2001/11/23 01:01:06
@@ -38,7 +38,11 @@
  * on some systems, so it's better just to leave it out.
  */
 
+#if !defined(MAC_TCL)
 extern int		isatty _ANSI_ARGS_((int fd));
+#else
+#include <unistd.h>
+#endif
 extern char *		strcpy _ANSI_ARGS_((char *dst, CONST char *src));
 
 static char *tclStartupScriptFileName = NULL;
Index: generic/tclObj.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclObj.c,v
retrieving revision 1.25
diff -u -3 -r1.25 tclObj.c
--- generic/tclObj.c	2001/11/16 20:14:27	1.25
+++ generic/tclObj.c	2001/11/23 01:01:08
@@ -15,6 +15,7 @@
  */
 
 #include "tclInt.h"
+#include "tclCompile.h"
 #include "tclPort.h"
 
 /*
Index: generic/tclStubInit.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclStubInit.c,v
retrieving revision 1.64
diff -u -3 -r1.64 tclStubInit.c
--- generic/tclStubInit.c	2001/11/21 02:36:20	1.64
+++ generic/tclStubInit.c	2001/11/23 01:01:09
@@ -301,10 +301,10 @@
     FSpGetDefaultDir, /* 4 */
     FSpSetDefaultDir, /* 5 */
     FSpFindFolder, /* 6 */
-    GetGlobalMouse, /* 7 */
-    FSpGetDirectoryID, /* 8 */
-    FSpOpenResFileCompat, /* 9 */
-    FSpCreateResFileCompat, /* 10 */
+    GetGlobalMouseTcl, /* 7 */
+    FSpGetDirectoryIDTcl, /* 8 */
+    FSpOpenResFileCompatTcl, /* 9 */
+    FSpCreateResFileCompatTcl, /* 10 */
     FSpLocationFromPath, /* 11 */
     FSpPathFromLocation, /* 12 */
     TclMacExitHandler, /* 13 */
@@ -318,7 +318,7 @@
     TclMacUnRegisterResourceFork, /* 21 */
     TclMacCreateEnv, /* 22 */
     TclMacFOpenHack, /* 23 */
-    NULL, /* 24 */
+    TclpGetTZName, /* 24 */
     TclMacChmod, /* 25 */
 #endif /* MAC_TCL */
 };
Index: generic/tclTest.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclTest.c,v
retrieving revision 1.33
diff -u -3 -r1.33 tclTest.c
--- generic/tclTest.c	2001/11/21 02:36:20	1.33
+++ generic/tclTest.c	2001/11/23 01:01:13
@@ -315,6 +315,8 @@
 
 static void TestReport _ANSI_ARGS_((CONST char* cmd, Tcl_Obj* arg1, Tcl_Obj* arg2));
 
+static Tcl_Obj *TestReportGetNativePath(Tcl_Obj* pathObjPtr);
+
 static Tcl_FSStatProc TestReportStat;
 static Tcl_FSAccessProc TestReportAccess;
 static Tcl_FSOpenFileChannelProc TestReportOpenFileChannel;
@@ -5287,12 +5289,12 @@
  * Simple helper function to extract the native vfs representation of a
  * path object, or NULL if no such representation exists.
  */
-Tcl_Obj* 
+static Tcl_Obj* 
 TestReportGetNativePath(Tcl_Obj* pathObjPtr) {
     return (Tcl_Obj*) Tcl_FSGetInternalRep(pathObjPtr, &testReportingFilesystem);
 }
 
-void 
+static void 
 TestReportFreeInternalRep(ClientData clientData) {
     Tcl_Obj *nativeRep = (Tcl_Obj*)clientData;
     if (nativeRep != NULL) {
@@ -5301,7 +5303,7 @@
     }
 }
 
-ClientData 
+static ClientData 
 TestReportDupInternalRep(ClientData clientData) {
     Tcl_Obj *original = (Tcl_Obj*)clientData;
     Tcl_IncrRefCount(original);
Index: generic/tclThreadTest.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclThreadTest.c,v
retrieving revision 1.11
diff -u -3 -r1.11 tclThreadTest.c
--- generic/tclThreadTest.c	2001/03/31 07:55:50	1.11
+++ generic/tclThreadTest.c	2001/11/23 01:01:14
@@ -126,7 +126,7 @@
 #undef TCL_STORAGE_CLASS
 #define TCL_STORAGE_CLASS DLLIMPORT
 
-Tcl_ThreadCreateType	NewThread _ANSI_ARGS_((ClientData clientData));
+Tcl_ThreadCreateType	NewTestThread _ANSI_ARGS_((ClientData clientData));
 static void	ListRemove _ANSI_ARGS_((ThreadSpecificData *tsdPtr));
 static void	ListUpdateInner _ANSI_ARGS_((ThreadSpecificData *tsdPtr));
 static int	ThreadEventProc _ANSI_ARGS_((Tcl_Event *evPtr, int mask));
@@ -418,7 +418,7 @@
     joinable = joinable ? TCL_THREAD_JOINABLE : TCL_THREAD_NOFLAGS;
 
     Tcl_MutexLock(&threadMutex);
-    if (Tcl_CreateThread(&id, NewThread, (ClientData) &ctrl,
+    if (Tcl_CreateThread(&id, NewTestThread, (ClientData) &ctrl,
 		 TCL_THREAD_STACK_DEFAULT, joinable) != TCL_OK) {
 	Tcl_MutexUnlock(&threadMutex);
         Tcl_AppendResult(interp,"can't create a new thread",0);
@@ -440,7 +440,7 @@
 /*
  *------------------------------------------------------------------------
  *
- * NewThread --
+ * NewTestThread --
  *
  *    This routine is the "main()" for a new thread whose task is to
  *    execute a single TCL script.  The argument to this function is
@@ -466,7 +466,7 @@
  *------------------------------------------------------------------------
  */
 Tcl_ThreadCreateType
-NewThread(clientData)
+NewTestThread(clientData)
     ClientData clientData;
 {
     ThreadCtrl *ctrlPtr = (ThreadCtrl*)clientData;
Index: mac/MW_TclAppleScriptHeader.pch
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/MW_TclAppleScriptHeader.pch,v
retrieving revision 1.4
diff -u -3 -r1.4 MW_TclAppleScriptHeader.pch
--- mac/MW_TclAppleScriptHeader.pch	1999/05/11 07:11:46	1.4
+++ mac/MW_TclAppleScriptHeader.pch	2001/11/23 01:01:15
@@ -33,15 +33,4 @@
 
 #include "tclMacCommonPch.h"
 
-/* #define TCL_REGISTER_LIBRARY 1 */
 #define USE_TCL_STUBS
-
-/*
- * Place any includes below that will are needed by the majority of the
- * and is OK to be in any file in the system.  The pragma's are used
- * to control what functions are exported in the Tcl shared library.
- */
-
-#pragma export on
-#pragma export off
-
Index: mac/MW_TclBuildLibHeader.h
===================================================================
RCS file: MW_TclBuildLibHeader.h
diff -N MW_TclBuildLibHeader.h
--- /dev/null	Thu May 24 22:33:05 2001
+++ MW_TclBuildLibHeader.h	Thu Nov 22 17:01:15 2001
@@ -0,0 +1,7 @@
+#if __POWERPC__
+#include "MW_TclBuildLibHeaderPPC"
+#elif __CFM68K__
+#include "MW_TclBuildLibHeaderCFM68K"
+#else
+#include "MW_TclBuildLibHeader68K"
+#endif
Index: mac/MW_TclBuildLibHeader.pch
===================================================================
RCS file: MW_TclBuildLibHeader.pch
diff -N MW_TclBuildLibHeader.pch
--- /dev/null	Thu May 24 22:33:05 2001
+++ MW_TclBuildLibHeader.pch	Thu Nov 22 17:01:15 2001
@@ -0,0 +1,35 @@
+/*
+ * MW_TclBuildLibHeader.pch --
+ *
+ *  This file is the source for a pre-compilied header that gets used
+ *  for all files in the Tcl projects.  This make compilies go a bit
+ *  faster.  This file is only intended to be used in the MetroWerks
+ *  CodeWarrior environment.  It essentially acts as a place to set 
+ *  compiler flags.  See MetroWerks documention for more details.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id: MW_TclBuildLibHeader.pch,v 1.1.2.1 2001/04/04 21:09:25 hobbs Exp $
+ */
+
+/*
+ * To use the compilied header you need to set the "Prefix file" in
+ * the "C/C++ Language" preference panel to point to the created
+ * compilied header.  The name of the header depends on the
+ * architecture we are compiling for (see the code below).  For
+ * example, for a 68k app the prefix file should be: MW_TclHeader68K.
+ */
+#if __POWERPC__
+#pragma precompile_target "MW_TclBuildLibHeaderPPC"
+#elif __CFM68K__
+#pragma precompile_target "MW_TclBuildLibHeaderCFM68K"
+#else
+#pragma precompile_target "MW_TclBuildLibHeader68K"
+#endif
+
+#define BUILD_tcl 1
+
+#include "MW_TclHeaderCommon.h"
Index: mac/MW_TclHeader.pch
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/MW_TclHeader.pch,v
retrieving revision 1.7
diff -u -3 -r1.7 MW_TclHeader.pch
--- mac/MW_TclHeader.pch	1999/05/11 07:11:48	1.7
+++ mac/MW_TclHeader.pch	2001/11/23 01:01:15
@@ -30,20 +30,4 @@
 #pragma precompile_target "MW_TclHeader68K"
 #endif
 
-#include "tclMacCommonPch.h"
-
-/*
- * Place any includes below that will are needed by the majority of the
- * and is OK to be in any file in the system.  The pragma's are used
- * to control what functions are exported in the Tcl shared library.
- */
-
-#pragma export on
-#include "tcl.h"
-#include "tclMac.h"
-#include "tclInt.h"
-#include "MoreFiles.h"
-#include "MoreFilesExtras.h"
-
-#pragma export reset
-
+#include "MW_TclHeaderCommon.h"
Index: mac/MW_TclHeaderCommon.h
===================================================================
RCS file: MW_TclHeaderCommon.h
diff -N MW_TclHeaderCommon.h
--- /dev/null	Thu May 24 22:33:05 2001
+++ MW_TclHeaderCommon.h	Thu Nov 22 17:01:16 2001
@@ -0,0 +1,54 @@
+/*
+ * MW_TclHeaderCommon.h --
+ *
+ * 	Common includes for precompiled headers
+ *
+ * Copyright (c) 1998 by Scriptics Corporation.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id: MW_TclHeaderCommon.h,v 1.1.2.1 2001/04/04 21:09:25 hobbs Exp $
+ */
+
+#pragma once
+
+#include "tclMacCommonPch.h"
+
+/*
+ * Place any includes below that will are needed by the majority of the
+ * and is OK to be in any file in the system.
+ */
+
+#include "tcl.h"
+
+#ifdef BUILD_tcl
+# undef TCL_STORAGE_CLASS
+# define TCL_STORAGE_CLASS DLLEXPORT
+#endif
+#include "tclMac.h"
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLIMPORT
+
+#include "tclInt.h"
+
+
+#if PRAGMA_IMPORT
+#pragma import on
+#endif
+
+#include <MoreFiles.h>
+#include <MoreFilesExtras.h>
+#include <FSpCompat.h>
+#include <FileCopy.h>
+#include <FullPath.h>
+#include <IterateDirectory.h>
+#include <MoreDesktopMgr.h>
+#include <DirectoryCopy.h>
+#include <Search.h>
+
+#ifdef PRAGMA_IMPORT_OFF
+#pragma import off
+#elif PRAGMA_IMPORT
+#pragma import reset
+#endif
Index: mac/MW_TclStaticHeader.h
===================================================================
RCS file: MW_TclStaticHeader.h
diff -N MW_TclStaticHeader.h
--- /dev/null	Thu May 24 22:33:05 2001
+++ MW_TclStaticHeader.h	Thu Nov 22 17:01:16 2001
@@ -0,0 +1,7 @@
+#if __POWERPC__
+#include "MW_TclStaticHeaderPPC"
+#elif __CFM68K__
+#include "MW_TclStaticHeaderCFM68K"
+#else
+#include "MW_TclStaticHeader68K"
+#endif
Index: mac/MW_TclStaticHeader.pch
===================================================================
RCS file: MW_TclStaticHeader.pch
diff -N MW_TclStaticHeader.pch
--- /dev/null	Thu May 24 22:33:05 2001
+++ MW_TclStaticHeader.pch	Thu Nov 22 17:01:16 2001
@@ -0,0 +1,35 @@
+/*
+ * MW_TclStaticHeader.pch --
+ *
+ *  This file is the source for a pre-compilied header that gets used
+ *  for all files in the Tcl projects.  This make compilies go a bit
+ *  faster.  This file is only intended to be used in the MetroWerks
+ *  CodeWarrior environment.  It essentially acts as a place to set 
+ *  compiler flags.  See MetroWerks documention for more details.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id: MW_TclStaticHeader.pch,v 1.1.2.1 2001/04/04 21:09:25 hobbs Exp $
+ */
+
+/*
+ * To use the compilied header you need to set the "Prefix file" in
+ * the "C/C++ Language" preference panel to point to the created
+ * compilied header.  The name of the header depends on the
+ * architecture we are compiling for (see the code below).  For
+ * example, for a 68k app the prefix file should be: MW_TclHeader68K.
+ */
+#if __POWERPC__
+#pragma precompile_target "MW_TclStaticHeaderPPC"
+#elif __CFM68K__
+#pragma precompile_target "MW_TclStaticHeaderCFM68K"
+#else
+#pragma precompile_target "MW_TclStaticHeader68K"
+#endif
+
+#define STATIC_BUILD 1
+
+#include "MW_TclHeaderCommon.h"
Index: mac/MW_TclTestHeader.pch
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/MW_TclTestHeader.pch,v
retrieving revision 1.1
diff -u -3 -r1.1 MW_TclTestHeader.pch
--- mac/MW_TclTestHeader.pch	2000/02/10 08:39:11	1.1
+++ mac/MW_TclTestHeader.pch	2001/11/23 01:01:16
@@ -1,5 +1,5 @@
 /*
- * MW_TclHeader.pch --
+ * MW_TclTestHeader.pch --
  *
  *  This file is the source for a pre-compilied header that gets used
  *  for all files in the Tcl projects.  This make compilies go a bit
@@ -30,24 +30,12 @@
 #pragma precompile_target "MW_TclTestHeader68K"
 #endif
 
-#define TCL_DEBUG 1
-
-/*#define TCL_THREADS 1*/
-
-#include "tclMacCommonPch.h"
+#define BUILD_tcl 1
 
-/*
- * Place any includes below that will are needed by the majority of the
- * and is OK to be in any file in the system.  The pragma's are used
- * to control what functions are exported in the Tcl shared library.
- */
+#define STATIC_BUILD 1
 
-#pragma export on
-#include "tcl.h"
-#include "tclMac.h"
-#include "tclInt.h"
-#include "MoreFiles.h"
-#include "MoreFilesExtras.h"
+#define TCL_DEBUG 1
 
-#pragma export reset
+#define TCL_THREADS 1
 
+#include "MW_TclHeaderCommon.h"
Index: mac/tclMac.h
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMac.h,v
retrieving revision 1.4
diff -u -3 -r1.4 tclMac.h
--- mac/tclMac.h	1999/03/10 05:52:51	1.4
+++ mac/tclMac.h	2001/11/23 01:01:16
@@ -21,18 +21,8 @@
 #include <Files.h>
 #include <Events.h>
 
-/*
- * "export" is a MetroWerks specific pragma.  It flags the linker that  
- * any symbols that are defined when this pragma is on will be exported 
- * to shared libraries that link with this library.
- */
- 
-#pragma export on
-
 typedef int (*Tcl_MacConvertEventPtr) _ANSI_ARGS_((EventRecord *eventPtr));
 
 #include "tclPlatDecls.h"
-
-#pragma export reset
 
 #endif /* _TCLMAC */
Index: mac/tclMacAlloc.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacAlloc.c,v
retrieving revision 1.4
diff -u -3 -r1.4 tclMacAlloc.c
--- mac/tclMacAlloc.c	1999/05/11 07:11:51	1.4
+++ mac/tclMacAlloc.c	2001/11/23 01:01:16
@@ -20,6 +20,7 @@
 #include "tclInt.h"
 #include "tclMacInt.h"
 #include <Memory.h>
+#include <Gestalt.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -30,12 +31,13 @@
  */
 #define MEMORY_ALL_SYS 1	/* All memory should come from the system
 heap. */
+#define MEMORY_DONT_USE_TEMPMEM 2	/* Don't use temporary memory but system memory. */
 
 /*
  * Amount of space to leave in the application heap for the Toolbox to work.
  */
 
-#define TOOLBOX_SPACE (32 * 1024)
+#define TOOLBOX_SPACE (512 * 1024)
 
 static int memoryFlags = 0;
 static Handle toolGuardHandle = NULL;
@@ -49,6 +51,15 @@
 				 * the way out. If we can't, we go to the
 				 * system heap directly. */
 
+static int tclUseMemTracking = 0; /* Are we tracking memory allocations?
+								   * On recent versions of the MacOS this
+								   * is no longer necessary, as we can use
+								   * temporary memory which is freed by the
+								   * OS after a quit or crash. */
+								   
+static size_t tclExtraHdlSize = 0; /* Size of extra memory allocated at the start
+									* of each block when using memory tracking
+									* ( == 0 otherwise) */
 
 /*
  * The following typedef and variable are used to keep track of memory
@@ -59,10 +70,11 @@
 typedef struct listEl {
     Handle		memoryHandle;
     struct listEl *	next;
+    struct listEl *	prec;
 } ListEl;
 
-ListEl * systemMemory = NULL;
-ListEl * appMemory = NULL;
+static ListEl * systemMemory = NULL;
+static ListEl * appMemory = NULL;
 
 /*
  * Prototypes for functions used only in this file.
@@ -99,13 +111,28 @@
     Handle hand;
     void *newPtr;
     int maxsize;
+    OSErr err;
 
-    hand = * (Handle *) ((Ptr) oldPtr - sizeof(Handle));
+	if (tclUseMemTracking) {
+    hand = ((ListEl *) ((Ptr) oldPtr - tclExtraHdlSize))->memoryHandle;
+    } else {
+    hand = RecoverHandle((Ptr) oldPtr);
+	}
     maxsize = GetHandleSize(hand) - sizeof(Handle);
     if (maxsize < size) {
+    HUnlock(hand);
+    SetHandleSize(hand,size + tclExtraHdlSize);
+    err = MemError();
+    HLock(hand);
+    if(err==noErr){
+    	newPtr=(*hand + tclExtraHdlSize);
+    } else {
 	newPtr = TclpSysAlloc(size, 1);
-	memcpy(newPtr, oldPtr, maxsize);
+	if(newPtr!=NULL) {
+	memmove(newPtr, oldPtr, maxsize);
 	TclpSysFree(oldPtr);
+	}
+	}
     } else {
 	newPtr = oldPtr;
     }
@@ -136,6 +163,31 @@
 {
     Handle hand = NULL;
     ListEl * newMemoryRecord;
+	int isSysMem = 0;
+	static int initialized=0;
+	
+	if (!initialized) {
+	long response = 0;
+	OSErr err = noErr;
+	int useTempMem = 0;
+	
+	/* Check if we can use temporary memory */
+	initialized=1;
+	err = Gestalt(gestaltOSAttr, &response);
+	if (err == noErr) {
+    	useTempMem = response & (1 << gestaltRealTempMemory);
+	}
+	tclUseMemTracking = !useTempMem || (memoryFlags & MEMORY_DONT_USE_TEMPMEM);
+	if(tclUseMemTracking) {
+	    tclExtraHdlSize = sizeof(ListEl);
+	    /*
+	     * We are allocating memory directly from the system
+	     * heap. We need to install an exit handle 
+	     * to ensure the memory is cleaned up.
+	     */
+	    TclMacInstallExitToShellPatch(CleanUpExitProc);
+	}
+	}
 
     if (!(memoryFlags & MEMORY_ALL_SYS)) {
 
@@ -157,6 +209,7 @@
     	if (toolGuardHandle == NULL) {
     	    toolGuardHandle = NewHandle(TOOLBOX_SPACE);
     	    if (toolGuardHandle != NULL) {
+    	    	HLock(toolGuardHandle);
     	    	HPurge(toolGuardHandle);
     	    }
     	}
@@ -167,55 +220,55 @@
 
     	if (toolGuardHandle != NULL) {
     	    HLock(toolGuardHandle);
-	    hand = NewHandle(size + sizeof(Handle));
+	    hand = NewHandle(size + tclExtraHdlSize);
 	    HUnlock(toolGuardHandle);
 	}
     }
-    if (hand != NULL) {
-	newMemoryRecord = (ListEl *) NewPtr(sizeof(ListEl));
-	if (newMemoryRecord == NULL) {
-	    DisposeHandle(hand);
-	    return NULL;
-	}
-	newMemoryRecord->memoryHandle = hand;
-	newMemoryRecord->next = appMemory;
-	appMemory = newMemoryRecord;
-    } else {
+    if (hand == NULL) {
 	/*
 	 * Ran out of memory in application space.  Lets try to get
 	 * more memory from system.  Otherwise, we return NULL to
 	 * denote failure.
 	 */
+	if(!tclUseMemTracking) {
+		/* Use Temporary Memory instead of System Heap when available */
+		OSErr err;
+		isBin = 1; /* always HLockHi TempMemHandles */
+		hand = TempNewHandle(size + tclExtraHdlSize,&err);
+		if(err!=noErr) { hand=NULL; }
+	} else {
+	/* Use system heap when tracking memory */
+	isSysMem=1;
 	isBin = 0;
-	hand = NewHandleSys(size + sizeof(Handle));
-	if (hand == NULL) {
-	    return NULL;
+	hand = NewHandleSys(size + tclExtraHdlSize);
 	}
-	if (systemMemory == NULL) {
-	    /*
-	     * This is the first time we've attempted to allocate memory
-	     * directly from the system heap.  We need to now install the
-	     * exit handle to ensure the memory is cleaned up.
-	     */
-	    TclMacInstallExitToShellPatch(CleanUpExitProc);
 	}
-	newMemoryRecord = (ListEl *) NewPtrSys(sizeof(ListEl));
-	if (newMemoryRecord == NULL) {
-	    DisposeHandle(hand);
+	if (hand == NULL) {
 	    return NULL;
 	}
-	newMemoryRecord->memoryHandle = hand;
-	newMemoryRecord->next = systemMemory;
-	systemMemory = newMemoryRecord;
-    }
     if (isBin) {
 	HLockHi(hand);
     } else {
 	HLock(hand);
     }
-    (** (Handle **) hand) = hand;
-
-    return (*hand + sizeof(Handle));
+	if(tclUseMemTracking) {
+	/* Only need to do this when tracking memory */
+	newMemoryRecord = (ListEl *) *hand;
+	newMemoryRecord->memoryHandle = hand;
+	newMemoryRecord->prec = NULL;
+	if(isSysMem) {
+	newMemoryRecord->next = systemMemory;
+	systemMemory = newMemoryRecord;
+	} else {
+	newMemoryRecord->next = appMemory;
+	appMemory = newMemoryRecord;
+	}
+	if(newMemoryRecord->next!=NULL) {
+	newMemoryRecord->next->prec=newMemoryRecord;
+	}
+	}
+	
+    return (*hand + tclExtraHdlSize);
 }
 
 /*
@@ -238,13 +291,27 @@
 TclpSysFree(
     void * ptr)		/* Free this system memory. */
 {
-    Handle hand;
-    OSErr err;
-
-    hand = * (Handle *) ((Ptr) ptr - sizeof(Handle));
-    DisposeHandle(hand);
-    *hand = NULL;
-    err = MemError();
+	if(tclUseMemTracking) {
+    /* Only need to do this when tracking memory */
+    ListEl *memRecord;
+
+    memRecord = (ListEl *) ((Ptr) ptr - tclExtraHdlSize);
+    /* Remove current record from linked list */
+    if(memRecord->next!=NULL) {
+    	memRecord->next->prec=memRecord->prec;
+    }
+    if(memRecord->prec!=NULL) {
+    	memRecord->prec->next=memRecord->next;
+    }
+    if(memRecord==appMemory) {
+    	appMemory=memRecord->next;
+    } else if(memRecord==systemMemory) {
+    	systemMemory=memRecord->next;
+    }
+    DisposeHandle(memRecord->memoryHandle);
+	} else {
+    DisposeHandle(RecoverHandle((Ptr) ptr));
+	}
 }
 
 /*
@@ -271,13 +338,13 @@
 {
     ListEl * memRecord;
 
+    if(tclUseMemTracking) {
+    /* Only need to do this when tracking memory */
     while (systemMemory != NULL) {
 	memRecord = systemMemory;
 	systemMemory = memRecord->next;
-        if (*(memRecord->memoryHandle) != NULL) {
-            DisposeHandle(memRecord->memoryHandle);
-        }
-	DisposePtr((void *) memRecord);
+	DisposeHandle(memRecord->memoryHandle);
+    }
     }
 }
 
@@ -304,21 +371,18 @@
 {
     ListEl * memRecord;
 
+	if(tclUseMemTracking) {
+	/* Only need to do this when tracking memory */
     while (systemMemory != NULL) {
 	memRecord = systemMemory;
 	systemMemory = memRecord->next;
-	if (*(memRecord->memoryHandle) != NULL) {
-            DisposeHandle(memRecord->memoryHandle);
-        }
-	DisposePtr((void *) memRecord);
+	DisposeHandle(memRecord->memoryHandle);
     }
     while (appMemory != NULL) {
 	memRecord = appMemory;
 	appMemory = memRecord->next;
-	if (*(memRecord->memoryHandle) != NULL) {
-            DisposeHandle(memRecord->memoryHandle);
-        }
-	DisposePtr((void *) memRecord);
+	DisposeHandle(memRecord->memoryHandle);
+	}
     }
 }
 
Index: mac/tclMacAppInit.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacAppInit.c,v
retrieving revision 1.8
diff -u -3 -r1.8 tclMacAppInit.c
--- mac/tclMacAppInit.c	2001/06/17 03:48:19	1.8
+++ mac/tclMacAppInit.c	2001/11/23 01:01:16
@@ -22,7 +22,7 @@
 #   include <console.h>
 #elif defined(__MWERKS__)
 #   include <SIOUX.h>
-short InstallConsole _ANSI_ARGS_((short fd));
+EXTERN short InstallConsole _ANSI_ARGS_((short fd));
 #endif
 
 #ifdef TCL_TEST
@@ -189,6 +189,7 @@
     SIOUXSettings.autocloseonquit = true;
     SIOUXSettings.showstatusline = true;
     SIOUXSettings.asktosaveonclose = false;
+    SIOUXSettings.wasteusetempmemory = true;    
     InstallConsole(0);
     SIOUXSetTitle("\pTcl Interpreter");
 		
Index: mac/tclMacApplication.r
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacApplication.r,v
retrieving revision 1.3
diff -u -3 -r1.3 tclMacApplication.r
--- mac/tclMacApplication.r	1999/08/16 00:09:09	1.3
+++ mac/tclMacApplication.r	2001/11/23 01:01:16
@@ -42,21 +42,21 @@
 	TCL_MAJOR_VERSION, MINOR_VERSION,
 	RELEASE_LEVEL, 0x00, verUS,
 	TCL_PATCH_LEVEL,
-	TCL_PATCH_LEVEL ", by Ray Johnson & Jim Ingham © Scriptics Inc"
+	TCL_PATCH_LEVEL ", by Ray Johnson & Jim Ingham" "\n" "© 2001 Tcl Core Team"
 };
 
 resource 'vers' (2) {
 	TCL_MAJOR_VERSION, MINOR_VERSION,
 	RELEASE_LEVEL, 0x00, verUS,
 	TCL_PATCH_LEVEL,
-	"Tcl Shell " TCL_PATCH_LEVEL " © 1996-1997 Sun Microsystems, 1998-1999 Scriptics Inc"
+	"Tcl Shell " TCL_PATCH_LEVEL " © 1993-2001"
 };
 
 #define TCL_APP_CREATOR 'Tcl '
 
 type TCL_APP_CREATOR as 'STR ';
 resource TCL_APP_CREATOR (0, purgeable) {
-	"Tcl Shell " TCL_PATCH_LEVEL " © 1996-1999"
+	"Tcl Shell " TCL_PATCH_LEVEL " © 1993-2001"
 };
 
 /*
@@ -73,3 +73,41 @@
 		'APPL', "Tcl Shell",
 	}
 };
+
+/*
+ * The following resource is used when creating the 'env' variable in
+ * the Macintosh environment.  The creation mechanisim looks for the
+ * 'STR#' resource named "Tcl Environment Variables" rather than a
+ * specific resource number.  (In other words, feel free to change the
+ * resource id if it conflicts with your application.)  Each string in
+ * the resource must be of the form "KEYWORD=SOME STRING".  See Tcl
+ * documentation for futher information about the env variable.
+ *
+ * A good example of something you may want to set is: "TCL_LIBRARY=My
+ * disk:etc."
+ */
+ 
+resource 'STR#' (128, "Tcl Environment Variables") {
+	{	
+		/*		
+		"SCHEDULE_NAME=Agent Controller Schedule",
+		"SCHEDULE_PATH=Lozoya:System Folder:Tcl Lib:Tcl-Scheduler"
+		*/
+	};
+};
+
+data 'alis' (1000, "Library Folder") {
+	$"0000 0000 00BA 0002 0001 012F 0000 0000"            /* ........../.... */
+	$"0000 0000 0000 0000 0000 0000 0000 0000"            /* ................ */
+	$"0000 0000 0000 985C FB00 4244 0000 0000"            /* ......ò\.BD.... */
+	$"0002 1328 5375 7070 6F72 7420 4C69 6272"            /* ...(Support Libr */
+	$"6172 6965 7329 0000 0000 0000 0000 0000"            /* aries).......... */
+	$"0000 0000 0000 0000 0000 0000 0000 0000"            /* ................ */
+	$"0000 0000 0000 0000 0000 0000 0000 0000"            /* ................ */
+	$"0000 0076 8504 B617 A796 003D 0027 025B"            /* ...vÖ..ßñ.=.'.[ */
+	$"01E4 0001 0001 0000 0000 0000 0000 0000"            /* ............... */
+	$"0000 0000 0000 0000 0001 2F00 0002 0015"            /* ........../..... */
+	$"2F3A 2853 7570 706F 7274 204C 6962 7261"            /* /:(Support Libra */
+	$"7269 6573 2900 FFFF 0000"                           /* ries)... */
+};
+
Index: mac/tclMacChan.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacChan.c,v
retrieving revision 1.7
diff -u -3 -r1.7 tclMacChan.c
--- mac/tclMacChan.c	2001/08/30 08:53:15	1.7
+++ mac/tclMacChan.c	2001/11/23 01:01:18
@@ -136,7 +136,7 @@
 
 static Tcl_ChannelType consoleChannelType = {
     "file",			/* Type name. */
-    StdIOBlockMode,		/* Set blocking/nonblocking mode.*/
+    (Tcl_ChannelTypeVersion)StdIOBlockMode,		/* Set blocking/nonblocking mode.*/
     StdIOClose,			/* Close proc. */
     StdIOInput,			/* Input proc. */
     StdIOOutput,		/* Output proc. */
@@ -153,7 +153,7 @@
 
 static Tcl_ChannelType fileChannelType = {
     "file",			/* Type name. */
-    FileBlockMode,		/* Set blocking or
+    (Tcl_ChannelTypeVersion)FileBlockMode,		/* Set blocking or
                                  * non-blocking mode.*/
     FileClose,			/* Close proc. */
     FileInput,			/* Input proc. */
Index: mac/tclMacCommonPch.h
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacCommonPch.h,v
retrieving revision 1.2
diff -u -3 -r1.2 tclMacCommonPch.h
--- mac/tclMacCommonPch.h	1998/11/11 07:46:04	1.2
+++ mac/tclMacCommonPch.h	2001/11/23 01:01:18
@@ -50,17 +50,6 @@
 
 
 /*
-* The following defines control the behavior of the Macintosh
-* Universial Headers.
-*/
-
-
-#define SystemSevenOrLater 1
-#define STRICT_CONTROLS 1
-#define STRICT_WINDOWS 1
-
-
-/*
 * Define the following symbol if you want
 * comprehensive debugging turned on.
 */
@@ -75,14 +64,8 @@
 #endif
 
 
-
 /*
-* For a while, we will continue to use the old routine names, so that
-* people with older versions of CodeWarrior will still be able to compile
-* the source (albeit they will have to update the project files themselves).
-*
-* At some point, we will convert over to the new routine names.
+* for Metrowerks Pro 6 MSL
 */
-
 
-#define OLDROUTINENAMES 1
+#include <UseDLLPrefix.h>
Index: mac/tclMacFCmd.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacFCmd.c,v
retrieving revision 1.10
diff -u -3 -r1.10 tclMacFCmd.c
--- mac/tclMacFCmd.c	2001/08/30 08:53:15	1.10
+++ mac/tclMacFCmd.c	2001/11/23 01:01:19
@@ -32,16 +32,16 @@
  */
 
 static int		GetFileFinderAttributes _ANSI_ARGS_((Tcl_Interp *interp,
-			    int objIndex, CONST char *fileName,
+			    int objIndex, Tcl_Obj *fileName,
 			    Tcl_Obj **attributePtrPtr));
 static int		GetFileReadOnly _ANSI_ARGS_((Tcl_Interp *interp,
-			    int objIndex, CONST char *fileName,
+			    int objIndex, Tcl_Obj *fileName,
 			    Tcl_Obj **readOnlyPtrPtr));
 static int		SetFileFinderAttributes _ANSI_ARGS_((Tcl_Interp *interp,
-			    int objIndex, CONST char *fileName,
+			    int objIndex, Tcl_Obj *fileName,
 			    Tcl_Obj *attributePtr));
 static int		SetFileReadOnly _ANSI_ARGS_((Tcl_Interp *interp,
-			    int objIndex, CONST char *fileName,
+			    int objIndex, Tcl_Obj *fileName,
 			    Tcl_Obj *readOnlyPtr));
 
 /*
@@ -716,7 +716,7 @@
         err = FSpDirCreateCompat(&tmpDirSpec, smSystemScript, &tmpDirID);
     }
     if (err == noErr) {
-	err = FSpDirectoryCopy(&srcFileSpec, &tmpDirSpec, NULL, 0, true,
+	err = FSpDirectoryCopy(&srcFileSpec, &tmpDirSpec, NULL, NULL, 0, true,
 	    	CopyErrHandler);
     }
     
@@ -1157,18 +1157,17 @@
 GetFileFinderAttributes(
     Tcl_Interp *interp,		/* The interp to report errors with. */
     int objIndex,		/* The index of the attribute option. */
-    CONST char *fileName,	/* The name of the file (UTF-8). */
+    Tcl_Obj *fileName,	/* The name of the file (UTF-8). */
     Tcl_Obj **attributePtrPtr)	/* A pointer to return the object with. */
 {
     OSErr err;
     FSSpec fileSpec;
     FInfo finfo;
-    Tcl_DString pathString;
+    char *native;
 
-    Tcl_UtfToExternalDString(NULL, fileName, -1, &pathString);
-    err = FSpLocationFromPath(Tcl_DStringLength(&pathString),
-	    Tcl_DStringValue(&pathString), &fileSpec);
-    Tcl_DStringFree(&pathString);
+    native=Tcl_FSGetNativePath(fileName);
+    err = FSpLocationFromPath(strlen(native),
+	    native, &fileSpec);
 
     if (err == noErr) {
     	err = FSpGetFInfo(&fileSpec, &finfo);
@@ -1204,7 +1203,7 @@
     if (err != noErr) {
     	errno = TclMacOSErrorToPosixError(err);
     	Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), 
-    		"could not read \"", fileName, "\": ",
+    		"could not read \"", Tcl_GetString(fileName), "\": ",
     		Tcl_PosixError(interp), (char *) NULL);
     	return TCL_ERROR;
     }
@@ -1236,18 +1235,17 @@
 GetFileReadOnly(
     Tcl_Interp *interp,		/* The interp to report errors with. */
     int objIndex,		/* The index of the attribute. */
-    CONST char *fileName,	/* The name of the file (UTF-8). */
+    Tcl_Obj *fileName,	/* The name of the file (UTF-8). */
     Tcl_Obj **readOnlyPtrPtr)	/* A pointer to return the object with. */
 {
     OSErr err;
     FSSpec fileSpec;
     CInfoPBRec paramBlock;
-    Tcl_DString pathString;
+    char *native;
 
-    Tcl_UtfToExternalDString(NULL, fileName, -1, &pathString);
-    err = FSpLocationFromPath(Tcl_DStringLength(&pathString),
-	    Tcl_DStringValue(&pathString), &fileSpec);
-    Tcl_DStringFree(&pathString);
+    native=Tcl_FSGetNativePath(fileName);
+    err = FSpLocationFromPath(strlen(native),
+	    native, &fileSpec);
     
     if (err == noErr) {
     	if (err == noErr) {
@@ -1273,7 +1271,7 @@
     if (err != noErr) {
     	errno = TclMacOSErrorToPosixError(err);
     	Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), 
-    		"could not read \"", fileName, "\": ",
+    		"could not read \"", Tcl_GetString(fileName), "\": ",
     		Tcl_PosixError(interp), (char *) NULL);
     	return TCL_ERROR;
     }
@@ -1301,18 +1299,17 @@
 SetFileFinderAttributes(
     Tcl_Interp *interp,		/* The interp to report errors with. */
     int objIndex,		/* The index of the attribute. */
-    CONST char *fileName,	/* The name of the file (UTF-8). */
+    Tcl_Obj *fileName,	/* The name of the file (UTF-8). */
     Tcl_Obj *attributePtr)	/* The command line object. */
 {
     OSErr err;
     FSSpec fileSpec;
     FInfo finfo;
-    Tcl_DString pathString;
+    char *native;
 
-    Tcl_UtfToExternalDString(NULL, fileName, -1, &pathString);
-    err = FSpLocationFromPath(Tcl_DStringLength(&pathString),
-	    Tcl_DStringValue(&pathString), &fileSpec);
-    Tcl_DStringFree(&pathString);
+    native=Tcl_FSGetNativePath(fileName);
+    err = FSpLocationFromPath(strlen(native),
+	    native, &fileSpec);
     
     if (err == noErr) {
     	err = FSpGetFInfo(&fileSpec, &finfo);
@@ -1357,7 +1354,7 @@
     	    Tcl_Obj *resultPtr = Tcl_GetObjResult(interp);
     	    Tcl_AppendStringsToObj(resultPtr, "cannot set ",
     	    	    tclpFileAttrStrings[objIndex], ": \"",
-    	    	    fileName, "\" is a directory", (char *) NULL);
+    	    	    Tcl_GetString(fileName), "\" is a directory", (char *) NULL);
     	    return TCL_ERROR;
     	}
     }
@@ -1365,7 +1362,7 @@
     if (err != noErr) {
     	errno = TclMacOSErrorToPosixError(err);
     	Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), 
-    		"could not read \"", fileName, "\": ",
+    		"could not read \"", Tcl_GetString(fileName), "\": ",
     		Tcl_PosixError(interp), (char *) NULL);
     	return TCL_ERROR;
     }
@@ -1393,19 +1390,18 @@
 SetFileReadOnly(
     Tcl_Interp *interp,		/* The interp to report errors with. */
     int objIndex,		/* The index of the attribute. */
-    CONST char *fileName,	/* The name of the file (UTF-8). */
+    Tcl_Obj *fileName,	/* The name of the file (UTF-8). */
     Tcl_Obj *readOnlyPtr)	/* The command line object. */
 {
     OSErr err;
     FSSpec fileSpec;
     HParamBlockRec paramBlock;
     int hidden;
-    Tcl_DString pathString;
+    char *native;
 
-    Tcl_UtfToExternalDString(NULL, fileName, -1, &pathString);
-    err = FSpLocationFromPath(Tcl_DStringLength(&pathString),
-	    Tcl_DStringValue(&pathString), &fileSpec);
-    Tcl_DStringFree(&pathString);
+    native=Tcl_FSGetNativePath(fileName);
+    err = FSpLocationFromPath(strlen(native),
+	    native, &fileSpec);
     
     if (err == noErr) {
     	if (Tcl_GetBooleanFromObj(interp, readOnlyPtr, &hidden) != TCL_OK) {
@@ -1440,7 +1436,7 @@
     if (err != noErr) {
     	errno = TclMacOSErrorToPosixError(err);
     	Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), 
-    		"could not read \"", fileName, "\": ",
+    		"could not read \"", Tcl_GetString(fileName), "\": ",
     		Tcl_PosixError(interp), (char *) NULL);
     	return TCL_ERROR;
     }
@@ -1625,20 +1621,23 @@
 		Tcl_UtfToExternalDString(NULL,&path[lastCheckpoint],
 					 fileNameLen,&nativeds);
 		fileNameLen=Tcl_DStringLength(&nativeds);
-		if(fileNameLen > MAXMACFILENAMELEN) 
-		    fileNameLen=MAXMACFILENAMELEN;
+		if(fileNameLen > MAXMACFILENAMELEN) { 
+		    err = bdNamErr;
+		} else {
 		fileName[0]=fileNameLen;
 		strncpy((char *) fileName + 1, Tcl_DStringValue(&nativeds), 
 			fileNameLen);
+		}
 		Tcl_DStringFree(&nativeds);
 	    }
+	    if(err == noErr)
 	    err=FSMakeFSSpecCompat(vRefNum, dirID, fileNamePtr, &fileSpec);
 	    if(err != noErr) {
 		if(err != fnfErr) {
 		    /*
-		     * this can if trying to get parent of a root
+		     * this can occur if trying to get parent of a root
 		     * volume via '::' or when using an illegal
-		     * filename revert to last checkpoint and stop
+		     * filename; revert to last checkpoint and stop
 		     * processing path further
 		     */
 		    err=FSMakeFSSpecCompat(vRefNum, dirID, NULL, &fileSpec);
@@ -1687,11 +1686,11 @@
     Tcl_ExternalToUtfDString(NULL,*newPathHandle,newPathLen,&nativeds);
     if (cur != 0) {
 	/* not at end, append remaining path */
-    	if ( newPathLen==0 || *(*newPathHandle+(newPathLen-1))!=':') {
+    	if ( newPathLen==0 || (*(*newPathHandle+(newPathLen-1))!=':' && path[nextCheckpoint] !=':')) {
 	    Tcl_DStringAppend(&nativeds, ":" , 1);
 	}
-	Tcl_DStringAppend(&nativeds, &path[nextCheckpoint+1], 
-			  strlen(&path[nextCheckpoint+1]));
+	Tcl_DStringAppend(&nativeds, &path[nextCheckpoint], 
+			  strlen(&path[nextCheckpoint]));
     }
     DisposeHandle(newPathHandle);
     
Index: mac/tclMacFile.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacFile.c,v
retrieving revision 1.12
diff -u -3 -r1.12 tclMacFile.c
--- mac/tclMacFile.c	2001/08/30 08:53:15	1.12
+++ mac/tclMacFile.c	2001/11/23 01:01:20
@@ -177,7 +177,7 @@
      */
     Tcl_DStringFree(&dsOrig);
     Tcl_DStringAppend(&dsOrig, ":", 1);
-    Tcl_DStringAppend(&dsOrig, fileName2, -1);
+    Tcl_DStringAppend(&dsOrig, Tcl_GetString(fileNamePtr), -1);
     baseLength = Tcl_DStringLength(&dsOrig);
 
     Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&dsOrig),
@@ -234,9 +234,9 @@
 		&fileString);
 	if (Tcl_StringMatch(Tcl_DStringValue(&fileString), pattern)) {
 	    int typeOk = 1;
+	    Tcl_Obj *tempName;
 	    Tcl_DStringSetLength(&dsOrig, baseLength);
 	    Tcl_DStringAppend(&dsOrig, Tcl_DStringValue(&fileString), -1);
-	    Tcl_Obj *tempName;
 	    fname = Tcl_DStringValue(&dsOrig);
 	    fnameLen = Tcl_DStringLength(&dsOrig);
 	    
@@ -282,13 +282,10 @@
 		    }
 		}
 		if (typeOk == 1 && types->type != 0) {
-		    if (types->perm == 0) {
-			/* We haven't yet done a stat on the file */
 			if (TclpObjStat(tempName, &buf) != 0) {
 			    /* Posix error occurred */
 			    typeOk = 0;
 			}
-		    }
 		    if (typeOk) {
 			/*
 			 * In order bcdpfls as in 'find -t'
Index: mac/tclMacInt.h
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacInt.h,v
retrieving revision 1.6
diff -u -3 -r1.6 tclMacInt.h
--- mac/tclMacInt.h	1999/08/16 00:09:18	1.6
+++ mac/tclMacInt.h	2001/11/23 01:01:20
@@ -14,18 +14,16 @@
 #ifndef _TCLMACINT
 #define _TCLMACINT
 
-#ifndef _TCL
-#   include "tcl.h"
+#ifndef _TCLINT
+#include "tclInt.h"
 #endif
-#ifndef _TCLMAC
-#   include "tclMac.h"
+#ifndef _TCLPORT
+#include "tclPort.h"
 #endif
 
 #include <Events.h>
 #include <Files.h>
 
-#pragma export on
-
 /*
  * Defines to control stack behavior.
  *
@@ -46,6 +44,11 @@
 
 #define TCL_MAC_STACK_THRESHOLD 16384
 
+#ifdef BUILD_tcl
+# undef TCL_STORAGE_CLASS
+# define TCL_STORAGE_CLASS DLLEXPORT
+#endif
+
 /*
  * This flag is passed to TclMacRegisterResourceFork
  * by a file (usually a library) whose resource fork
@@ -63,12 +66,12 @@
  */
 
 EXTERN char *	TclMacGetFontEncoding _ANSI_ARGS_((int fontId));
-EXTERN int	TclMacHaveThreads(void);
+EXTERN int		TclMacHaveThreads _ANSI_ARGS_((void));
+EXTERN long		TclpGetGMTOffset _ANSI_ARGS_((void));
 
-#include "tclPort.h"
-#include "tclPlatDecls.h"
+# undef TCL_STORAGE_CLASS
+# define TCL_STORAGE_CLASS DLLIMPORT
+
 #include "tclIntPlatDecls.h"
     
-#pragma export reset
-
 #endif /* _TCLMACINT */
Index: mac/tclMacLibrary.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacLibrary.c,v
retrieving revision 1.4
diff -u -3 -r1.4 tclMacLibrary.c
--- mac/tclMacLibrary.c	2000/02/10 09:59:10	1.4
+++ mac/tclMacLibrary.c	2001/11/23 01:01:20
@@ -26,6 +26,15 @@
 #include <Strings.h>
 #include "tclMacInt.h"
 
+#if defined(TCL_REGISTER_LIBRARY) && defined(USE_TCL_STUBS)
+#error "Can't use TCL_REGISTER_LIBRARY and USE_TCL_STUBS at the same time!"
+/*
+ * Can't register a library with Tcl when using stubs in the current
+ * implementation, since Tcl_InitStubs hasn't been called yet
+ *  when OpenLibraryResource is executing. 
+ */
+#endif
+
 /*
  * These function are not currently defined in any header file.  The
  * only place they should be used is in the Initialization and
Index: mac/tclMacLibrary.r
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacLibrary.r,v
retrieving revision 1.4
diff -u -3 -r1.4 tclMacLibrary.r
--- mac/tclMacLibrary.r	1999/08/16 00:09:22	1.4
+++ mac/tclMacLibrary.r	2001/11/23 01:01:20
@@ -42,14 +42,14 @@
 	TCL_MAJOR_VERSION, MINOR_VERSION,
 	RELEASE_LEVEL, 0x00, verUS,
 	TCL_PATCH_LEVEL,
-	TCL_PATCH_LEVEL ", by Ray Johnson & Jim Ingham © Scriptics Inc."
+	TCL_PATCH_LEVEL ", by Ray Johnson & Jim Ingham" "\n" "© 2001 Tcl Core Team"
 };
 
 resource 'vers' (2) {
 	TCL_MAJOR_VERSION, MINOR_VERSION,
 	RELEASE_LEVEL, 0x00, verUS,
 	TCL_PATCH_LEVEL,
-	"Tcl Library " TCL_PATCH_LEVEL " © 1996-1997 Sun Microsystems, 1998-1999 Scriptics Inc."
+	"Tcl Library " TCL_PATCH_LEVEL " © 1993-2001"
 };
 
 /*
@@ -96,7 +96,7 @@
 
 type TCL_CREATOR as 'STR ';
 resource TCL_CREATOR (0, purgeable) {
-	"Tcl Library " TCL_PATCH_LEVEL " © 1996-1999"
+	"Tcl Library " TCL_PATCH_LEVEL " © 1993-2001"
 };
 
 /*
@@ -125,23 +125,9 @@
 resource 'STR ' (-16397, purgeable) {
 	"Tcl Library\n\n"
 	"This is the core library needed to run Tool Command Language programs. "
-	"To work properly, it should be placed in the ÔTool Command LanguageÕ folder "
+	"To work properly, it should be placed in the Tool Command Language¹ folder "
 	"within the Extensions folder."
 };
-
-/* 
- * The mechanisim below loads Tcl source into the resource fork of the
- * application.  The example below creates a TEXT resource named
- * "Init" from the file "init.tcl".  This allows applications to use
- * Tcl to define the behavior of the application without having to
- * require some predetermined file structure - all needed Tcl "files"
- * are located within the application.  To source a file for the
- * resource fork the source command has been modified to support
- * sourcing from resources.  In the below case "source -rsrc {Init}"
- * will load the TEXT resource named "Init".
- */
-
-#include "tclMacTclCode.r"
 
 /*
  * The following are icons for the shared library.
Index: mac/tclMacLoad.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacLoad.c,v
retrieving revision 1.7
diff -u -3 -r1.7 tclMacLoad.c
--- mac/tclMacLoad.c	2001/09/28 01:21:53	1.7
+++ mac/tclMacLoad.c	2001/11/23 01:01:20
@@ -108,7 +108,7 @@
     Tcl_PackageInitProc **proc2Ptr,
 				/* Where to return the addresses corresponding
 				 * to sym1 and sym2. */
-    ClientData *clientDataPtr;	/* Filled with token for dynamically loaded
+    ClientData *clientDataPtr,	/* Filled with token for dynamically loaded
 				 * file which will be passed back to 
 				 * (*unloadProcPtr)() to unload the file. */
     Tcl_FSUnloadFileProc **unloadProcPtr)
@@ -125,19 +125,11 @@
     Handle fragResource;
     UInt32 offset = 0;
     UInt32 length = kCFragGoesToEOF;
-    char packageName[255];
+    StringPtr fragName=NULL;
     Str255 errName;
+    Tcl_DString ds;
     char *native;
     
-    /*
-     * First thing we must do is infer the package name from the sym1
-     * variable.  This is kind of dumb since the caller actually knows
-     * this value, it just doesn't give it to us.
-     */
-    strcpy(packageName, sym1);
-    Tcl_UtfToLower(packageName);
-    *(Tcl_UtfAtIndex(packageName, Tcl_NumUtfChars(packageName, -1) - 5)) = 0;
-    
     native = Tcl_FSGetNativePath(pathPtr);
     err = FSpLocationFromPath(strlen(native), native, &fileSpec);
     
@@ -147,6 +139,14 @@
     }
     
     /*
+     * First thing we must do is infer the package name from the sym1
+     * variable.  This is kind of dumb since the caller actually knows
+     * this value, it just doesn't give it to us.
+     */
+    native = Tcl_UtfToExternalDString(NULL, sym1, -1, &ds);
+    native[strlen(native) - 5] = 0;
+    
+    /*
      * See if this fragment has a 'cfrg' resource.  It will tell us where
      * to look for the fragment in the file.  If it doesn't exist we will
      * assume we have a ppc frag using the whole data fork.  If it does
@@ -173,10 +173,11 @@
 		 index++, itemStart += srcItem->itemSize) {
 		srcItem = (CfrgItem*)itemStart;
 		if (srcItem->archType != OUR_ARCH_TYPE) continue;
-		if (!strncasecmp(packageName, (char *) srcItem->name + 1,
-			srcItem->name[0])) {
+		if (!strncasecmp(native, (char *) srcItem->name + 1,
+			strlen(native))) {
 		    offset = srcItem->codeOffset;
 		    length = srcItem->codeLength;
+		    fragName=srcItem->name;
 		}
 	    }
 	}
@@ -190,6 +191,7 @@
 	CloseResFile(fragFileRef);
 	UseResFile(saveFileRef);
     }
+    Tcl_DStringFree(&ds);
 
     /*
      * Now we can attempt to load the fragement using the offset & length
@@ -197,9 +199,11 @@
      * as we are going to search for specific entry points passed to us.
      */
     
-    c2pstr(packageName);
-    err = GetDiskFragment(&fileSpec, offset, length, (StringPtr) packageName,
+    err = GetDiskFragment(&fileSpec, offset, length, fragName,
 	    kLoadCFrag, &connID, &dummy, errName);
+
+    *clientDataPtr = (ClientData) connID;
+
     if (err != fragNoErr) {
 	p2cstr(errName);
 	Tcl_AppendResult(interp, "couldn't load file \"", 
@@ -208,9 +212,12 @@
 	return TCL_ERROR;
     }
     
-    c2pstr(sym1);
-    err = FindSymbol(connID, (StringPtr) sym1, (Ptr *) proc1Ptr, &symClass);
-    p2cstr((StringPtr) sym1);
+    *unloadProcPtr = &TclpUnloadFile;
+   
+    native = Tcl_UtfToExternalDString(NULL, sym1, -1, &ds);
+    c2pstr(native);
+    err = FindSymbol(connID, (StringPtr) native, (Ptr *) proc1Ptr, &symClass);
+    Tcl_DStringFree(&ds);
     if (err != fragNoErr || symClass == kDataCFragSymbol) {
 	Tcl_SetResult(interp,
 		"could not find Initialization routine in library",
@@ -218,16 +225,14 @@
 	return TCL_ERROR;
     }
 
-    c2pstr(sym2);
-    err = FindSymbol(connID, (StringPtr) sym2, (Ptr *) proc2Ptr, &symClass);
-    p2cstr((StringPtr) sym2);
+    native = Tcl_UtfToExternalDString(NULL, sym2, -1, &ds);
+    c2pstr(native);
+    err = FindSymbol(connID, (StringPtr) native, (Ptr *) proc2Ptr, &symClass);
+    Tcl_DStringFree(&ds);
     if (err != fragNoErr || symClass == kDataCFragSymbol) {
 	*proc2Ptr = NULL;
     }
     
-    *clientDataPtr = (ClientData) connID;
-    *unloadProcPtr = &TclpUnloadFile;
-    
     return TCL_OK;
 }
 
@@ -256,6 +261,7 @@
 				 * a token that represents the loaded 
 				 * file. */
 {
+    CloseConnection((CFragConnectionID*) &clientData);
 }
 
 /*
Index: mac/tclMacMSLPrefix.h
===================================================================
RCS file: tclMacMSLPrefix.h
diff -N tclMacMSLPrefix.h
--- /tmp/cvsb7Kt2I	Thu Nov 22 17:01:49 2001
+++ /dev/null	Thu May 24 22:33:05 2001
@@ -1,24 +0,0 @@
-/*
- * tclMacMSLPrefix.h --
- *
- *  A wrapper for the MSL ansi_prefix.mac.h file.  This just turns export on
- *  after including the MSL prefix file, so we can export symbols from the MSL
- *  and through the Tcl shared libraries
- *  
- *
- * Copyright (c) 1997 Sun Microsystems, Inc.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id: tclMacMSLPrefix.h,v 1.2 1998/09/14 18:40:05 stanton Exp $
- */
-
-#include <ansi_prefix.mac.h>
-/*
- * "export" is a MetroWerks specific pragma.  It flags the linker that  
- * any symbols that are defined when this pragma is on will be exported 
- * to shared libraries that link with this library.
- */
- 
-#pragma export on
Index: mac/tclMacMath.h
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacMath.h,v
retrieving revision 1.2
diff -u -3 -r1.2 tclMacMath.h
--- mac/tclMacMath.h	1998/09/14 18:40:05	1.2
+++ mac/tclMacMath.h	2001/11/23 01:01:21
@@ -135,7 +135,7 @@
 #endif
 #endif
 
-#if (defined(THINK_C) || defined(__MWERKS__))
+#if (defined(THINK_C))
 #pragma export on
 double		hypotd(double x, double y);
 #define hypot hypotd
Index: mac/tclMacNotify.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacNotify.c,v
retrieving revision 1.7
diff -u -3 -r1.7 tclMacNotify.c
--- mac/tclMacNotify.c	2001/11/21 02:36:21	1.7
+++ mac/tclMacNotify.c	2001/11/23 01:01:21
@@ -266,7 +266,7 @@
      * system event queue unless we call WaitNextEvent.
      */
 
-    GetGlobalMouse(&currentMouse);
+    GetGlobalMouseTcl(&currentMouse);
     if ((notifier.eventProcPtr != NULL) &&
 	    !EqualPt(currentMouse, notifier.lastMousePosition)) {
 	notifier.lastMousePosition = currentMouse;
@@ -296,7 +296,7 @@
      */
 
     while (needsUpdate || (GetEvQHdr()->qHead != NULL)) {
-	GetGlobalMouse(&currentMouse);
+	GetGlobalMouseTcl(&currentMouse);
 	SetRect(&mouseRect, currentMouse.h, currentMouse.v,
 		currentMouse.h + 1, currentMouse.v + 1);
 	RectRgn(notifier.utilityRgn, &mouseRect);
@@ -481,7 +481,7 @@
 	     * the current mouse position.
 	     */
 
-	    GetGlobalMouse(&currentMouse);
+	    GetGlobalMouseTcl(&currentMouse);
 	    SetRect(&mouseRect, currentMouse.h, currentMouse.v,
 		    currentMouse.h + 1, currentMouse.v + 1);
 	    RectRgn(notifier.utilityRgn, &mouseRect);
Index: mac/tclMacOSA.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacOSA.c,v
retrieving revision 1.6
diff -u -3 -r1.6 tclMacOSA.c
--- mac/tclMacOSA.c	1999/12/21 23:58:13	1.6
+++ mac/tclMacOSA.c	2001/11/23 01:01:24
@@ -2120,7 +2120,7 @@
 	    return TCL_ERROR;
 	}
 		
-	FSpCreateResFileCompat(&fileSpec,
+	FSpCreateResFileCompatTcl(&fileSpec,
 		'WiSH', 'osas', smSystemScript);	
 	myErr = ResError();
 	
@@ -2132,7 +2132,7 @@
 	    goto rezEvalCleanUp;
 	}
 		
-	fileRef = FSpOpenResFileCompat(&fileSpec, fsRdWrPerm);
+	fileRef = FSpOpenResFileCompatTcl(&fileSpec, fsRdWrPerm);
 	if (fileRef == -1) {
 	    Tcl_AppendResult(interp, "Error reading the file: \"", 
 		    fileName, "\".", NULL);
@@ -2307,7 +2307,7 @@
 	    return TCL_ERROR;
 	}
 			
-	fileRef = FSpOpenResFileCompat(&fileSpec, fsRdPerm);
+	fileRef = FSpOpenResFileCompatTcl(&fileSpec, fsRdPerm);
 	if (fileRef == -1) {
 	    Tcl_AppendResult(interp, "Error reading the file: \"", 
 		    fileName, "\".", NULL);
Index: mac/tclMacOSA.exp
===================================================================
RCS file: tclMacOSA.exp
diff -N tclMacOSA.exp
--- /tmp/cvs3iZErn	Thu Nov 22 17:01:49 2001
+++ /dev/null	Thu May 24 22:33:05 2001
@@ -1 +0,0 @@
-Tclapplescript_Init
Index: mac/tclMacOSA.r
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacOSA.r,v
retrieving revision 1.3
diff -u -3 -r1.3 tclMacOSA.r
--- mac/tclMacOSA.r	1999/08/16 00:09:26	1.3
+++ mac/tclMacOSA.r	2001/11/23 01:01:24
@@ -20,12 +20,12 @@
  */
 
 #define SCRIPT_MAJOR_VERSION 1		/* Major number */
-#define SCRIPT_MINOR_VERSION  0		/* Minor number */
-#define SCRIPT_RELEASE_SERIAL  2	/* Really minor number! */
-#define RELEASE_LEVEL alpha		/* alpha, beta, or final */
-#define SCRIPT_VERSION "1.0"
-#define SCRIPT_PATCH_LEVEL "1.0a2"
-#define FINAL 0				/* Change to 1 if final version. */
+#define SCRIPT_MINOR_VERSION  1		/* Minor number */
+#define SCRIPT_RELEASE_SERIAL  0	/* Really minor number! */
+#define RELEASE_LEVEL final		/* alpha, beta, or final */
+#define SCRIPT_VERSION "1.1"
+#define SCRIPT_PATCH_LEVEL "1.1.0"
+#define FINAL 1				/* Change to 1 if final version. */
 
 #if FINAL
 #   define MINOR_VERSION (SCRIPT_MINOR_VERSION * 16) + SCRIPT_RELEASE_SERIAL
@@ -39,14 +39,14 @@
 	SCRIPT_MAJOR_VERSION, MINOR_VERSION,
 	RELEASE_LEVEL, 0x00, verUS,
 	SCRIPT_PATCH_LEVEL,
-	SCRIPT_PATCH_LEVEL ", by Jim Ingham © Cygnus Solutions"
+	SCRIPT_PATCH_LEVEL ", by Jim Ingham © Cygnus Solutions" "\n" "© 2001 Tcl Core Team"
 };
 
 resource 'vers' (2) {
 	SCRIPT_MAJOR_VERSION, MINOR_VERSION,
 	RELEASE_LEVEL, 0x00, verUS,
 	SCRIPT_PATCH_LEVEL,
-	"Tclapplescript " SCRIPT_PATCH_LEVEL " © 1996-1999"
+	"Tclapplescript " SCRIPT_PATCH_LEVEL " © 1996-2001"
 };
 
 /*
@@ -60,7 +60,7 @@
 	"TclAppleScript Library\n\n"
 	"This library provides the ability to run AppleScript "
 	" commands from Tcl/Tk programs.  To work properly, it "
-	"should be placed in the ÔTool Command LanguageÕ folder "
+	"should be placed in the Tool Command Language¹ folder "
 	"within the Extensions folder."
 };
 
@@ -71,6 +71,6 @@
 
 data 'TEXT' (4000,"pkgIndex",purgeable, preload) {
 	"# Tcl package index file, version 1.0\n"
-	"package ifneeded Tclapplescript 1.0 [list tclPkgSetup $dir Tclapplescript 1.0 {{Tclapplescript" 
+	"package ifneeded Tclapplescript 1.1 [list tclPkgSetup $dir Tclapplescript 1.1 {{Tclapplescript" 
 	".shlb load AppleScript}}]\n"
 };
Index: mac/tclMacPanic.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacPanic.c,v
retrieving revision 1.5
diff -u -3 -r1.5 tclMacPanic.c
--- mac/tclMacPanic.c	2001/06/17 03:48:19	1.5
+++ mac/tclMacPanic.c	2001/11/23 01:01:24
@@ -17,6 +17,7 @@
 
 #include <Events.h>
 #include <Controls.h>
+#include <ControlDefinitions.h>
 #include <Windows.h>
 #include <TextEdit.h>
 #include <Fonts.h>
@@ -59,7 +60,7 @@
  */
 
         /* VARARGS ARGSUSED */
-static void
+void
 TclpPanic TCL_VARARGS_DEF(CONST char *, format)
 {
     va_list varg;
@@ -128,7 +129,7 @@
 		    	part = FindControl(event.where, macWinPtr,
 				&okButtonHandle);
     	
-			if ((inButton == part) && 
+			if ((kControlButtonPart == part) && 
 				(TrackControl(okButtonHandle,
 					event.where, NULL))) {
 			    done = true;
@@ -152,7 +153,7 @@
 		    if (stopIconHandle != NULL) {
 			PlotIcon(&iconRect, stopIconHandle);
 		    }
-		    TextBox(msg, strlen(msg), &textRect, teFlushDefault);
+		    TETextBox(msg, strlen(msg), &textRect, teFlushDefault);
 		    DrawControls(macWinPtr);
 		    EndUpdate(macWinPtr);
 	    }
@@ -169,130 +170,3 @@
 #endif
 }
 
-/*
- * NOTE: The rest of this file is *identical* to the file
- * generic/tclPanic.c.  Someone with the right set of development tools on
- * the Mac should be able to build the Tcl library using that file, and
- * remove the rest of this one.
- */
-
-#include "tclInt.h"
-#include "tclPort.h"
-
-/*
- * The panicProc variable contains a pointer to an application
- * specific panic procedure.
- */
-
-static Tcl_PanicProc *panicProc = NULL;
-
-/*
- * The platformPanicProc variable contains a pointer to a platform
- * specific panic procedure, if any.  ( TclpPanic may be NULL via
- * a macro. )
- */
-
-static Tcl_PanicProc * CONST platformPanicProc = TclpPanic;
-
-
-/*
- *----------------------------------------------------------------------
- *
- * Tcl_SetPanicProc --
- *
- *	Replace the default panic behavior with the specified functiion.
- *
- * Results:
- *	None.
- *
- * Side effects:
- *	Sets the panicProc variable.
- *
- *----------------------------------------------------------------------
- */
-
-void
-Tcl_SetPanicProc(proc)
-    Tcl_PanicProc *proc;
-{
-    panicProc = proc;
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * Tcl_PanicVA --
- *
- *	Print an error message and kill the process.
- *
- * Results:
- *	None.
- *
- * Side effects:
- *	The process dies, entering the debugger if possible.
- *
- *----------------------------------------------------------------------
- */
-
-void
-Tcl_PanicVA (format, argList)
-    CONST char *format;		/* Format string, suitable for passing to
-				 * fprintf. */
-    va_list argList;		/* Variable argument list. */
-{
-    char *arg1, *arg2, *arg3, *arg4;	/* Additional arguments (variable in
-					 * number) to pass to fprintf. */
-    char *arg5, *arg6, *arg7, *arg8;
-
-    arg1 = va_arg(argList, char *);
-    arg2 = va_arg(argList, char *);
-    arg3 = va_arg(argList, char *);
-    arg4 = va_arg(argList, char *);
-    arg5 = va_arg(argList, char *);
-    arg6 = va_arg(argList, char *);
-    arg7 = va_arg(argList, char *);
-    arg8 = va_arg(argList, char *);
-    
-    if (panicProc != NULL) {
-	(void) (*panicProc)(format, arg1, arg2, arg3, arg4,
-		arg5, arg6, arg7, arg8);
-    } else if (platformPanicProc != NULL) {
-	(void) (*platformPanicProc)(format, arg1, arg2, arg3, arg4,
-		arg5, arg6, arg7, arg8);
-    } else {
-	(void) fprintf(stderr, format, arg1, arg2, arg3, arg4, arg5, arg6,
-		arg7, arg8);
-	(void) fprintf(stderr, "\n");
-	(void) fflush(stderr);
-	abort();
-    }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * Tcl_Panic --
- *
- *	Print an error message and kill the process.
- *
- * Results:
- *	None.
- *
- * Side effects:
- *	The process dies, entering the debugger if possible.
- *
- *----------------------------------------------------------------------
- */
-
-	/* VARARGS ARGSUSED */
-void
-Tcl_Panic TCL_VARARGS_DEF(CONST char *,arg1)
-{
-    va_list argList;
-    CONST char *format;
-
-    format = TCL_VARARGS_START(CONST char *,arg1,argList);
-    Tcl_PanicVA(format, argList);
-    va_end (argList);
-}
-
Index: mac/tclMacPort.h
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacPort.h,v
retrieving revision 1.13
diff -u -3 -r1.13 tclMacPort.h
--- mac/tclMacPort.h	2001/08/30 08:53:15	1.13
+++ mac/tclMacPort.h	2001/11/23 01:01:24
@@ -55,7 +55,7 @@
  * However, MetroWerks has screwed that file up a couple of times
  * and all we need are the defines.
  */
-
+#ifndef	_FCNTL
 #   define O_RDWR	  	0x0	/* open the file in read/write mode */
 #   define O_RDONLY  		0x1	/* open the file in read only mode */
 #   define O_WRONLY  		0x2	/* open the file in write only mode */
@@ -63,7 +63,7 @@
 #   define O_CREAT	  	0x0200	/* create the file if it doesn't exist */
 #   define O_EXCL	  	0x0400	/* if the file exists don't create it again */
 #   define O_TRUNC	  	0x0800	/* truncate the file after opening it */
-
+#endif
 /*
  * MetroWerks stat.h file is rather weak.  The defines
  * after the include are needed to fill in the missing
@@ -98,6 +98,7 @@
 #   	define S_IXOTH		00001	/* execute permission: other */
 #   endif
 
+#if __MSL__ < 0x6000
 #   define isatty(arg) 		1
 
 /* 
@@ -109,6 +110,7 @@
 #   define X_OK			0x01	/* test for execute or search permission */
 #   define W_OK			0x02	/* test for write permission */
 #   define R_OK			0x04	/* test for read permission */
+#endif
 
 #endif	/* __MWERKS__ */
 
@@ -148,6 +150,11 @@
 #define WTERMSIG(status) 	(1)
 #define WSTOPSIG(status) 	(1)
 
+#ifdef BUILD_tcl
+# undef TCL_STORAGE_CLASS
+# define TCL_STORAGE_CLASS DLLEXPORT
+#endif
+
 /*
  * Make sure that MAXPATHLEN is defined.
  */
@@ -205,15 +212,14 @@
 #define TCL_SHLIB_EXT ".shlb"
 
 /*
- * The following define is bogus and needs to be fixed.  It claims that
+ * The following define is defined as a workaround on the mac.  It claims that
  * struct tm has the timezone string in it, which is not true.  However,
  * the code that works around this fact does not compile on the Mac, since
  * it relies on the fact that time.h has a "timezone" variable, which the
  * Metrowerks time.h does not have...
  * 
- * The Mac timezone stuff never worked (clock format 0 -format %Z returns "Z")
- * so this just keeps the status quo.  The real answer is to not use the
- * MSL strftime, and provide the needed compat functions...
+ * The Mac timezone stuff is implemented via the TclpGetTZName() routine in
+ * tclMacTime.c
  * 
  */
  
@@ -296,9 +302,11 @@
 #endif /* TCL_THREADS */
 
 typedef pascal void (*ExitToShellProcPtr)(void);
-#include "tclMac.h"
-#include "tclMacInt.h"
-/* #include "tclPlatDecls.h"
-   #include "tclIntPlatDecls.h" */
+
+#include "tclMac.h" // contains #include "tclPlatDecls.h"
+#include "tclIntPlatDecls.h"
+
+# undef TCL_STORAGE_CLASS
+# define TCL_STORAGE_CLASS DLLIMPORT
 
 #endif /* _MACPORT */
Index: mac/tclMacResource.r
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacResource.r,v
retrieving revision 1.4
diff -u -3 -r1.4 tclMacResource.r
--- mac/tclMacResource.r	1999/08/16 00:09:30	1.4
+++ mac/tclMacResource.r	2001/11/23 01:01:24
@@ -40,21 +40,7 @@
 #   define MINOR_VERSION TCL_MINOR_VERSION * 16
 #endif
 
-resource 'vers' (1) {
-	TCL_MAJOR_VERSION, MINOR_VERSION,
-	RELEASE_LEVEL, 0x00, verUS,
-	TCL_PATCH_LEVEL,
-	TCL_PATCH_LEVEL ", by Ray Johnson & Jim Ingham © Scriptics Inc."
-};
 
-resource 'vers' (2) {
-	TCL_MAJOR_VERSION, MINOR_VERSION,
-	RELEASE_LEVEL, 0x00, verUS,
-	TCL_PATCH_LEVEL,
-	"Simple Tcl Shell " TCL_PATCH_LEVEL " © 1996 - 1999"
-};
-
-
 /* 
  * The mechanisim below loads Tcl source into the resource fork of the
  * application.  The example below creates a TEXT resource named
@@ -68,23 +54,4 @@
  */
 
 #include "tclMacTclCode.r"
-
-/*
- * The following resource is used when creating the 'env' variable in
- * the Macintosh environment.  The creation mechanisim looks for the
- * 'STR#' resource named "Tcl Environment Variables" rather than a
- * specific resource number.  (In other words, feel free to change the
- * resource id if it conflicts with your application.)  Each string in
- * the resource must be of the form "KEYWORD=SOME STRING".  See Tcl
- * documentation for futher information about the env variable.
- *
- * A good example of something you may want to set is: "TCL_LIBRARY=My
- * disk:etc."
- */
- 
-resource 'STR#' (128, "Tcl Environment Variables") {
-	{	"SCHEDULE_NAME=Agent Controller Schedule",
-		"SCHEDULE_PATH=Lozoya:System Folder:Tcl Lib:Tcl-Scheduler"
-	};
-};
 
Index: mac/tclMacShLib.exp
===================================================================
RCS file: tclMacShLib.exp
diff -N tclMacShLib.exp
--- /tmp/cvsT1dx4g	Thu Nov 22 17:01:49 2001
+++ /dev/null	Thu May 24 22:33:05 2001
@@ -1,1063 +0,0 @@
-AddrToName
-AddrToStr
-BuildAFPVolMountInfo
-BumpDate
-ChangeCreatorType
-ChangeFDFlags
-CheckObjectLock
-CheckVolLock
-ClearHasBeenInited
-ClearHasCustomIcon
-ClearIsInvisible
-ClearIsStationery
-ClearNameLocked
-CloseResolver
-ConfigureMemory
-CopyDirectoryAccess
-CopyFileMgrAttributes
-CopyFork
-CreateFileIDRef
-DTCopyComment
-DTGetIcon
-DTOpen
-DTSetComment
-DeleteDirectory
-DeleteDirectoryContents
-DeleteFileIDRef
-DetermineVRefNum
-DirectoryCopy
-EnumCache
-##EnvStr
-ExchangeFiles
-FSMakeFSSpecCompat
-FSReadNoCache
-FSWriteNoCache
-FSWriteVerify
-FSpBumpDate
-FSpCatMoveCompat
-FSpChangeCreatorType
-FSpChangeFDFlags
-FSpCheckObjectLock
-FSpClearHasBeenInited
-FSpClearHasCustomIcon
-FSpClearIsInvisible
-FSpClearIsStationery
-FSpClearNameLocked
-FSpCopyDirectoryAccess
-FSpCopyFile
-FSpCopyFileMgrAttributes
-FSpCreateCompat
-FSpCreateFileIDRef
-FSpCreateMinimum
-FSpCreateResFileCompat
-FSpDTCopyComment
-FSpDTSetComment
-FSpDeleteCompat
-FSpDirCreateCompat
-FSpDirectoryCopy
-FSpExchangeFilesCompat
-FSpFileCopy
-FSpFilteredDirectoryCopy
-FSpFindFolder
-FSpGetDInfo
-FSpGetDefaultDir
-FSpGetDirAccess
-FSpGetDirectoryID
-FSpGetFInfoCompat
-FSpGetFLockCompat
-FSpGetFileLocation
-FSpGetFileSize
-FSpGetForeignPrivs
-FSpGetFullPath
-FSpGetIOACUser
-FSpLocationFromFullPath
-FSpLocationFromPath
-FSpMoveRename
-FSpMoveRenameCompat
-FSpOpenAware
-FSpOpenDFCompat
-FSpOpenRFAware
-FSpOpenRFCompat
-FSpOpenResFileCompat
-FSpPathFromLocation
-FSpRenameCompat
-FSpResolveFileIDRef
-FSpRstFLockCompat
-FSpSetDInfo
-FSpSetDefaultDir
-FSpSetDirAccess
-FSpSetFInfoCompat
-FSpSetFLockCompat
-FSpSetForeignPrivs
-FSpSetHasCustomIcon
-FSpSetIsInvisible
-FSpSetIsStationery
-FSpSetNameLocked
-FSpShare
-FSpUnshare
-FileCopy
-FilteredDirectoryCopy
-FindDrive
-FlushFile
-FreeAllMemory
-GetCPanelFolder
-GetCatInfoNoName
-GetDInfo
-GetDirItems
-GetDirName
-GetDirectoryID
-GetDiskBlocks
-GetDriverName
-GetFileLocation
-GetFileSize
-GetFilenameFromPathname
-GetForeignPrivs
-GetFullPath
-GetGlobalMouse
-GetIOACUser
-GetObjectLocation
-GetParentID
-GetSystemFolder
-GetTempBuffer
-GetTrapType
-GetUGEntries
-GetUGEntry
-GetVolMountInfo
-GetVolMountInfoSize
-GetVolumeInfoNoName
-HCopyFile
-HCreateMinimum
-HGetDirAccess
-HGetLogInInfo
-HGetVInfo
-HGetVolParms
-HInfo
-HMapID
-HMapName
-HMoveRename
-HMoveRenameCompat
-HOpenAware
-HOpenRFAware
-hypotd
-HSetDirAccess
-InstallConsole
-LocationFromFullPath
-LockRange
-MXInfo
-NumToolboxTraps
-OnLine
-OpenOurRF
-OpenResolver
-PBXGetVolInfoSync
-ReadCharsFromConsole
-RemoveConsole
-ResolveFileIDRef
-RestoreDefault
-RetrieveAFPVolMountInfo
-SIOUXBigRect
-SIOUXCantSaveAlert
-SIOUXDoAboutBox
-SIOUXDoContentClick
-SIOUXDoEditClear
-SIOUXDoEditCopy
-SIOUXDoEditCut
-SIOUXDoEditPaste
-SIOUXDoEditSelectAll
-SIOUXDoMenuChoice
-SIOUXDoPageSetup
-SIOUXDoPrintText
-SIOUXDoSaveText
-SIOUXDragRect
-SIOUXDrawGrowBox
-SIOUXHandleOneEvent
-SIOUXIsAppWindow
-SIOUXMyGrowWindow
-SIOUXQuitting
-SIOUXSetTitle
-SIOUXSettings
-SIOUXSetupMenus
-SIOUXSetupTextWindow
-SIOUXState
-SIOUXTextWindow
-SIOUXUpdateMenuItems
-SIOUXUpdateScrollbar
-SIOUXUpdateStatusLine
-SIOUXUpdateWindow
-SIOUXUseWaitNextEvent
-SIOUXYesNoCancelAlert
-SIOUXisinrange
-SIOUXselstart
-SearchFolderForDNRP
-SetDInfo
-SetDefault
-SetForeignPrivs
-SetHasCustomIcon
-SetIsInvisible
-SetIsStationery
-SetNameLocked
-Share
-StrToAddr
-TclAllocateFreeObjects
-TclChdir
-TclCleanupByteCode
-TclCleanupCommand
-TclCompileBreakCmd
-TclCompileCatchCmd
-TclCompileContinueCmd
-TclCompileDollarVar
-TclCompileExpr
-TclCompileExprCmd
-TclCompileForCmd
-TclCompileForeachCmd
-TclCompileIfCmd
-TclCompileIncrCmd
-TclCompileQuotes
-TclCompileSetCmd
-TclCompileString
-TclCompileWhileCmd
-TclCopyAndCollapse
-TclCopyChannel
-TclCreateAuxData
-TclCreateExecEnv
-TclDate_TclDates
-TclDate_TclDatev
-TclDateact
-TclDatechar
-TclDatechk
-TclDatedebug
-TclDatedef
-TclDateerrflag
-TclDateexca
-TclDatelval
-TclDatenerrs
-TclDatepact
-TclDateparse
-TclDatepgo
-TclDateps
-TclDatepv
-TclDater1
-TclDater2
-TclDates
-TclDatestate
-TclDatetmp
-TclDatev
-TclDateval
-TclDeleteCompiledLocalVars
-TclDeleteExecEnv
-TclDeleteVars
-TclDoGlob
-TclEmitForwardJump
-TclExecuteByteCode
-TclExpandCodeArray
-TclExpandJumpFixupArray
-TclExprFloatError
-TclFileAttrsCmd
-TclFileCopyCmd
-TclFileDeleteCmd
-TclFileMakeDirsCmd
-TclFileRenameCmd
-TclFindElement
-TclFindProc
-TclFixupForwardJump
-TclFormatInt
-TclFreeCompileEnv
-TclFreeJumpFixupArray
-TclFreeObj
-TclFreePackageInfo
-TclGetCwd
-TclGetDate
-TclGetDefaultStdChannel
-TclGetElementOfIndexedArray
-TclGetEnv
-TclGetExceptionRangeForPc
-TclGetExtension
-TclGetFrame
-TclGetIndexedScalar
-TclGetIntForIndex
-TclGetLoadedPackages
-TclGetLong
-TclGetNamespaceForQualName
-TclGetOpenMode
-TclGetOriginalCommand
-TclGetRegError
-TclGetSrcInfoForPc
-TclGetUserHome
-TclGlobalInvoke
-TclGuessPackageName
-TclHasSockets
-TclHideUnsafeCommands
-TclInExit
-TclIncrElementOfIndexedArray
-TclIncrIndexedScalar
-TclIncrVar2
-TclInitByteCodeObj
-TclInitCompileEnv
-TclInitJumpFixupArray
-TclInitNamespaces
-TclInterpInit
-TclInvoke
-TclInvokeObjectCommand
-TclInvokeStringCommand
-TclIsProc
-TclLoadFile
-TclLooksLikeInt
-TclLookupVar
-TclMacCreateEnv
-TclMacExitHandler
-TclMacFOpenHack
-TclMacInitExitToShell
-TclMacInstallExitToShellPatch
-TclMacOSErrorToPosixError
-TclMacReadlink
-TclMacRemoveTimer
-TclMacStartTimer
-TclMacTimerExpired
-TclMatchFiles
-TclNeedSpace
-TclObjIndexForString
-TclObjInterpProc
-TclObjInvoke
-TclObjInvokeGlobal
-TclPlatformExit
-TclPlatformInit
-TclPreventAliasLoop
-TclPrintByteCodeObj
-TclPrintInstruction
-TclPrintSource
-TclRegComp
-TclRegError
-TclRegExec
-TclRenameCommand
-TclResetShadowedCmdRefs
-TclServiceIdle
-TclSetElementOfIndexedArray
-TclSetEnv
-TclSetIndexedScalar
-TclSetupEnv
-TclSockGetPort
-TclTeardownNamespace
-TclTestChannelCmd
-TclTestChannelEventCmd
-TclUnsetEnv
-TclUpdateReturnInfo
-TclWordEnd
-Tcl_AddErrorInfo
-Tcl_AddObjErrorInfo
-Tcl_AfterCmd
-Tcl_Alloc
-Tcl_AllowExceptions
-Tcl_AppendAllObjTypes
-Tcl_AppendElement
-Tcl_AppendObjCmd
-Tcl_AppendResult
-Tcl_AppendStringsToObj
-Tcl_AppendToObj
-Tcl_ArrayObjCmd
-Tcl_AsyncCreate
-Tcl_AsyncDelete
-Tcl_AsyncInvoke
-Tcl_AsyncMark
-Tcl_AsyncReady
-Tcl_BackgroundError
-Tcl_Backslash
-Tcl_BeepObjCmd
-Tcl_BinaryObjCmd
-Tcl_BreakCmd
-Tcl_CallWhenDeleted
-Tcl_CancelIdleCall
-Tcl_CaseObjCmd
-Tcl_CatchObjCmd
-Tcl_ClockObjCmd
-Tcl_Close
-Tcl_CommandComplete
-Tcl_Concat
-Tcl_ConcatObj
-Tcl_ConcatObjCmd
-Tcl_ContinueCmd
-Tcl_ConvertCountedElement
-Tcl_ConvertElement
-Tcl_ConvertToType
-Tcl_CreateAlias
-Tcl_CreateAliasObj
-Tcl_CreateChannel
-Tcl_CreateChannelHandler
-Tcl_CreateCloseHandler
-Tcl_CreateCommand
-Tcl_CreateEventSource
-Tcl_CreateExitHandler
-Tcl_CreateInterp
-Tcl_CreateMathFunc
-Tcl_CreateNamespace
-Tcl_CreateObjCommand
-Tcl_CreateSlave
-Tcl_CreateTimerHandler
-Tcl_CreateTrace
-Tcl_DStringAppend
-Tcl_DStringAppendElement
-Tcl_DStringEndSublist
-Tcl_DStringFree
-Tcl_DStringGetResult
-Tcl_DStringInit
-Tcl_DStringResult
-Tcl_DStringSetLength
-Tcl_DStringStartSublist
-Tcl_DbCkalloc
-Tcl_DbCkfree
-Tcl_DbCkrealloc
-Tcl_DbDecrRefCount
-Tcl_DbIsShared
-Tcl_DbIncrRefCount
-Tcl_DbNewBooleanObj
-Tcl_DbNewDoubleObj
-Tcl_DbNewListObj
-Tcl_DbNewLongObj
-Tcl_DbNewObj
-Tcl_DbNewStringObj
-Tcl_DeleteAssocData
-Tcl_DeleteChannelHandler
-Tcl_DeleteCloseHandler
-Tcl_DeleteCommand
-Tcl_DeleteCommandFromToken
-Tcl_DeleteEventSource
-Tcl_DeleteEvents
-Tcl_DeleteExitHandler
-Tcl_DeleteHashEntry
-Tcl_DeleteHashTable
-Tcl_DeleteInterp
-Tcl_DeleteNamespace
-Tcl_DeleteTimerHandler
-Tcl_DeleteTrace
-Tcl_DoOneEvent
-Tcl_DoWhenIdle
-Tcl_DontCallWhenDeleted
-Tcl_DumpActiveMemory
-Tcl_DuplicateObj
-Tcl_EchoCmd
-Tcl_Eof
-Tcl_ErrnoId
-Tcl_ErrnoMsg
-Tcl_ErrorObjCmd
-Tcl_Eval
-Tcl_EvalFile
-Tcl_EvalObj
-Tcl_EvalObjCmd
-Tcl_EventuallyFree
-Tcl_ExecCmd
-Tcl_Exit
-Tcl_ExitObjCmd
-Tcl_ExposeCommand
-Tcl_ExprBoolean
-Tcl_ExprBooleanObj
-Tcl_ExprDouble
-Tcl_ExprDoubleObj
-Tcl_ExprLong
-Tcl_ExprLongObj
-Tcl_ExprObjCmd
-Tcl_ExprString
-Tcl_FconfigureCmd
-Tcl_FcopyObjCmd
-Tcl_FileEventCmd
-Tcl_FileObjCmd
-Tcl_Finalize
-Tcl_FindCommand
-Tcl_FindExecutable
-Tcl_FindNamespace
-Tcl_FindNamespaceVar
-Tcl_FirstHashEntry
-Tcl_Flush
-Tcl_FlushObjCmd
-Tcl_ForCmd
-Tcl_ForeachObjCmd
-Tcl_ForgetImport
-Tcl_FormatCmd
-Tcl_Free
-Tcl_FreeResult
-Tcl_GetAlias
-Tcl_GetAliasObj
-Tcl_GetAssocData
-Tcl_GetBoolean
-Tcl_GetBooleanFromObj
-Tcl_GetChannel
-Tcl_GetChannelBufferSize
-Tcl_GetChannelHandle
-Tcl_GetChannelInstanceData
-Tcl_GetChannelMode
-Tcl_GetChannelName
-Tcl_GetChannelOption
-Tcl_GetChannelType
-Tcl_GetCommandFromObj
-Tcl_GetCommandFullName
-Tcl_GetCommandInfo
-Tcl_GetCommandName
-Tcl_GetCurrentNamespace
-Tcl_GetDouble
-Tcl_GetDoubleFromObj
-Tcl_GetErrno
-Tcl_GetGlobalNamespace
-Tcl_GetHostName
-Tcl_GetIndexFromObj
-Tcl_GetInt
-Tcl_GetIntFromObj
-Tcl_GetInterpPath
-Tcl_GetLongFromObj
-Tcl_GetMaster
-Tcl_GetOSTypeFromObj
-Tcl_GetObjResult
-Tcl_GetObjType
-Tcl_GetPathType
-Tcl_GetServiceMode
-Tcl_GetSlave
-Tcl_GetStdChannel
-Tcl_GetStringFromObj
-Tcl_GetStringResult
-Tcl_GetTime
-Tcl_GetVar
-Tcl_GetVar2
-Tcl_GetVariableFullName
-Tcl_Gets
-Tcl_GetsObj
-Tcl_GetsObjCmd
-Tcl_GlobCmd
-Tcl_GlobalEval
-Tcl_GlobalEvalObj
-Tcl_GlobalObjCmd
-Tcl_HashStats
-Tcl_HideCommand
-Tcl_IfCmd
-Tcl_Import
-Tcl_IncrCmd
-Tcl_InfoObjCmd
-Tcl_Init
-Tcl_InitHashTable
-Tcl_InitMemory
-Tcl_InputBlocked
-Tcl_InputBuffered
-Tcl_InterpDeleted
-Tcl_InterpObjCmd
-Tcl_IsSafe
-Tcl_JoinObjCmd
-Tcl_JoinPath
-Tcl_LappendObjCmd
-Tcl_LindexObjCmd
-Tcl_LinkVar
-Tcl_LinsertObjCmd
-Tcl_ListObjAppendElement
-Tcl_ListObjAppendList
-Tcl_ListObjCmd
-Tcl_ListObjGetElements
-Tcl_ListObjIndex
-Tcl_ListObjLength
-Tcl_ListObjReplace
-Tcl_LlengthObjCmd
-Tcl_LoadCmd
-Tcl_LrangeObjCmd
-Tcl_LreplaceObjCmd
-Tcl_LsCmd
-Tcl_LsearchObjCmd
-Tcl_LsortObjCmd
-Tcl_MacConvertTextResource
-Tcl_MacEvalResource
-Tcl_MacFindResource
-Tcl_MacSetEventProc
-Tcl_MacSourceObjCmd
-Tcl_Main
-Tcl_MakeSafe
-Tcl_MakeTcpClientChannel
-Tcl_Merge
-Tcl_NamespaceObjCmd
-Tcl_NewBooleanObj
-Tcl_NewDoubleObj
-Tcl_NewIntObj
-Tcl_NewListObj
-Tcl_NewLongObj
-Tcl_NewOSTypeObj
-Tcl_NewObj
-Tcl_NewStringObj
-Tcl_NextHashEntry
-Tcl_NotifyChannel
-Tcl_ObjGetVar2
-Tcl_ObjSetVar2
-Tcl_OpenCmd
-Tcl_OpenFileChannel
-Tcl_OpenTcpClient
-Tcl_OpenTcpServer
-Tcl_PackageCmd
-Tcl_ParseVar
-Tcl_PidObjCmd
-Tcl_PkgProvide
-Tcl_PkgRequire
-Tcl_PopCallFrame
-Tcl_PosixError
-Tcl_Preserve
-Tcl_PrintDouble
-Tcl_ProcObjCmd
-Tcl_PushCallFrame
-Tcl_PutEnv
-Tcl_PutsObjCmd
-Tcl_PwdCmd
-Tcl_QueueEvent
-Tcl_Read
-Tcl_ReadObjCmd
-Tcl_Realloc
-Tcl_RecordAndEval
-Tcl_RegExpCompile
-Tcl_RegExpExec
-Tcl_RegExpMatch
-Tcl_RegExpRange
-Tcl_RegexpCmd
-Tcl_RegisterChannel
-Tcl_RegisterObjType
-Tcl_RegsubCmd
-Tcl_Release
-Tcl_RenameObjCmd
-Tcl_ResetResult
-Tcl_ResourceObjCmd
-Tcl_ReturnObjCmd
-Tcl_ScanCmd
-Tcl_ScanCountedElement
-Tcl_ScanElement
-Tcl_Seek
-Tcl_SeekCmd
-Tcl_ServiceAll
-Tcl_ServiceEvent
-Tcl_SetAssocData
-Tcl_SetBooleanObj
-Tcl_SetChannelBufferSize
-Tcl_SetChannelOption
-Tcl_SetCmd
-Tcl_SetCommandInfo
-Tcl_SetDoubleObj
-Tcl_SetErrno
-Tcl_SetErrorCode
-Tcl_SetIntObj
-Tcl_SetListObj
-Tcl_SetLongObj
-Tcl_SetMaxBlockTime
-Tcl_SetOSTypeObj
-Tcl_SetObjErrorCode
-Tcl_SetObjLength
-Tcl_SetObjResult
-Tcl_SetPanicProc
-Tcl_SetRecursionLimit
-Tcl_SetResult
-Tcl_SetServiceMode
-Tcl_SetStdChannel
-Tcl_SetStringObj
-Tcl_SetTimer
-Tcl_SetVar
-Tcl_SetVar2
-Tcl_SignalId
-Tcl_SignalMsg
-Tcl_Sleep
-Tcl_SocketCmd
-Tcl_SourceObjCmd
-Tcl_SourceRCFile
-Tcl_SplitList
-Tcl_SplitPath
-Tcl_StaticPackage
-Tcl_StringMatch
-Tcl_StringObjCmd
-Tcl_SubstCmd
-Tcl_SwitchObjCmd
-Tcl_Tell
-Tcl_TellCmd
-Tcl_TimeObjCmd
-Tcl_TraceCmd
-Tcl_TraceVar
-Tcl_TraceVar2
-Tcl_TranslateFileName
-Tcl_Ungets
-Tcl_UnlinkVar
-Tcl_UnregisterChannel
-Tcl_UnsetObjCmd
-Tcl_UnsetVar
-Tcl_UnsetVar2
-Tcl_UntraceVar
-Tcl_UntraceVar2
-Tcl_UpVar
-Tcl_UpVar2
-Tcl_UpdateCmd
-Tcl_UpdateLinkedVar
-Tcl_UplevelObjCmd
-Tcl_UpvarObjCmd
-Tcl_ValidateAllMemory
-Tcl_VarEval
-Tcl_VarTraceInfo
-Tcl_VarTraceInfo2
-Tcl_VariableObjCmd
-Tcl_VwaitCmd
-Tcl_WaitForEvent
-Tcl_WaitPid
-Tcl_WhileCmd
-Tcl_Write
-Tcl_WrongNumArgs
-TclpAlloc
-TclpCopyDirectory
-TclpCopyFile
-TclpCreateDirectory
-TclpDeleteFile
-TclpFree
-TclpGetClicks
-TclpGetDate
-TclpGetSeconds
-TclpGetTime
-TclpGetTimeZone
-TclpListVolumes
-TclpRealloc
-TclpRemoveDirectory
-TclpRenameFile
-TrapExists
-TruncPString
-UnlockRange
-UnmountAndEject
-Unshare
-VolumeMount
-WriteCharsToConsole
-XGetVInfo
-_Ctype
-_Stderr
-_Stoul
-abort
-abs
-acosf
-appMemory
-asctime
-asinf
-atan
-atan2
-atan2_d_dd
-atan2_d_pdpd
-atan2_r_prpr
-atan2_r_rr
-atan2f
-atan_d_d
-atan_d_pd
-atan_r_pr
-atan_r_r
-atanf
-atexit
-atof
-atoi
-atol
-bsearch
-builtinFuncTable
-calloc
-ccommand
-ceilf
-chdir
-clearerr
-clock
-close
-closeUPP
-completeUPP
-cos
-cos_d_d
-cos_d_pd
-cos_r_pr
-cos_r_r
-cosf
-coshf
-creat
-ctime
-cuserid
-difftime
-div
-environ
-errno
-exec
-exit
-exp
-exp_d_d
-exp_d_pd
-exp_r_pr
-exp_r_r
-expf
-fabsf
-fclose
-fcntl
-fdopen
-feof
-ferror
-fflush
-fgetc
-fgetpos
-fgets
-fileno
-floorf
-fmodf
-fopen
-fprintf
-fputc
-fputs
-fread
-free
-freopen
-frexpf
-fscanf
-fseek
-fsetpos
-fstat
-ftell
-fwrite
-getStdChannelsProc
-getc
-getchar
-getcwd
-getenv
-getlogin
-gets
-gmtime
-instructionTable
-isalnum
-isalpha
-isatty
-iscntrl
-isdigit
-isgraph
-islower
-isprint
-ispunct
-isspace
-isupper
-isxdigit
-labs
-ldexpf
-ldiv
-localeconv
-localtime
-log
-log10
-log10_d_d
-log10_d_pd
-log10f
-log_d_d
-log_d_pd
-logf
-longjmp
-lseek
-malloc
-mblen
-mbstowcs
-mbtowc
-memchr
-memcmp
-memcpy
-memmove
-memset
-mkdir
-mktime
-open
-panic
-panicProc
-perror
-pow
-power_d_dd
-powf
-printf
-putc
-putchar
-puts
-qsort
-raise
-rand
-read
-realloc
-remove
-rename
-resultUPP
-rewind
-rmdir
-scanf
-setbuf
-setlocale
-setvbuf
-signal
-sin
-sin_d_d
-sin_d_pd
-sin_r_pr
-sin_r_r
-sinf
-sinhf
-sleep
-sprintf
-sqrt
-sqrt_d_d
-sqrt_d_pd
-sqrt_r_pr
-sqrt_r_r
-sqrtf
-srand
-sscanf
-stat
-strcasecmp
-strcat
-strchr
-strcmp
-strcoll
-strcpy
-strcspn
-strerror
-strftime
-strlen
-strncasecmp
-strncat
-strncmp
-strncpy
-strpbrk
-strrchr
-strspn
-strstr
-strtod
-strtok
-strtol
-strtoul
-strxfrm
-system
-systemMemory
-tanf
-tanhf
-tclBooleanType
-tclByteCodeType
-tclCmdNameType
-tclDoubleType
-tclDummyLinkVarPtr
-tclExecutableName
-tclFreeObjList
-tclIndexType
-tclIntType
-tclListType
-tclMemDumpFileName
-tclNsNameType
-tclPlatform
-tclStringType
-tclTraceCompile
-tclTraceExec
-tclTypeTable
-tcl_MathInProgress
-tclpFileAttrProcs
-tclpFileAttrStrings
-tell
-time
-tmpfile
-tmpnam
-tolower
-toupper
-ttyname
-uname
-ungetc
-unlink
-utime
-utimes
-vfprintf
-vprintf
-vsprintf
-wcstombs
-wctob
-wctomb
-write
-#DTGetAPPL
-#DTGetComment
-#FSpDTGetAPPL
-#FSpDTGetComment
-#TclMacInitializeFragment
-#TclMacTerminateFragment
-#_Aldata
-#_Assert
-#_Atcount
-#_Atfuns
-#_Clocale
-#_Closreg
-#_Costate
-#_Daysto
-#_Dbl
-#_Defloc
-#_Environ
-#_Environ1
-#_Fgpos
-#_Files
-#_Flt
-#_Fopen
-#_Foprep
-#_Fread
-#_Freeloc
-#_Frprep
-#_Fspos
-#_Fwprep
-#_Fwrite
-#_Genld
-#_Gentime
-#_Getdst
-#_Getfld
-#_Getfloat
-#_Getint
-#_Getloc
-#_Getmem
-#_Getstr
-#_Gettime
-#_Getzone
-#_Isdst
-#_Ldbl
-#_Ldtob
-#_Litob
-#_Locale
-#_Locsum
-#_Loctab
-#_Locterm
-#_Locvar
-#_MWERKS_Atcount
-#_MWERKS_Atfuns
-#_Makeloc
-#_Makestab
-#_Makewct
-#_Mbcurmax
-#_Mbstate
-#_Mbtowc
-#_Nnl
-#_PJP_C_Copyright
-#_Printf
-#_Putfld
-#_Putstr
-#_Puttxt
-#_Randseed
-#_Readloc
-#_Scanf
-#_Setloc
-#_Skip
-#_Stdin
-#_Stdout
-#_Stod
-#_Stof
-#_Stoflt
-#_Stold
-#_Strerror
-#_Strftime
-#_Strxfrm
-#_Times
-#_Tolower
-#_Toupper
-#_Ttotm
-#_WCostate
-#_Wcstate
-#_Wctob
-#_Wctomb
-#_Wctrans
-#_Wctype
-#__CheckForSystem7
-#__RemoveConsoleHandler__
-#__aborting
-#__ctopstring
-#__cvt_fp2unsigned
-#__getcreator
-#__gettype
-#__initialize
-#__myraise
-#__ptmf_null
-#__ptr_glue
-#__system7present
-#__terminate
-#__ttyname
-#_atexit
-#_exit
-#_fcreator
-#_ftype
Index: mac/tclMacSock.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacSock.c,v
retrieving revision 1.8
diff -u -3 -r1.8 tclMacSock.c
--- mac/tclMacSock.c	2001/04/04 14:49:35	1.8
+++ mac/tclMacSock.c	2001/11/23 01:01:25
@@ -196,7 +196,7 @@
 
 static Tcl_ChannelType tcpChannelType = {
     "tcp",			/* Type name. */
-    TcpBlockMode,		/* Set blocking or
+    (Tcl_ChannelTypeVersion)TcpBlockMode,		/* Set blocking or
                                  * non-blocking mode.*/
     TcpClose,			/* Close proc. */
     TcpInput,			/* Input proc. */
Index: mac/tclMacThrd.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacThrd.c,v
retrieving revision 1.5
diff -u -3 -r1.5 tclMacThrd.c
--- mac/tclMacThrd.c	2000/05/02 22:02:36	1.5
+++ mac/tclMacThrd.c	2001/11/23 01:01:25
@@ -129,7 +129,7 @@
 #if TARGET_CPU_68K && TARGET_RT_MAC_CFM
     {
         ThreadEntryProcPtr entryProc;
-        entryProc = NewThreadEntryProc(proc);
+        entryProc = NewThreadEntryUPP(proc);
         
         NewThread(kCooperativeThread, entryProc, (void *) clientData, 
             stackSize, kCreateIfNeeded, NULL, (ThreadID *) idPtr);
Index: mac/tclMacTime.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacTime.c,v
retrieving revision 1.5
diff -u -3 -r1.5 tclMacTime.c
--- mac/tclMacTime.c	2001/11/21 02:36:21	1.5
+++ mac/tclMacTime.c	2001/11/23 01:01:25
@@ -14,6 +14,7 @@
 
 #include "tclInt.h"
 #include "tclPort.h"
+#include "tclMacInt.h"
 #include <OSUtils.h>
 #include <Timer.h>
 #include <time.h>
@@ -33,6 +34,83 @@
 
 static int gmt_lastGetDateUseGMT = 0;
 
+typedef struct _TABLE {
+    char        *name;
+    int         type;
+    time_t      value;
+} TABLE;
+
+
+#define HOUR(x)         ((time_t) (3600 * x))
+
+#define tZONE 0
+#define tDAYZONE 1
+
+
+/*
+ * inverse timezone table, adapted from tclDate.c by removing duplicates and
+ * adding some made up names for unusual daylight savings
+ */
+static TABLE    invTimezoneTable[] = {
+    { "Z",    -1,     HOUR( 36) },      /* Unknown */
+    { "GMT",    tZONE,     HOUR( 0) },      /* Greenwich Mean */
+    { "BST",    tDAYZONE,  HOUR( 0) },      /* British Summer */
+    { "WAT",    tZONE,     HOUR( 1) },      /* West Africa */
+    { "WADST",  tDAYZONE,  HOUR( 1) },      /* West Africa Daylight*/
+    { "AT",     tZONE,     HOUR( 2) },      /* Azores Daylight*/
+    { "ADST",   tDAYZONE,  HOUR( 2) },      /* Azores */
+    { "NFT",    tZONE,     HOUR( 7/2) },    /* Newfoundland */
+    { "NDT",    tDAYZONE,  HOUR( 7/2) },    /* Newfoundland Daylight */
+    { "AST",    tZONE,     HOUR( 4) },      /* Atlantic Standard */
+    { "ADT",    tDAYZONE,  HOUR( 4) },      /* Atlantic Daylight */
+    { "EST",    tZONE,     HOUR( 5) },      /* Eastern Standard */
+    { "EDT",    tDAYZONE,  HOUR( 5) },      /* Eastern Daylight */
+    { "CST",    tZONE,     HOUR( 6) },      /* Central Standard */
+    { "CDT",    tDAYZONE,  HOUR( 6) },      /* Central Daylight */
+    { "MST",    tZONE,     HOUR( 7) },      /* Mountain Standard */
+    { "MDT",    tDAYZONE,  HOUR( 7) },      /* Mountain Daylight */
+    { "PST",    tZONE,     HOUR( 8) },      /* Pacific Standard */
+    { "PDT",    tDAYZONE,  HOUR( 8) },      /* Pacific Daylight */
+    { "YST",    tZONE,     HOUR( 9) },      /* Yukon Standard */
+    { "YDT",    tDAYZONE,  HOUR( 9) },      /* Yukon Daylight */
+    { "HST",    tZONE,     HOUR(10) },      /* Hawaii Standard */
+    { "HDT",    tDAYZONE,  HOUR(10) },      /* Hawaii Daylight */
+    { "NT",     tZONE,     HOUR(11) },      /* Nome */
+    { "NST",    tDAYZONE,  HOUR(11) },      /* Nome Daylight*/
+    { "IDLW",   tZONE,     HOUR(12) },      /* International Date Line West */
+    { "CET",    tZONE,    -HOUR( 1) },      /* Central European */
+    { "CEST",   tDAYZONE, -HOUR( 1) },      /* Central European Summer */
+    { "EET",    tZONE,    -HOUR( 2) },      /* Eastern Europe, USSR Zone 1 */
+    { "EEST",   tDAYZONE, -HOUR( 2) },      /* Eastern Europe, USSR Zone 1 Daylight*/
+    { "BT",     tZONE,    -HOUR( 3) },      /* Baghdad, USSR Zone 2 */
+    { "BDST",   tDAYZONE, -HOUR( 3) },      /* Baghdad, USSR Zone 2 Daylight*/
+    { "IT",     tZONE,    -HOUR( 7/2) },    /* Iran */
+    { "IDST",   tDAYZONE, -HOUR( 7/2) },    /* Iran Daylight*/
+    { "ZP4",    tZONE,    -HOUR( 4) },      /* USSR Zone 3 */
+    { "ZP4S",   tDAYZONE, -HOUR( 4) },      /* USSR Zone 3 */
+    { "ZP5",    tZONE,    -HOUR( 5) },      /* USSR Zone 4 */
+    { "ZP5S",   tDAYZONE, -HOUR( 5) },      /* USSR Zone 4 */
+    { "IST",    tZONE,    -HOUR(11/2) },    /* Indian Standard */
+    { "ISDST",  tDAYZONE, -HOUR(11/2) },    /* Indian Standard */
+    { "ZP6",    tZONE,    -HOUR( 6) },      /* USSR Zone 5 */
+    { "ZP6S",   tDAYZONE, -HOUR( 6) },      /* USSR Zone 5 */
+    { "WAST",   tZONE,    -HOUR( 7) },      /* West Australian Standard */
+    { "WADT",   tDAYZONE, -HOUR( 7) },      /* West Australian Daylight */
+    { "JT",     tZONE,    -HOUR(15/2) },    /* Java (3pm in Cronusland!) */
+    { "JDST",   tDAYZONE, -HOUR(15/2) },    /* Java (3pm in Cronusland!) */
+    { "CCT",    tZONE,    -HOUR( 8) },      /* China Coast, USSR Zone 7 */
+    { "CCST",   tDAYZONE, -HOUR( 8) },      /* China Coast, USSR Zone 7 */
+    { "JST",    tZONE,    -HOUR( 9) },      /* Japan Standard, USSR Zone 8 */
+    { "JSDST",  tDAYZONE, -HOUR( 9) },      /* Japan Standard, USSR Zone 8 */
+    { "CAST",   tZONE,    -HOUR(19/2) },    /* Central Australian Standard */
+    { "CADT",   tDAYZONE, -HOUR(19/2) },    /* Central Australian Daylight */
+    { "EAST",   tZONE,    -HOUR(10) },      /* Eastern Australian Standard */
+    { "EADT",   tDAYZONE, -HOUR(10) },      /* Eastern Australian Daylight */
+    { "NZT",    tZONE,    -HOUR(12) },      /* New Zealand */
+    { "NZDT",   tDAYZONE, -HOUR(12) },      /* New Zealand Daylight */
+    {  NULL  }
+};
+
 /*
  * Prototypes for procedures that are private to this file:
  */
@@ -286,6 +364,40 @@
     	statictime.tm_isdst = gmt_isdst;
     gmt_lastGetDateUseGMT=useGMT; /* hack to make TclpGetTZName below work */
     return(&statictime);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclpGetTZName --
+ *
+ *	Gets the current timezone string.
+ *
+ * Results:
+ *	Returns a pointer to a static string, or NULL on failure.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+char *
+TclpGetTZName(int dst)
+{
+    register TABLE *tp;
+	long zonevalue=-TclpGetGMTOffset();
+		
+	if(gmt_lastGetDateUseGMT) /* hack: if last TclpGetDate was called */
+		zonevalue=0;          /* with useGMT==1 then we're using GMT  */
+
+    for (tp = invTimezoneTable; tp->name; tp++) {
+        if ((tp->value == zonevalue) && (tp->type == dst)) break;
+    }
+	if(!tp->name)
+		tp = invTimezoneTable; /* default to unknown */
+
+    return tp->name;
 }
 
 #ifdef NO_LONG_LONG
Index: mac/tclMacUnix.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacUnix.c,v
retrieving revision 1.3
diff -u -3 -r1.3 tclMacUnix.c
--- mac/tclMacUnix.c	1999/04/16 00:47:22	1.3
+++ mac/tclMacUnix.c	2001/11/23 01:01:25
@@ -206,7 +206,7 @@
 
     resultObjPtr = Tcl_GetObjResult(interp);
     Tcl_IncrRefCount(resultObjPtr);
-    if (Tcl_ListObjGetElements(interp, resultObjPtr, &objc, &objv) != TCL_OK) {
+    if (Tcl_ListObjGetElements(interp, resultObjPtr, &objc, (Tcl_Obj ***)&objv) != TCL_OK) {
     	Tcl_DecrRefCount(resultObjPtr);
     	return TCL_ERROR;
     }
Index: mac/tclMacUtil.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacUtil.c,v
retrieving revision 1.4
diff -u -3 -r1.4 tclMacUtil.c
--- mac/tclMacUtil.c	2000/04/17 01:52:56	1.4
+++ mac/tclMacUtil.c	2001/11/23 01:01:25
@@ -53,7 +53,7 @@
  *----------------------------------------------------------------------
  */
  
-#if defined(THINK_C) || defined(__MWERKS__)
+#if defined(THINK_C)
 double hypotd(double x, double y);
 
 double
@@ -420,7 +420,7 @@
 /*
  *----------------------------------------------------------------------
  *
- * GetGlobalMouse --
+ * GetGlobalMouseTcl --
  *
  *	This procedure obtains the current mouse position in global
  *	coordinates.
@@ -435,11 +435,29 @@
  */
 
 void
-GetGlobalMouse(
+GetGlobalMouseTcl(
     Point *mouse)		/* Mouse position. */
 {
     EventRecord event;
     
     OSEventAvail(0, &event);
     *mouse = event.where;
+}
+
+pascal OSErr	FSpGetDirectoryIDTcl (CONST FSSpec * spec, 
+				long * theDirID, Boolean * isDirectory)
+{
+	return(FSpGetDirectoryID(spec, theDirID, isDirectory));
+}
+
+pascal short	FSpOpenResFileCompatTcl (CONST FSSpec * spec, SignedByte permission)
+{
+	return(FSpOpenResFileCompat(spec,permission));
+}
+
+pascal void	FSpCreateResFileCompatTcl (
+				CONST FSSpec * spec, OSType creator, 
+				OSType fileType, ScriptCode scriptTag)
+{
+	FSpCreateResFileCompat (spec,creator,fileType,scriptTag);
 }
Index: tests/all.tcl
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/all.tcl,v
retrieving revision 1.14
diff -u -3 -r1.14 all.tcl
--- tests/all.tcl	2001/09/11 18:03:05	1.14
+++ tests/all.tcl	2001/11/23 01:01:26
@@ -13,6 +13,10 @@
 set tcltestVersion [package require tcltest]
 namespace import -force tcltest::*
 
+if {$tcl_platform(platform) == "macintosh"} {
+	tcltest::singleProcess 1
+}
+
 tcltest::testsDirectory [file dir [info script]]
 tcltest::runAllTests
 
Index: tests/appendComp.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/appendComp.test,v
retrieving revision 1.4
diff -u -3 -r1.4 appendComp.test
--- tests/appendComp.test	2001/09/12 20:28:50	1.4
+++ tests/appendComp.test	2001/11/23 01:01:26
@@ -355,6 +355,7 @@
 catch {rename foo ""}
 catch {rename bar ""}
 catch {rename check ""}
+catch {rename bar {}}
 
 # cleanup
 ::tcltest::cleanupTests
Index: tests/cmdAH.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/cmdAH.test,v
retrieving revision 1.15
diff -u -3 -r1.15 cmdAH.test
--- tests/cmdAH.test	2001/09/09 17:32:16	1.15
+++ tests/cmdAH.test	2001/11/23 01:01:26
@@ -1178,7 +1178,7 @@
 test cmdAH-20.4 {Tcl_FileObjCmd: atime} {
     list [catch {file atime $file notint} msg] $msg
 } {1 {expected integer but got "notint"}}
-test cmdAH-20.5 {Tcl_FileObjCmd: atime touch} {
+test cmdAH-20.5 {Tcl_FileObjCmd: atime touch} {unixOrPc} {
     if {[string equal $tcl_platform(platform) "windows"]} {
 	set old [pwd]
 	cd $::tcltest::temporaryDirectory
Index: tests/cmdMZ.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/cmdMZ.test,v
retrieving revision 1.8
diff -u -3 -r1.8 cmdMZ.test
--- tests/cmdMZ.test	2001/05/21 22:33:47	1.8
+++ tests/cmdMZ.test	2001/11/23 01:01:26
@@ -78,7 +78,7 @@
 } {1 {wrong # args: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?"}}
 test cmdMZ-3.2 {Tcl_SourceObjCmd: error conditions} {macOnly} {
     list [catch {source a b} msg] $msg
-} {1 {wrong # args: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?"}}
+} {1 {bad argument: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?"}}
 test cmdMZ-3.3 {Tcl_SourceObjCmd: error conditions} {unixOrPc} {
     list [catch {source} msg] $msg
 } {1 {wrong # args: should be "source fileName"}}
Index: tests/compile.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/compile.test,v
retrieving revision 1.14
diff -u -3 -r1.14 compile.test
--- tests/compile.test	2001/11/19 21:04:42	1.14
+++ tests/compile.test	2001/11/23 01:01:26
@@ -289,7 +289,7 @@
 # Special test for underestimating the maxStackSize required for a
 # compiled command. A failure will cause a segfault in the child 
 # process.
-test compile-13.1 {testing underestimate of maxStackSize in list cmd} {
+test compile-13.1 {testing underestimate of maxStackSize in list cmd} {execCommandExists} {
     set body {set x [list}
     for {set i 0} {$i < 3000} {incr i} {
 	append body " $i"
Index: tests/exec.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/exec.test,v
retrieving revision 1.8
diff -u -3 -r1.8 exec.test
--- tests/exec.test	2000/04/10 17:18:58	1.8
+++ tests/exec.test	2001/11/23 01:01:27
@@ -228,7 +228,9 @@
 
 # I/O redirection: input from file.
 
+if { [set ::tcltest::testConstraints(execCommandExists)] } {
 exec $::tcltest::tcltest echo "Just a few thoughts" > gorp.file
+}
 test exec-5.1 {redirecting input from file} {execCommandExists stdio} {
     exec $::tcltest::tcltest cat < gorp.file
 } {Just a few thoughts}
@@ -432,7 +434,9 @@
 # Make sure that background commands are properly reaped when
 # they eventually die.
 
+if { [set ::tcltest::testConstraints(execCommandExists)] } {
 exec $::tcltest::tcltest sleep 3
+}
 test exec-12.1 {reaping background processes} \
 	{execCommandExists stdio unixOnly nonPortable} {
     for {set i 0} {$i < 20} {incr i} {
Index: tests/fileName.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/fileName.test,v
retrieving revision 1.15
diff -u -3 -r1.15 fileName.test
--- tests/fileName.test	2001/10/29 15:02:44	1.15
+++ tests/fileName.test	2001/11/23 01:01:28
@@ -304,6 +304,11 @@
     testsetplatform unix
     file split foo/bar~/baz
 } {foo bar~ baz}
+
+if {[tcltest::testConstraint testsetplatform]} {
+    testsetplatform $platform
+}
+
 test filename-4.19 {Tcl_SplitPath} {
     set oldDir [pwd]
     set res [catch {
@@ -317,6 +322,7 @@
 	set idx [string first tildetmp $norm]
 	set norm [string range $norm $idx end]
 	# fix path away so all platforms are the same
+	regsub {(.*):$} $norm {\1} norm
 	regsub -all ":" $norm "/" norm
 	# make sure we can delete the directory we created
 	cd $oldDir
@@ -1717,7 +1723,7 @@
 } //[info hostname]/c/globTest
 
 # cleanup
-file delete -force C:/globTest
+catch {file delete -force C:/globTest}
 cd $oldDir
 file delete -force globTest
 set env(HOME) $oldhome
Index: tests/lset.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/lset.test,v
retrieving revision 1.2
diff -u -3 -r1.2 lset.test
--- tests/lset.test	2001/11/14 23:16:36	1.2
+++ tests/lset.test	2001/11/23 01:01:28
@@ -449,6 +449,8 @@
 catch {unset noRead}
 catch {unset noWrite}
 catch {rename failTrace {}}
+catch {unset ::x}
+catch {unset ::y}
 
 # cleanup
 ::tcltest::cleanupTests
Index: tests/macFCmd.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/macFCmd.test,v
retrieving revision 1.7
diff -u -3 -r1.7 macFCmd.test
--- tests/macFCmd.test	2000/04/10 17:19:02	1.7
+++ tests/macFCmd.test	2001/11/23 01:01:28
@@ -32,7 +32,7 @@
 test macFCmd-1.1 {GetFileFinderAttributes - no file} {macOnly} {
     catch {file delete -force foo.file}
     list [catch {file attributes foo.file -creator} msg] $msg
-} {1 {could not read ":foo.file": no such file or directory}}
+} {1 {could not read "foo.file": no such file or directory}}
 test macFCmd-1.2 {GetFileFinderAttributes - creator} {macOnly} {
     catch {file delete -force foo.file}
     catch {close [open foo.file w]}
@@ -80,7 +80,7 @@
 test macFCmd-2.1 {GetFileReadOnly - bad file} {macOnly} {
     catch {file delete -force foo.file}
     list [catch {file attributes foo.file -readonly} msg] $msg
-} {1 {could not read ":foo.file": no such file or directory}}
+} {1 {could not read "foo.file": no such file or directory}}
 test macFCmd-2.2 {GetFileReadOnly - file not read only} {macOnly} {
     catch {file delete -force foo.file}
     close [open foo.file w]
@@ -111,7 +111,7 @@
 test macFCmd-3.1 {SetFileFinderAttributes - bad file} {macOnly} {
     catch {file delete -force foo.file}
     list [catch {file attributes foo.file -creator FOOO} msg] $msg
-} {1 {could not read ":foo.file": no such file or directory}}
+} {1 {could not read "foo.file": no such file or directory}}
 test macFCmd-3.2 {SetFileFinderAttributes - creator} {macOnly} {
     catch {file delete -force foo.file}
     close [open foo.file w]
@@ -147,12 +147,12 @@
     file mkdir foo.dir
     list [catch {file attributes foo.dir -creator FOOO} msg] \
 	    $msg [file delete -force foo.dir]
-} {1 {cannot set -creator: ":foo.dir" is a directory} {}}
+} {1 {cannot set -creator: "foo.dir" is a directory} {}}
 
 test macFCmd-4.1 {SetFileReadOnly - bad file} {macOnly} {
     catch {file delete -force foo.file}
     list [catch {file attributes foo.file -readonly 1} msg] $msg
-} {1 {could not read ":foo.file": no such file or directory}}
+} {1 {could not read "foo.file": no such file or directory}}
 test macFCmd-4.2 {SetFileReadOnly - file not readonly} {macOnly} {
     catch {file delete -force foo.file}
     close [open foo.file w]
Index: tests/namespace.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/namespace.test,v
retrieving revision 1.17
diff -u -3 -r1.17 namespace.test
--- tests/namespace.test	2001/09/12 20:28:50	1.17
+++ tests/namespace.test	2001/11/23 01:01:29
@@ -1137,6 +1137,7 @@
 } {global global}
 
 test namespace-41.1 {Shadowing byte-compiled commands} {
+	set res {}
     namespace eval ns {
 	set res {}
 	proc test {} {
@@ -1148,6 +1149,7 @@
 	}
 	lappend ::res [test]
     }
+    namespace delete ns
     set res
 } {0 1}
 
Index: tests/tcltest.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/tcltest.test,v
retrieving revision 1.16
diff -u -3 -r1.16 tcltest.test
--- tests/tcltest.test	2001/08/22 23:55:27	1.16
+++ tests/tcltest.test	2001/11/23 01:01:30
@@ -465,6 +465,9 @@
 makeFile {} thisdirectoryisafile  
 
 set normaldirectory [tcltest::makeDirectory normaldirectory]
+if {$::tcl_platform(platform) == "macintosh"} {
+set normaldirectory [file normalize $normaldirectory]
+}
 
 # -tmpdir, tcltest::temporaryDirectory
 test tcltest-8.1 {tcltest a.tcl -tmpdir a} {unixOrPc} {
@@ -498,7 +501,7 @@
 	file attributes $notWriteableDir -permissions 00555
     }
     default {
-	file attributes $notWriteableDir -readonly 1
+	catch {file attributes $notWriteableDir -readonly 1}
     }
 }
 
@@ -514,7 +517,7 @@
     list [regexp {not writeable} [join $msg]]
 } {1}
 
-test tcltest-8.5 {tcltest a.tcl -tmpdir normaldirectory} {
+test tcltest-8.5 {tcltest a.tcl -tmpdir normaldirectory} {unixOrPc} {
     catch {exec $::tcltest::tcltest a.tcl -tmpdir $normaldirectory} msg
     # The join is necessary because the message can be split on multiple lines
     file exists [file join $normaldirectory a.tmp]
@@ -551,13 +554,13 @@
 } -result "$normaldirectory $current $current" 
 
 # -testdir, tcltest::testsDirectory
-test tcltest-8.10 {tcltest a.tcl -testdir thisdirectorydoesnotexist} {
+test tcltest-8.10 {tcltest a.tcl -testdir thisdirectorydoesnotexist} {unixOrPc} {
     file delete -force thisdirectorydoesnotexist
     catch {exec $::tcltest::tcltest a.tcl -testdir thisdirectorydoesnotexist}  msg
     list [regexp "does not exist" [join $msg]]
 } {1}
 
-test tcltest-8.11 {tcltest a.tcl -testdir thisdirectoryisafile} {
+test tcltest-8.11 {tcltest a.tcl -testdir thisdirectoryisafile} {unixOrPc} {
     catch {exec $::tcltest::tcltest a.tcl -testdir thisdirectoryisafile} msg
     # The join is necessary because the message can be split on multiple lines
     list [regexp "not a directory" [join $msg]] 
@@ -570,7 +573,7 @@
 } {1}
 
 
-test tcltest-8.13 {tcltest a.tcl -testdir normaldirectory} {
+test tcltest-8.13 {tcltest a.tcl -testdir normaldirectory} {unixOrPc} {
     catch {exec $::tcltest::tcltest a.tcl -testdir normaldirectory} msg
     # The join is necessary because the message can be split on multiple lines
     regexp "testdir: $normaldirectory" [join $msg]
@@ -625,7 +628,7 @@
 	file attributes $notWriteableDir -permissions 777
     }
     default {
-	file attributes $notWriteableDir -readonly 0
+	catch {file attributes $notWriteableDir -readonly 0}
     }
 }
 