diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclInt.decls | 13 | ||||
-rw-r--r-- | generic/tclIntDecls.h | 12 | ||||
-rw-r--r-- | generic/tclIntPlatDecls.h | 15 | ||||
-rw-r--r-- | generic/tclStubInit.c | 5 | ||||
-rw-r--r-- | generic/tclTest.c | 14 | ||||
-rw-r--r-- | generic/tclUtil.c | 25 |
6 files changed, 54 insertions, 30 deletions
diff --git a/generic/tclInt.decls b/generic/tclInt.decls index c457741..f4f29c7 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -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: tclInt.decls,v 1.88 2005/05/10 18:34:41 kennykb Exp $ +# RCS: @(#) $Id: tclInt.decls,v 1.89 2005/05/14 20:46:44 das Exp $ library tcl @@ -891,6 +891,10 @@ declare 222 generic { declare 223 generic { int TclBN_mp_read_radix(mp_int *a, const char *str, int radix) } +# for use in tclTest.c +declare 224 generic { + TclPlatformType *TclGetPlatform(void) +} ############################################################################## @@ -993,9 +997,10 @@ declare 23 win { declare 24 win { char *TclWinNoBackslash(char *path) } -declare 25 win { - TclPlatformType *TclWinGetPlatform(void) -} +# replaced by generic TclGetPlatform +#declare 25 win { +# TclPlatformType *TclWinGetPlatform(void) +#} declare 26 win { void TclWinSetInterfaces(int wide) } diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index 7364d0f..3e5827e 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.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: tclIntDecls.h,v 1.79 2005/05/10 18:34:42 kennykb Exp $ + * RCS: @(#) $Id: tclIntDecls.h,v 1.80 2005/05/14 20:46:45 das Exp $ */ #ifndef _TCLINTDECLS @@ -1156,6 +1156,11 @@ EXTERN int TclBN_mp_init _ANSI_ARGS_((mp_int * a)); EXTERN int TclBN_mp_read_radix _ANSI_ARGS_((mp_int * a, const char * str, int radix)); #endif +#ifndef TclGetPlatform_TCL_DECLARED +#define TclGetPlatform_TCL_DECLARED +/* 224 */ +EXTERN TclPlatformType * TclGetPlatform _ANSI_ARGS_((void)); +#endif typedef struct TclIntStubs { int magic; @@ -1400,6 +1405,7 @@ typedef struct TclIntStubs { void (*tclBN_mp_clear) _ANSI_ARGS_((mp_int * a)); /* 221 */ int (*tclBN_mp_init) _ANSI_ARGS_((mp_int * a)); /* 222 */ int (*tclBN_mp_read_radix) _ANSI_ARGS_((mp_int * a, const char * str, int radix)); /* 223 */ + TclPlatformType * (*tclGetPlatform) _ANSI_ARGS_((void)); /* 224 */ } TclIntStubs; #ifdef __cplusplus @@ -2174,6 +2180,10 @@ extern TclIntStubs *tclIntStubsPtr; #define TclBN_mp_read_radix \ (tclIntStubsPtr->tclBN_mp_read_radix) /* 223 */ #endif +#ifndef TclGetPlatform +#define TclGetPlatform \ + (tclIntStubsPtr->tclGetPlatform) /* 224 */ +#endif #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */ diff --git a/generic/tclIntPlatDecls.h b/generic/tclIntPlatDecls.h index a3c900c..e9c1184 100644 --- a/generic/tclIntPlatDecls.h +++ b/generic/tclIntPlatDecls.h @@ -9,7 +9,7 @@ * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tclIntPlatDecls.h,v 1.26 2004/11/03 19:13:40 davygrvy Exp $ + * RCS: @(#) $Id: tclIntPlatDecls.h,v 1.27 2005/05/14 20:46:45 das Exp $ */ #ifndef _TCLINTPLATDECLS @@ -249,11 +249,7 @@ EXTERN char * TclpGetTZName _ANSI_ARGS_((int isdst)); /* 24 */ EXTERN char * TclWinNoBackslash _ANSI_ARGS_((char * path)); #endif -#ifndef TclWinGetPlatform_TCL_DECLARED -#define TclWinGetPlatform_TCL_DECLARED -/* 25 */ -EXTERN TclPlatformType * TclWinGetPlatform _ANSI_ARGS_((void)); -#endif +/* Slot 25 is reserved */ #ifndef TclWinSetInterfaces_TCL_DECLARED #define TclWinSetInterfaces_TCL_DECLARED /* 26 */ @@ -348,7 +344,7 @@ typedef struct TclIntPlatStubs { TclFile (*tclpCreateTempFile) _ANSI_ARGS_((CONST char * contents)); /* 22 */ char * (*tclpGetTZName) _ANSI_ARGS_((int isdst)); /* 23 */ char * (*tclWinNoBackslash) _ANSI_ARGS_((char * path)); /* 24 */ - TclPlatformType * (*tclWinGetPlatform) _ANSI_ARGS_((void)); /* 25 */ + void *reserved25; void (*tclWinSetInterfaces) _ANSI_ARGS_((int wide)); /* 26 */ void (*tclWinFlushDirtyChannels) _ANSI_ARGS_((void)); /* 27 */ void (*tclWinResetInterfaces) _ANSI_ARGS_((void)); /* 28 */ @@ -520,10 +516,7 @@ extern TclIntPlatStubs *tclIntPlatStubsPtr; #define TclWinNoBackslash \ (tclIntPlatStubsPtr->tclWinNoBackslash) /* 24 */ #endif -#ifndef TclWinGetPlatform -#define TclWinGetPlatform \ - (tclIntPlatStubsPtr->tclWinGetPlatform) /* 25 */ -#endif +/* Slot 25 is reserved */ #ifndef TclWinSetInterfaces #define TclWinSetInterfaces \ (tclIntPlatStubsPtr->tclWinSetInterfaces) /* 26 */ diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 8240c9c..ebe7d40 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.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: tclStubInit.c,v 1.116 2005/05/10 18:34:49 kennykb Exp $ + * RCS: @(#) $Id: tclStubInit.c,v 1.117 2005/05/14 20:46:45 das Exp $ */ #include "tclInt.h" @@ -308,6 +308,7 @@ TclIntStubs tclIntStubs = { TclBN_mp_clear, /* 221 */ TclBN_mp_init, /* 222 */ TclBN_mp_read_radix, /* 223 */ + TclGetPlatform, /* 224 */ }; TclIntPlatStubs tclIntPlatStubs = { @@ -356,7 +357,7 @@ TclIntPlatStubs tclIntPlatStubs = { TclpCreateTempFile, /* 22 */ TclpGetTZName, /* 23 */ TclWinNoBackslash, /* 24 */ - TclWinGetPlatform, /* 25 */ + NULL, /* 25 */ TclWinSetInterfaces, /* 26 */ TclWinFlushDirtyChannels, /* 27 */ TclWinResetInterfaces, /* 28 */ diff --git a/generic/tclTest.c b/generic/tclTest.c index 68b8963..22859a7 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.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: tclTest.c,v 1.89 2005/05/10 18:34:50 kennykb Exp $ + * RCS: @(#) $Id: tclTest.c,v 1.90 2005/05/14 20:46:46 das Exp $ */ #define TCL_TEST @@ -2457,11 +2457,7 @@ TestgetplatformCmd(clientData, interp, argc, argv) static CONST char *platformStrings[] = { "unix", "mac", "windows" }; TclPlatformType *platform; -#ifdef __WIN32__ - platform = TclWinGetPlatform(); -#else - platform = &tclPlatform; -#endif + platform = TclGetPlatform(); if (argc != 1) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], @@ -3697,11 +3693,7 @@ TestsetplatformCmd(clientData, interp, argc, argv) size_t length; TclPlatformType *platform; -#ifdef __WIN32__ - platform = TclWinGetPlatform(); -#else - platform = &tclPlatform; -#endif + platform = TclGetPlatform(); if (argc != 2) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 278380d..2c787c2 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -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: tclUtil.c,v 1.59 2005/05/10 18:34:52 kennykb Exp $ + * RCS: @(#) $Id: tclUtil.c,v 1.60 2005/05/14 20:46:46 das Exp $ */ #include "tclInt.h" @@ -2993,3 +2993,26 @@ TclpGetTime(timePtr) { Tcl_GetTime(timePtr); } + +/* + *---------------------------------------------------------------------- + * + * TclGetPlatform -- + * + * This is a kludge that allows the test library to get access + * the internal tclPlatform variable. + * + * Results: + * Returns a pointer to the tclPlatform variable. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +TclPlatformType * +TclGetPlatform() +{ + return &tclPlatform; +} |