diff options
author | das <das> | 2001-11-23 01:26:52 (GMT) |
---|---|---|
committer | das <das> | 2001-11-23 01:26:52 (GMT) |
commit | 5bf5a16c3a6e83b4297123ae905297ac723f7f81 (patch) | |
tree | 725fbc934e8cfe62511b965b22c0069a3e157e67 /mac | |
parent | 8ddfd6bbdf803f32768cf447560be0af0e97e08b (diff) | |
download | tcl-5bf5a16c3a6e83b4297123ae905297ac723f7f81.zip tcl-5bf5a16c3a6e83b4297123ae905297ac723f7f81.tar.gz tcl-5bf5a16c3a6e83b4297123ae905297ac723f7f81.tar.bz2 |
** 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)
see ChangeLog for details
Diffstat (limited to 'mac')
-rw-r--r-- | mac/MW_TclBuildLibHeader.h | 7 | ||||
-rw-r--r-- | mac/MW_TclBuildLibHeader.pch | 35 | ||||
-rw-r--r-- | mac/MW_TclHeaderCommon.h | 54 | ||||
-rw-r--r-- | mac/MW_TclStaticHeader.h | 7 | ||||
-rw-r--r-- | mac/MW_TclStaticHeader.pch | 35 | ||||
-rw-r--r-- | mac/tclMac.h | 12 | ||||
-rw-r--r-- | mac/tclMacAlloc.c | 174 | ||||
-rw-r--r-- | mac/tclMacAppInit.c | 5 | ||||
-rw-r--r-- | mac/tclMacApplication.r | 46 | ||||
-rw-r--r-- | mac/tclMacChan.c | 6 | ||||
-rwxr-xr-x | mac/tclMacCommonPch.h | 23 | ||||
-rw-r--r-- | mac/tclMacFCmd.c | 83 | ||||
-rw-r--r-- | mac/tclMacFile.c | 9 | ||||
-rw-r--r-- | mac/tclMacInt.h | 27 | ||||
-rw-r--r-- | mac/tclMacLibrary.c | 11 | ||||
-rw-r--r-- | mac/tclMacLibrary.r | 24 | ||||
-rw-r--r-- | mac/tclMacLoad.c | 56 | ||||
-rw-r--r-- | mac/tclMacMSLPrefix.h | 24 | ||||
-rw-r--r-- | mac/tclMacMath.h | 4 | ||||
-rw-r--r-- | mac/tclMacNotify.c | 8 | ||||
-rw-r--r-- | mac/tclMacOSA.c | 8 | ||||
-rw-r--r-- | mac/tclMacOSA.exp | 1 | ||||
-rw-r--r-- | mac/tclMacOSA.r | 22 | ||||
-rw-r--r-- | mac/tclMacPanic.c | 136 | ||||
-rw-r--r-- | mac/tclMacPort.h | 30 | ||||
-rw-r--r-- | mac/tclMacResource.r | 35 | ||||
-rw-r--r-- | mac/tclMacShLib.exp | 1063 | ||||
-rw-r--r-- | mac/tclMacSock.c | 4 | ||||
-rw-r--r-- | mac/tclMacThrd.c | 2 | ||||
-rw-r--r-- | mac/tclMacTime.c | 114 | ||||
-rw-r--r-- | mac/tclMacUnix.c | 4 | ||||
-rw-r--r-- | mac/tclMacUtil.c | 26 |
32 files changed, 600 insertions, 1495 deletions
diff --git a/mac/MW_TclBuildLibHeader.h b/mac/MW_TclBuildLibHeader.h new file mode 100644 index 0000000..f6a6f61 --- /dev/null +++ b/mac/MW_TclBuildLibHeader.h @@ -0,0 +1,7 @@ +#if __POWERPC__ +#include "MW_TclBuildLibHeaderPPC" +#elif __CFM68K__ +#include "MW_TclBuildLibHeaderCFM68K" +#else +#include "MW_TclBuildLibHeader68K" +#endif diff --git a/mac/MW_TclBuildLibHeader.pch b/mac/MW_TclBuildLibHeader.pch new file mode 100644 index 0000000..a727451 --- /dev/null +++ b/mac/MW_TclBuildLibHeader.pch @@ -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$ + */ + +/* + * 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" diff --git a/mac/MW_TclHeaderCommon.h b/mac/MW_TclHeaderCommon.h new file mode 100644 index 0000000..56ea59c --- /dev/null +++ b/mac/MW_TclHeaderCommon.h @@ -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$ + */ + +#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 diff --git a/mac/MW_TclStaticHeader.h b/mac/MW_TclStaticHeader.h new file mode 100644 index 0000000..0c1abc2 --- /dev/null +++ b/mac/MW_TclStaticHeader.h @@ -0,0 +1,7 @@ +#if __POWERPC__ +#include "MW_TclStaticHeaderPPC" +#elif __CFM68K__ +#include "MW_TclStaticHeaderCFM68K" +#else +#include "MW_TclStaticHeader68K" +#endif diff --git a/mac/MW_TclStaticHeader.pch b/mac/MW_TclStaticHeader.pch new file mode 100644 index 0000000..f23021f --- /dev/null +++ b/mac/MW_TclStaticHeader.pch @@ -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$ + */ + +/* + * 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" diff --git a/mac/tclMac.h b/mac/tclMac.h index a051cc8..b937342 100644 --- a/mac/tclMac.h +++ b/mac/tclMac.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMac.h,v 1.4 1999/03/10 05:52:51 stanton Exp $ + * RCS: @(#) $Id: tclMac.h,v 1.5 2001/11/23 01:27:05 das Exp $ */ #ifndef _TCLMAC @@ -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 */ diff --git a/mac/tclMacAlloc.c b/mac/tclMacAlloc.c index c5daa8b..3e6a948 100644 --- a/mac/tclMacAlloc.c +++ b/mac/tclMacAlloc.c @@ -14,12 +14,13 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacAlloc.c,v 1.4 1999/05/11 07:11:51 jingham Exp $ + * RCS: @(#) $Id: tclMacAlloc.c,v 1.5 2001/11/23 01:27:09 das Exp $ */ #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 @@ static Handle toolGuardHandle = NULL; * 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 @@ static Handle toolGuardHandle = NULL; 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 @@ TclpSysRealloc( 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 @@ TclpSysAlloc( { 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 @@ TclpSysAlloc( if (toolGuardHandle == NULL) { toolGuardHandle = NewHandle(TOOLBOX_SPACE); if (toolGuardHandle != NULL) { + HLock(toolGuardHandle); HPurge(toolGuardHandle); } } @@ -167,55 +220,55 @@ TclpSysAlloc( 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 @@ void TclpSysFree( void * ptr) /* Free this system memory. */ { - Handle hand; - OSErr err; + if(tclUseMemTracking) { + /* Only need to do this when tracking memory */ + ListEl *memRecord; - hand = * (Handle *) ((Ptr) ptr - sizeof(Handle)); - DisposeHandle(hand); - *hand = NULL; - err = MemError(); + 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 @@ CleanUpExitProc() { 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 @@ FreeAllMemory() { 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); + } } } diff --git a/mac/tclMacAppInit.c b/mac/tclMacAppInit.c index 678198d..65f79e8 100644 --- a/mac/tclMacAppInit.c +++ b/mac/tclMacAppInit.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacAppInit.c,v 1.8 2001/06/17 03:48:19 dgp Exp $ + * RCS: @(#) $Id: tclMacAppInit.c,v 1.9 2001/11/23 01:27:13 das Exp $ */ #include "tcl.h" @@ -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 @@ MacintoshInit() SIOUXSettings.autocloseonquit = true; SIOUXSettings.showstatusline = true; SIOUXSettings.asktosaveonclose = false; + SIOUXSettings.wasteusetempmemory = true; InstallConsole(0); SIOUXSetTitle("\pTcl Interpreter"); diff --git a/mac/tclMacApplication.r b/mac/tclMacApplication.r index f69b3b6..c5b29a1 100644 --- a/mac/tclMacApplication.r +++ b/mac/tclMacApplication.r @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacApplication.r,v 1.3 1999/08/16 00:09:09 jingham Exp $ + * RCS: @(#) $Id: tclMacApplication.r,v 1.4 2001/11/23 01:27:16 das Exp $ */ #include <Types.r> @@ -42,21 +42,21 @@ 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" + 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 @@ resource 'kind' (128, "Tcl kind", purgeable) { '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)... */ +}; + diff --git a/mac/tclMacChan.c b/mac/tclMacChan.c index e728c7f..fc5e914 100644 --- a/mac/tclMacChan.c +++ b/mac/tclMacChan.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacChan.c,v 1.7 2001/08/30 08:53:15 vincentdarley Exp $ + * RCS: @(#) $Id: tclMacChan.c,v 1.8 2001/11/23 01:27:21 das Exp $ */ #include "tclInt.h" @@ -136,7 +136,7 @@ static int StdReady _ANSI_ARGS_((ClientData instanceData, 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 consoleChannelType = { 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. */ diff --git a/mac/tclMacCommonPch.h b/mac/tclMacCommonPch.h index b06a494..c0deb9d 100755 --- a/mac/tclMacCommonPch.h +++ b/mac/tclMacCommonPch.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacCommonPch.h,v 1.2 1998/11/11 07:46:04 jingham Exp $ + * RCS: @(#) $Id: tclMacCommonPch.h,v 1.3 2001/11/23 01:27:24 das Exp $ */ #if !__option(enumsalwaysint) @@ -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> diff --git a/mac/tclMacFCmd.c b/mac/tclMacFCmd.c index ebc9319..ac28522 100644 --- a/mac/tclMacFCmd.c +++ b/mac/tclMacFCmd.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacFCmd.c,v 1.10 2001/08/30 08:53:15 vincentdarley Exp $ + * RCS: @(#) $Id: tclMacFCmd.c,v 1.11 2001/11/23 01:27:29 das Exp $ */ #include "tclInt.h" @@ -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 @@ DoCopyDirectory( 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 @@ static int 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 @@ GetFileFinderAttributes( 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 @@ static int 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 @@ GetFileReadOnly( 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 @@ static int 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 @@ SetFileFinderAttributes( 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 @@ SetFileFinderAttributes( 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 @@ static int 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 @@ SetFileReadOnly( 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 @@ TclpObjNormalizePath(interp, pathPtr, nextCheckpoint) 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 @@ TclpObjNormalizePath(interp, pathPtr, nextCheckpoint) 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); diff --git a/mac/tclMacFile.c b/mac/tclMacFile.c index cb85d59..0084da5 100644 --- a/mac/tclMacFile.c +++ b/mac/tclMacFile.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacFile.c,v 1.12 2001/08/30 08:53:15 vincentdarley Exp $ + * RCS: @(#) $Id: tclMacFile.c,v 1.13 2001/11/23 01:27:32 das Exp $ */ /* @@ -177,7 +177,7 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) */ 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 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) &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 @@ TclpMatchInDirectory(interp, resultPtr, pathPtr, pattern, types) } } 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' diff --git a/mac/tclMacInt.h b/mac/tclMacInt.h index 77d274c..ab7bc7f 100644 --- a/mac/tclMacInt.h +++ b/mac/tclMacInt.h @@ -8,24 +8,22 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacInt.h,v 1.6 1999/08/16 00:09:18 jingham Exp $ + * RCS: @(#) $Id: tclMacInt.h,v 1.7 2001/11/23 01:27:36 das Exp $ */ #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)); + +# undef TCL_STORAGE_CLASS +# define TCL_STORAGE_CLASS DLLIMPORT -#include "tclPort.h" -#include "tclPlatDecls.h" #include "tclIntPlatDecls.h" -#pragma export reset - #endif /* _TCLMACINT */ diff --git a/mac/tclMacLibrary.c b/mac/tclMacLibrary.c index 989329f..59d4612 100644 --- a/mac/tclMacLibrary.c +++ b/mac/tclMacLibrary.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacLibrary.c,v 1.4 2000/02/10 09:59:10 jingham Exp $ + * RCS: @(#) $Id: tclMacLibrary.c,v 1.5 2001/11/23 01:27:39 das Exp $ */ /* @@ -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 diff --git a/mac/tclMacLibrary.r b/mac/tclMacLibrary.r index c526f17..2468c98 100644 --- a/mac/tclMacLibrary.r +++ b/mac/tclMacLibrary.r @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacLibrary.r,v 1.4 1999/08/16 00:09:22 jingham Exp $ + * RCS: @(#) $Id: tclMacLibrary.r,v 1.5 2001/11/23 01:27:42 das Exp $ */ #include <Types.r> @@ -42,14 +42,14 @@ 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." + 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 @@ resource 'FREF' (TCL_LIBRARY_RESOURCES, purgeable) 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,24 +125,10 @@ resource 'kind' (TCL_LIBRARY_RESOURCES, "Tcl kind", purgeable) { 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. */ diff --git a/mac/tclMacLoad.c b/mac/tclMacLoad.c index f3419f2..8490fa9 100644 --- a/mac/tclMacLoad.c +++ b/mac/tclMacLoad.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacLoad.c,v 1.7 2001/09/28 01:21:53 dgp Exp $ + * RCS: @(#) $Id: tclMacLoad.c,v 1.8 2001/11/23 01:27:45 das Exp $ */ #include <CodeFragments.h> @@ -108,7 +108,7 @@ TclpLoadFile( 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 @@ TclpLoadFile( 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 @@ TclpLoadFile( } /* + * 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 @@ TclpLoadFile( 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 @@ TclpLoadFile( CloseResFile(fragFileRef); UseResFile(saveFileRef); } + Tcl_DStringFree(&ds); /* * Now we can attempt to load the fragement using the offset & length @@ -197,9 +199,11 @@ TclpLoadFile( * 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 @@ TclpLoadFile( 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 @@ TclpLoadFile( 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 @@ TclpUnloadFile(clientData) * a token that represents the loaded * file. */ { + CloseConnection((CFragConnectionID*) &clientData); } /* diff --git a/mac/tclMacMSLPrefix.h b/mac/tclMacMSLPrefix.h deleted file mode 100644 index 1d11099..0000000 --- a/mac/tclMacMSLPrefix.h +++ /dev/null @@ -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 diff --git a/mac/tclMacMath.h b/mac/tclMacMath.h index 14af9a8..6366dc3 100644 --- a/mac/tclMacMath.h +++ b/mac/tclMacMath.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacMath.h,v 1.2 1998/09/14 18:40:05 stanton Exp $ + * RCS: @(#) $Id: tclMacMath.h,v 1.3 2001/11/23 01:27:50 das Exp $ */ #ifndef _TCLMACMATH @@ -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 diff --git a/mac/tclMacNotify.c b/mac/tclMacNotify.c index 50844cd..f27645e 100644 --- a/mac/tclMacNotify.c +++ b/mac/tclMacNotify.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacNotify.c,v 1.7 2001/11/21 02:36:21 hobbs Exp $ + * RCS: @(#) $Id: tclMacNotify.c,v 1.8 2001/11/23 01:27:53 das Exp $ */ #include "tclInt.h" @@ -266,7 +266,7 @@ HandleMacEvents(void) * system event queue unless we call WaitNextEvent. */ - GetGlobalMouse(¤tMouse); + GetGlobalMouseTcl(¤tMouse); if ((notifier.eventProcPtr != NULL) && !EqualPt(currentMouse, notifier.lastMousePosition)) { notifier.lastMousePosition = currentMouse; @@ -296,7 +296,7 @@ HandleMacEvents(void) */ while (needsUpdate || (GetEvQHdr()->qHead != NULL)) { - GetGlobalMouse(¤tMouse); + GetGlobalMouseTcl(¤tMouse); SetRect(&mouseRect, currentMouse.h, currentMouse.v, currentMouse.h + 1, currentMouse.v + 1); RectRgn(notifier.utilityRgn, &mouseRect); @@ -481,7 +481,7 @@ Tcl_WaitForEvent( * the current mouse position. */ - GetGlobalMouse(¤tMouse); + GetGlobalMouseTcl(¤tMouse); SetRect(&mouseRect, currentMouse.h, currentMouse.v, currentMouse.h + 1, currentMouse.v + 1); RectRgn(notifier.utilityRgn, &mouseRect); diff --git a/mac/tclMacOSA.c b/mac/tclMacOSA.c index 5036a8e..dce052e 100644 --- a/mac/tclMacOSA.c +++ b/mac/tclMacOSA.c @@ -12,7 +12,7 @@ * See the file "License Terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacOSA.c,v 1.6 1999/12/21 23:58:13 hobbs Exp $ + * RCS: @(#) $Id: tclMacOSA.c,v 1.7 2001/11/23 01:27:57 das Exp $ */ #define MAC_TCL @@ -2120,7 +2120,7 @@ tclOSAStore( return TCL_ERROR; } - FSpCreateResFileCompat(&fileSpec, + FSpCreateResFileCompatTcl(&fileSpec, 'WiSH', 'osas', smSystemScript); myErr = ResError(); @@ -2132,7 +2132,7 @@ tclOSAStore( 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 @@ tclOSALoad( return TCL_ERROR; } - fileRef = FSpOpenResFileCompat(&fileSpec, fsRdPerm); + fileRef = FSpOpenResFileCompatTcl(&fileSpec, fsRdPerm); if (fileRef == -1) { Tcl_AppendResult(interp, "Error reading the file: \"", fileName, "\".", NULL); diff --git a/mac/tclMacOSA.exp b/mac/tclMacOSA.exp deleted file mode 100644 index 4cde512..0000000 --- a/mac/tclMacOSA.exp +++ /dev/null @@ -1 +0,0 @@ -Tclapplescript_Init diff --git a/mac/tclMacOSA.r b/mac/tclMacOSA.r index 7343764..ebbb0de 100644 --- a/mac/tclMacOSA.r +++ b/mac/tclMacOSA.r @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacOSA.r,v 1.3 1999/08/16 00:09:26 jingham Exp $ + * RCS: @(#) $Id: tclMacOSA.r,v 1.4 2001/11/23 01:28:04 das Exp $ */ #include <Types.r> @@ -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 @@ resource 'vers' (1) { 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 @@ resource 'STR ' (-16397, purgeable) { "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 @@ resource 'STR ' (-16397, purgeable) { 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" }; diff --git a/mac/tclMacPanic.c b/mac/tclMacPanic.c index 0987fa3..d916cab 100644 --- a/mac/tclMacPanic.c +++ b/mac/tclMacPanic.c @@ -11,12 +11,13 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacPanic.c,v 1.5 2001/06/17 03:48:19 dgp Exp $ + * RCS: @(#) $Id: tclMacPanic.c,v 1.6 2001/11/23 01:28:08 das Exp $ */ #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 @@ TclpPanic TCL_VARARGS_DEF(CONST char *, format) part = FindControl(event.where, macWinPtr, &okButtonHandle); - if ((inButton == part) && + if ((kControlButtonPart == part) && (TrackControl(okButtonHandle, event.where, NULL))) { done = true; @@ -152,7 +153,7 @@ TclpPanic TCL_VARARGS_DEF(CONST char *, format) 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 @@ TclpPanic TCL_VARARGS_DEF(CONST char *, format) #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); -} - diff --git a/mac/tclMacPort.h b/mac/tclMacPort.h index 142a570..abc30aa 100644 --- a/mac/tclMacPort.h +++ b/mac/tclMacPort.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacPort.h,v 1.13 2001/08/30 08:53:15 vincentdarley Exp $ + * RCS: @(#) $Id: tclMacPort.h,v 1.14 2001/11/23 01:28:12 das Exp $ */ @@ -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 @@ extern char **environ; #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 @@ typedef int TclpMutex; #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 */ diff --git a/mac/tclMacResource.r b/mac/tclMacResource.r index acfae99..b022078 100644 --- a/mac/tclMacResource.r +++ b/mac/tclMacResource.r @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacResource.r,v 1.4 1999/08/16 00:09:30 jingham Exp $ + * RCS: @(#) $Id: tclMacResource.r,v 1.5 2001/11/23 01:28:26 das Exp $ */ #include <Types.r> @@ -40,20 +40,6 @@ # 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 @@ -69,22 +55,3 @@ resource 'vers' (2) { #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" - }; -}; - diff --git a/mac/tclMacShLib.exp b/mac/tclMacShLib.exp deleted file mode 100644 index 9689ccd..0000000 --- a/mac/tclMacShLib.exp +++ /dev/null @@ -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 diff --git a/mac/tclMacSock.c b/mac/tclMacSock.c index dc1116c..7c71109 100644 --- a/mac/tclMacSock.c +++ b/mac/tclMacSock.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacSock.c,v 1.8 2001/04/04 14:49:35 dgp Exp $ + * RCS: @(#) $Id: tclMacSock.c,v 1.9 2001/11/23 01:28:30 das Exp $ */ #include "tclInt.h" @@ -196,7 +196,7 @@ pascal void NotifyRoutine ( 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. */ diff --git a/mac/tclMacThrd.c b/mac/tclMacThrd.c index e4abb26..3fdafe3 100644 --- a/mac/tclMacThrd.c +++ b/mac/tclMacThrd.c @@ -129,7 +129,7 @@ Tcl_CreateThread(idPtr, proc, clientData, stackSize, flags) #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); diff --git a/mac/tclMacTime.c b/mac/tclMacTime.c index 1fc1231..25e42ca 100644 --- a/mac/tclMacTime.c +++ b/mac/tclMacTime.c @@ -9,11 +9,12 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacTime.c,v 1.5 2001/11/21 02:36:21 hobbs Exp $ + * RCS: @(#) $Id: tclMacTime.c,v 1.6 2001/11/23 01:28:42 das Exp $ */ #include "tclInt.h" #include "tclPort.h" +#include "tclMacInt.h" #include <OSUtils.h> #include <Timer.h> #include <time.h> @@ -33,6 +34,83 @@ TCL_DECLARE_MUTEX(gmtMutex) 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: */ @@ -288,6 +366,40 @@ TclpGetDate( 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 /* *---------------------------------------------------------------------- diff --git a/mac/tclMacUnix.c b/mac/tclMacUnix.c index 483780c..a777254 100644 --- a/mac/tclMacUnix.c +++ b/mac/tclMacUnix.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacUnix.c,v 1.3 1999/04/16 00:47:22 stanton Exp $ + * RCS: @(#) $Id: tclMacUnix.c,v 1.4 2001/11/23 01:28:46 das Exp $ */ #include <Files.h> @@ -206,7 +206,7 @@ Tcl_LsObjCmd( 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; } diff --git a/mac/tclMacUtil.c b/mac/tclMacUtil.c index 51759ef..c505c64 100644 --- a/mac/tclMacUtil.c +++ b/mac/tclMacUtil.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacUtil.c,v 1.4 2000/04/17 01:52:56 jingham Exp $ + * RCS: @(#) $Id: tclMacUtil.c,v 1.5 2001/11/23 01:28:49 das Exp $ */ #include "tcl.h" @@ -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 @@ FSpPathFromLocation( /* *---------------------------------------------------------------------- * - * GetGlobalMouse -- + * GetGlobalMouseTcl -- * * This procedure obtains the current mouse position in global * coordinates. @@ -435,7 +435,7 @@ FSpPathFromLocation( */ void -GetGlobalMouse( +GetGlobalMouseTcl( Point *mouse) /* Mouse position. */ { EventRecord event; @@ -443,3 +443,21 @@ GetGlobalMouse( 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); +} |