head	1.26;
access;
symbols
	core-8-5-9:1.20.2.1
	core-8-5-8:1.20.2.1
	macosx-cocoa-merge:1.25
	macosx-cocoa-premerge:1.25
	macosx-carbon-freeze:1.25
	core-8-5-7:1.20.2.1
	core-8-5-6:1.20.2.1
	core-8-6-b1:1.25
	core-8-6-a3:1.25
	core-8-5-5:1.20.2.1
	core-8-6-a2:1.25
	core-8-5-4:1.20.2.1
	core-8-5-3:1.20.2.1
	core-8-6-a1:1.25
	core-8-4-19:1.8
	core-8-5-branch:1.20.0.2
	core-8-5-2:1.20
	core-8-4-18:1.8
	core-8-5-1:1.19
	core-8-4-17:1.8
	core-8-5-0:1.19
	core-8-5-b3:1.18
	core-8-5-b2:1.18
	core-8-4-16:1.8
	core-8-5-b1:1.18
	core-stablilizer-merge:1.14
	core-stabilizer-branch:1.14.0.2
	core-stabilizer-merge:1.20.2.1
	core-8-4-15:1.8
	core-8-5-a6:1.12
	core-8-5-a5:1.10
	core-8-4-14:1.8
	core-8-5-a4:1.10
	core-8-4-13:1.8
	core-8-4-12:1.8
	core-8-4-11:1.8
	core-8-5-a3:1.9
	core-8-4-10:1.8
	core-8-4-9-branch:1.8.0.6
	core-8-5-a2:1.9
	core-8-4-9:1.8
	core-8-4-8:1.8
	core-8-4-7:1.8
	core-8-5-a1:1.8
	core-8-4-6:1.8
	core-8-4-5:1.8
	mistachkin-dev-branch:1.8.0.4
	core-8-4-4:1.8
	core-8-4-3:1.8
	core-8-4-branch:1.8.0.2
	core-8-4-2:1.8
	core-8-4-1:1.8
	core-8-3-5:1.5.10.1
	core-8-4-0:1.8
	macosx-8-4-merge-2002-08-31-trunk:1.8
	macosx-8-4-premerge-2002-08-31-branch:1.6.2.5
	macosx-8-4-premerge-2002-08-31-trunk:1.7
	macosx-8-4-merge-2002-08-30-branch:1.6.2.4
	macosx-8-4-merge-2002-08-30-trunk:1.7
	macosx-8-4-merge-2002-08-20-branch:1.6.2.4
	macosx-8-4-merge-2002-08-20-trunk:1.7
	core-8-4-b2:1.7
	core-8-4-b1:1.7
	macosx-premerge-6-9-02:1.6.2.3
	core-8-4-a4:1.7
	core-8-3-4:1.5.10.1
	macosx-8-4-branch:1.6.0.2
	macosx-8-4-branchpoint:1.6
	core-8-4-a3:1.6
	core-8-3-3:1.5.10.1
	dgp-privates-into-namespace:1.5.0.14
	tclpro-1-5-0:1.5
	core-8-4-win-speedup:1.5.0.12
	core-8-4-a2:1.5
	tclpro-1-4-1:1.5
	tclpro-1-4-0:1.5
	core-8-3-2:1.5
	ajuba-ajuba2-2-1-base:1.5
	ajuba-ajuba2-2-0:1.5
	core-8-4-a1:1.5
	core-8-3-1-branch:1.5.0.10
	core-8-3-1:1.5
	scriptics-sc-2-0-b5:1.5
	scriptics-sc-2-0-fixed:1.5
	scriptics-sc-2-0-b2:1.5
	scriptics-sc-2-0-b1:1.5
	core-8-3-0:1.5
	core-8-3-b2:1.5
	core-8-3-b1:1.5
	scriptics-sc-1-1:1.5
	scriptics-sc-1-1-b1:1.5
	core-8-2-3:1.5
	scriptics-sc-1-1-branch:1.5.0.8
	scriptics-sc-1-1-base:1.5
	scriptics-sc-1-0:1.5
	scriptics-sc-1-0-branch:1.5.0.6
	scriptics-sc-1-0-base:1.5
	core-8-2-2:1.5
	core-8-2-1:1.5
	scriptics-bc-1-0-b1:1.5
	core-8-2-1-branch:1.5.0.4
	scriptics-tclpro-1-3-0:1.5
	core-8-2-0:1.5
	core-8-2-b3-branch:1.5.0.2
	core-8-2-b3-base:1.5
	scriptics-tclpro-1-3-b4:1.5
	core-8-2-b2:1.5
	scriptics-tclpro-1-3-b3:1.5
	core-8-2-b1:1.5
	scriptics-tclpro-1-3-b2:1.4
	merge-to-mainline-5/21/99:1.4
	scriptics-tclpro-1-3-b2-branch:1.4.0.2
	core-8-1-1:1.4
	scriptics-tclpro-1-3-b1:1.4
	core-8-1-1-base:1.4
	core-8-1-0:1.3.4.1
	merge-to-mainline-4-29-99:1.3.4.1
	merge-to-mainline-4-23-99:1.3.4.1
	core-8-1-branch-old:1.2.0.2
	core-8-0-6-branch:1.2.0.4
	core-8-0-6-base:1.2
	core-8-1-b3:1.2.2.2
	core-8-1-b2:1.2.2.2
	dev-8-1-stubs-branch:1.1.0.4
	dev-stubs-branch:1.1.0.2;
locks; strict;
comment	@ * @;


1.26
date	2010.02.05.22.45.03;	author nijtmans;	state Exp;
branches;
next	1.25;

1.25
date	2008.04.27.22.38.58;	author dkf;	state Exp;
branches;
next	1.24;

1.24
date	2008.04.02.21.31.58;	author das;	state Exp;
branches;
next	1.23;

1.23
date	2008.04.02.04.06.38;	author dgp;	state Exp;
branches;
next	1.22;

1.22
date	2008.04.02.03.55.39;	author dgp;	state Exp;
branches;
next	1.21;

1.21
date	2008.04.01.16.30.54;	author dgp;	state Exp;
branches;
next	1.20;

1.20
date	2008.03.19.17.31.35;	author das;	state Exp;
branches
	1.20.2.1;
next	1.19;

1.19
date	2007.12.13.15.24.16;	author dgp;	state Exp;
branches;
next	1.18;

1.18
date	2007.09.19.10.54.20;	author patthoyts;	state Exp;
branches;
next	1.17;

1.17
date	2007.09.18.16.12.19;	author dgp;	state Exp;
branches;
next	1.16;

1.16
date	2007.09.17.14.58.04;	author dgp;	state Exp;
branches;
next	1.15;

1.15
date	2007.09.07.00.34.53;	author dgp;	state Exp;
branches;
next	1.14;

1.14
date	2007.05.16.18.35.20;	author jenglish;	state Exp;
branches
	1.14.2.1;
next	1.13;

1.13
date	2007.05.03.22.36.11;	author dkf;	state Exp;
branches;
next	1.12;

1.12
date	2007.02.13.00.24.12;	author dkf;	state Exp;
branches;
next	1.11;

1.11
date	2006.10.20.22.39.57;	author nijtmans;	state Exp;
branches;
next	1.10;

1.10
date	2005.11.27.02.36.14;	author das;	state Exp;
branches;
next	1.9;

1.9
date	2004.03.17.18.15.44;	author das;	state Exp;
branches;
next	1.8;

1.8
date	2002.08.31.06.12.27;	author das;	state Exp;
branches;
next	1.7;

1.7
date	2001.11.23.02.07.11;	author das;	state Exp;
branches;
next	1.6;

1.6
date	2001.05.22.00.22.41;	author hobbs;	state Exp;
branches
	1.6.2.1;
next	1.5;

1.5
date	99.05.25.01.31.06;	author stanton;	state Exp;
branches
	1.5.10.1
	1.5.12.1
	1.5.14.1;
next	1.4;

1.4
date	99.04.24.01.50.50;	author stanton;	state Exp;
branches;
next	1.3;

1.3
date	99.04.16.01.51.22;	author stanton;	state Exp;
branches
	1.3.4.1;
next	1.2;

1.2
date	99.03.10.07.04.43;	author stanton;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	99.03.06.23.07.51;	author stanton;	state dead;
branches
	1.1.2.1
	1.1.4.1;
next	;

1.1.2.1
date	99.03.06.23.07.51;	author stanton;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	99.03.07.00.15.45;	author redman;	state Exp;
branches;
next	;

1.1.4.1
date	99.03.09.18.57.12;	author redman;	state Exp;
branches;
next	;

1.2.2.1
date	99.03.10.07.13.46;	author stanton;	state Exp;
branches;
next	1.2.2.2;

1.2.2.2
date	99.03.14.19.26.03;	author stanton;	state Exp;
branches;
next	;

1.3.4.1
date	99.04.24.00.11.36;	author stanton;	state Exp;
branches;
next	;

1.5.10.1
date	2001.04.04.21.39.48;	author hobbs;	state Exp;
branches;
next	;

1.5.12.1
date	2002.04.02.21.00.59;	author hobbs;	state Exp;
branches;
next	;

1.5.14.1
date	2001.07.03.20.01.09;	author dgp;	state Exp;
branches;
next	;

1.6.2.1
date	2001.10.15.09.22.00;	author wolfsuit;	state Exp;
branches;
next	1.6.2.2;

1.6.2.2
date	2001.10.17.07.10.46;	author wolfsuit;	state Exp;
branches;
next	1.6.2.3;

1.6.2.3
date	2002.02.05.02.25.15;	author wolfsuit;	state Exp;
branches;
next	1.6.2.4;

1.6.2.4
date	2002.08.20.20.27.07;	author das;	state Exp;
branches;
next	1.6.2.5;

1.6.2.5
date	2002.08.30.18.18.13;	author das;	state Exp;
branches;
next	;

1.14.2.1
date	2007.09.07.01.25.36;	author dgp;	state Exp;
branches;
next	1.14.2.2;

1.14.2.2
date	2007.09.17.15.22.01;	author dgp;	state Exp;
branches;
next	1.14.2.3;

1.14.2.3
date	2007.09.19.17.28.22;	author dgp;	state Exp;
branches;
next	1.14.2.4;

1.14.2.4
date	2008.03.26.20.09.32;	author dgp;	state Exp;
branches;
next	1.14.2.5;

1.14.2.5
date	2008.06.25.16.46.04;	author dgp;	state Exp;
branches;
next	;

1.20.2.1
date	2008.04.02.04.05.13;	author dgp;	state Exp;
branches;
next	;


desc
@@


1.26
log
@Make more internal tables "const"
tk*Decls.h (regenerated with new genStubs.tcl from Tcl)
@
text
@/*
 * tkStubLib.c --
 *
 *	Stub object that will be statically linked into extensions that wish
 *	to access Tk.
 *
 * Copyright (c) 1998 Paul Duffin.
 * Copyright (c) 1998-1999 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: tkStubLib.c,v 1.25 2008/04/27 22:38:58 dkf Exp $
 */

/*
 * We need to ensure that we use the stub macros so that this file contains no
 * references to any of the stub functions. This will make it possible to
 * build an extension that references Tk_InitStubs but doesn't end up
 * including the rest of the stub functions.
 */

#undef USE_TCL_STUBS
#define USE_TCL_STUBS

#define USE_TK_STUBS

#include "tkInt.h"

#ifdef __WIN32__
#include "tkWinInt.h"
#endif

#ifdef MAC_OSX_TK
#include "tkMacOSXInt.h"
#endif

#if !(defined(__WIN32__) || defined(MAC_OSX_TK))
#include "tkUnixInt.h"
#endif

/* TODO: These ought to come in some other way */
#include "tkPlatDecls.h"
#include "tkIntXlibDecls.h"

MODULE_SCOPE const TkStubs *tkStubsPtr;
MODULE_SCOPE const TkPlatStubs *tkPlatStubsPtr;
MODULE_SCOPE const TkIntStubs *tkIntStubsPtr;
MODULE_SCOPE const TkIntPlatStubs *tkIntPlatStubsPtr;
MODULE_SCOPE const TkIntXlibStubs *tkIntXlibStubsPtr;

const TkStubs *tkStubsPtr = NULL;
const TkPlatStubs *tkPlatStubsPtr = NULL;
const TkIntStubs *tkIntStubsPtr = NULL;
const TkIntPlatStubs *tkIntPlatStubsPtr = NULL;
const TkIntXlibStubs *tkIntXlibStubsPtr = NULL;

/*
 * Use our own isdigit to avoid linking to libc on windows
 */

static int
isDigit(
    const int c)
{
    return (c >= '0' && c <= '9');
}

/*
 *----------------------------------------------------------------------
 *
 * Tk_InitStubs --
 *
 *	Checks that the correct version of Tk is loaded and that it supports
 *	stubs. It then initialises the stub table pointers.
 *
 * Results:
 *	The actual version of Tk that satisfies the request, or NULL to
 *	indicate that an error occurred.
 *
 * Side effects:
 *	Sets the stub table pointers.
 *
 *----------------------------------------------------------------------
 */

MODULE_SCOPE const char *
Tk_InitStubs(
    Tcl_Interp *interp,
    const char *version,
    int exact)
{
    ClientData pkgClientData = NULL;
    const char *actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 0,
	    &pkgClientData);
    const TkStubs *stubsPtr = pkgClientData;

    if (!actualVersion) {
	return NULL;
    }
    if (exact) {
        const char *p = version;
        int count = 0;

        while (*p) {
            count += !isDigit(*p++);
        }
        if (count == 1) {
	    const char *q = actualVersion;

	    p = version;
	    while (*p && (*p == *q)) {
		p++; q++;
	    }
            if (*p) {
		/* Construct error message */
		Tcl_PkgRequireEx(interp, "Tk", version, 1, NULL);
                return NULL;
            }
        } else {
            actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 1, NULL);
            if (actualVersion == NULL) {
                return NULL;
            }
        }
    }

    if (!stubsPtr) {
	Tcl_SetResult(interp,
		"This implementation of Tk does not support stubs",
		TCL_STATIC);
	return NULL;
    }

    tkPlatStubsPtr = stubsPtr->hooks->tkPlatStubs;
    tkIntStubsPtr = stubsPtr->hooks->tkIntStubs;
    tkIntPlatStubsPtr = stubsPtr->hooks->tkIntPlatStubs;
    tkIntXlibStubsPtr = stubsPtr->hooks->tkIntXlibStubs;
    tkStubsPtr = stubsPtr;

    return actualVersion;
}

/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */
@


1.25
log
@Get rid of pre-C89-isms (esp. CONST vs const).
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.24 2008/04/02 21:31:58 das Exp $
d93 4
a96 2
    const char *actualVersion;
    const TkStubs **stubsPtrPtr = &tkStubsPtr;	/* squelch warning */
a97 2
    actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 0,
	    (ClientData *) stubsPtrPtr);
d128 1
a128 1
    if (!tkStubsPtr) {
d135 5
a139 4
    tkPlatStubsPtr = tkStubsPtr->hooks->tkPlatStubs;
    tkIntStubsPtr = tkStubsPtr->hooks->tkIntStubs;
    tkIntPlatStubsPtr = tkStubsPtr->hooks->tkIntPlatStubs;
    tkIntXlibStubsPtr = tkStubsPtr->hooks->tkIntXlibStubs;
@


1.24
log
@	* generic/tkStubLib.c:	make symbols in libtkstub.a MODULE_SCOPE to
				avoid exporting them from libraries that link
				with -ltkstub; constify tk*StubsPtr and stub
				table hook pointers. [Bug 1819422]

	* generic/tkStubLib.c:		undef USE_TCL_STUBS before defining it
	* generic/ttk/ttkStubLib.c:	unconditionally; remove needless #ifdef
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.23 2008/04/02 04:06:38 dgp Exp $
d62 3
a64 1
static int isDigit(const int c)
d87 1
a87 1
MODULE_SCOPE CONST char *
d90 1
a90 1
    CONST char *version,
d93 1
a93 1
    CONST char *actualVersion;
d102 1
a102 1
        CONST char *p = version;
d109 1
a109 1
	    CONST char *q = actualVersion;
@


1.23
log
@typo
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.22 2008/04/02 03:55:39 dgp Exp $
d23 1
d25 1
d46 11
a56 5
TkStubs *tkStubsPtr = NULL;
TkPlatStubs *tkPlatStubsPtr = NULL;
TkIntStubs *tkIntStubsPtr = NULL;
TkIntPlatStubs *tkIntPlatStubsPtr = NULL;
TkIntXlibStubs *tkIntXlibStubsPtr = NULL;
d85 1
a85 1
CONST char *
d92 1
a92 1
    TkStubs **stubsPtrPtr = &tkStubsPtr;	/* squelch warning */
@


1.22
log
@        * generic/tkWindow.c:   Revised package initialization so that
        * unix/Makefile.in:     "tkStubsPtr" is not present in libtk.so, but
        is present only in libtkstub.a.  This tightens up the rules for users
        of the stubs interfaces.  [Tcl Bug 1819422].
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.20 2008/03/19 17:31:35 das Exp $
a22 1
#ifndef USE_TCL_STUBS
a23 4
#endif
#undef USE_TCL_STUB_PROCS

#ifndef USE_TK_STUBS
a24 2
#endif
#undef USE_TK_STUB_PROCS
a76 4
#ifdef Tk_InitStubs
#undef Tk_InitStubs
#endif

d106 2
@


1.21
log
@        * README:               Bump version number to 8.6a0
        * generic/tk.h:
        * library/tk.tcl:
        * macosx/Wish-Common.xcconfig:
        * unix/configure.in:
        * unix/tk.spec:
        * win/README:
        * win/configure.in:
        * win/tcl.m4:

        * unix/configure:       autoconf-2.59
        * win/configure:

        * generic/tkConsole.c:  Relax Tcl_InitStubs() calls so that a Tk 8.6
        * generic/tkMain.c:     might [load] into a Tcl 8.5 interp.
        * generic/tkWindow.c:

        * generic/tkStubLib.c:  Update to compatibility with a libtcl.so
        that contains no "tclStubsPtr" [Tcl Bug 1819422].

        * generic/tkDecls.h:            make genstubs
        * generic/tkIntDecls.h:
        * generic/tkIntPlatDecls.h:
        * generic/tkIntXlibDecls.h:
        * generic/tkPlatDecls.h:
@
text
@d23 5
@


1.20
log
@initialize StubsPtr vars to NULL
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.19 2007/12/13 15:24:16 dgp Exp $
a22 5
#ifndef USE_TCL_STUBS
#define USE_TCL_STUBS
#endif
#undef USE_TCL_STUB_PROCS

@


1.20.2.1
log
@        * generic/tkStubLib.c (Tcl_InitStubs):  Added missing error message.
        * generic/tkWindow.c (Tk_PkgInitStubsCheck):
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.20 2008/03/19 17:31:35 das Exp $
a116 2
		/* Construct error message */
		Tcl_PkgRequireEx(interp, "Tk", version, 1, NULL);
a117 1

@


1.19
log
@merge stable branch onto HEAD
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.14.2.3 2007/09/19 17:28:22 dgp Exp $
d51 5
a55 5
TkStubs *tkStubsPtr;
TkPlatStubs *tkPlatStubsPtr;
TkIntStubs *tkIntStubsPtr;
TkIntPlatStubs *tkIntPlatStubsPtr;
TkIntXlibStubs *tkIntXlibStubsPtr;
@


1.18
log
@Replace isdigit call with an internal implementation to avoid libc linkage on windows
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.17 2007/09/18 16:12:19 dgp Exp $
@


1.17
log
@        * generic/tkStubLib.c:  Remove C library calls from Tk_InitStubs()
        * win/makefile.vc:      so that we don't need the C library linked
        in to libtkStub.
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.16 2007/09/17 14:58:04 dgp Exp $
d58 9
d107 1
a107 1
            count += !isdigit(*p++);
@


1.16
log
@        * generic/tkConsole.c:  Revised callers of Tcl_InitStubs() to account
        * generic/tkMain.c:     for restored compatible support for the call
        * generic/tkWindow.c:   Tcl_InitStubs(interp, TCL_VERSION, 1).  Also
        revised Tcl_PkgRequire() call for Tcl so that, for example, a Tk
        library built against Tcl 8.5.1 headers will not refuse to [load]
        into a Tcl 8.5.0 interpreter.  [Tcl Bug 1578344].

        * generic/tk.h:         Revised Tk_InitStubs() to restore Tk 8.4
        * generic/tkStubLib.c:  source compatibility with callers of
        * generic/tkWindow.c:   Tk_InitStubs(interp, TK_VERSION, 1).
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.15 2007/09/07 00:34:53 dgp Exp $
d101 7
a107 1
            if (0 != strncmp(version, actualVersion, strlen(version))) {
@


1.15
log
@header cleanup
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.14 2007/05/16 18:35:20 jenglish Exp $
d88 1
a88 1
    actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, exact,
d93 18
@


1.14
log
@Change Tk_InitStubs(), tkStubsPtr, and the auxilliary stubs table pointers
back to public visibility.  See [Bug 1716117] for details.

Removed TCL_STORAGE_CLASS monkey business, as it had no effect.
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.13 2007/05/03 22:36:11 dkf Exp $
a32 1
#include "tkPort.h"
d43 5
a47 2
#include "tkDecls.h"
#include "tkIntDecls.h"
a48 1
#include "tkIntPlatDecls.h"
@


1.14.2.1
log
@merge updates from HEAD
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.14 2007/05/16 18:35:20 jenglish Exp $
d33 1
d44 2
a45 5
#if !(defined(__WIN32__) || defined(MAC_OSX_TK))
#include "tkUnixInt.h"
#endif

/* TODO: These ought to come in some other way */
d47 1
@


1.14.2.2
log
@merge updates from HEAD
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.14.2.1 2007/09/07 01:25:36 dgp Exp $
d88 1
a88 1
    actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 0,
a92 18
    if (exact) {
        CONST char *p = version;
        int count = 0;

        while (*p) {
            count += !isdigit(*p++);
        }
        if (count == 1) {
            if (0 != strncmp(version, actualVersion, strlen(version))) {
                return NULL;
            }
        } else {
            actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 1, NULL);
            if (actualVersion == NULL) {
                return NULL;
            }
        }
    }
@


1.14.2.3
log
@merge updates from HEAD
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.14.2.2 2007/09/17 15:22:01 dgp Exp $
a57 9
 * Use our own isdigit to avoid linking to libc on windows
 */

static int isDigit(const int c)
{
    return (c >= '0' && c <= '9');
}

/*
d98 1
a98 1
            count += !isDigit(*p++);
d101 1
a101 7
	    CONST char *q = actualVersion;

	    p = version;
	    while (*p && (*p == *q)) {
		p++; q++;
	    }
            if (*p) {
@


1.14.2.4
log
@merge updates from HEAD
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.14.2.3 2007/09/19 17:28:22 dgp Exp $
d51 5
a55 5
TkStubs *tkStubsPtr = NULL;
TkPlatStubs *tkPlatStubsPtr = NULL;
TkIntStubs *tkIntStubsPtr = NULL;
TkIntPlatStubs *tkIntPlatStubsPtr = NULL;
TkIntXlibStubs *tkIntXlibStubsPtr = NULL;
@


1.14.2.5
log
@merge updates from 8.5 branch
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.14.2.4 2008/03/26 20:09:32 dgp Exp $
a116 2
		/* Construct error message */
		Tcl_PkgRequireEx(interp, "Tk", version, 1, NULL);
a117 1

@


1.13
log
@Another pun warning
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.12 2007/02/13 00:24:12 dkf Exp $
a49 14
/*
 * Ensure that Tk_InitStubs is built as an exported symbol. The other stub
 * symbols should be built as non-exported symbols.
 */

#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT

MODULE_SCOPE TkStubs *tkStubsPtr;
MODULE_SCOPE TkPlatStubs *tkPlatStubsPtr;
MODULE_SCOPE TkIntStubs *tkIntStubsPtr;
MODULE_SCOPE TkIntPlatStubs *tkIntPlatStubsPtr;
MODULE_SCOPE TkIntXlibStubs *tkIntXlibStubsPtr;

d78 1
a78 1
MODULE_SCOPE CONST char *
@


1.12
log
@Fix minor K&R-ism
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.11 2006/10/20 22:39:57 nijtmans Exp $
d99 1
d102 1
a102 1
	    (ClientData *) &tkStubsPtr);
@


1.11
log
@fix signature of TkInitStubs (missing CONST for version parameter)
@
text
@d1 1
a1 1
/* 
d10 2
a11 2
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.10 2005/11/27 02:36:14 das Exp $
a15 1

d17 3
a19 3
 * We need to ensure that we use the stub macros so that this file contains
 * no references to any of the stub functions.  This will make it possible
 * to build an extension that references Tk_InitStubs but doesn't end up
d51 1
a51 1
 * Ensure that Tk_InitStubs is built as an exported symbol.  The other stub
a68 1

d75 2
a76 2
 *	Checks that the correct version of Tk is loaded and that it
 *	supports stubs. It then initialises the stub table pointers.
d79 2
a80 2
 *	The actual version of Tk that satisfies the request, or
 *	NULL to indicate that an error occurred.
d93 4
a96 4
Tk_InitStubs(interp, version, exact)
    Tcl_Interp *interp;
    CONST char *version;
    int exact;
d101 1
a101 1
		(ClientData *) &tkStubsPtr);
d112 1
a112 1
    
d117 1
a117 1
    
d120 8
@


1.10
log
@	* unix/tcl.m4 (Darwin): add 64bit support, check for Tiger copyfile(),
	add CFLAGS to SHLIB_LD to support passing -isysroot in env(CFLAGS) to
	configure (flag can't be present twice, so can't be in both CFLAGS and
	LDFLAGS during configure), don't use -prebind when deploying on 10.4,
	define TCL_IO_TRACK_OS_FOR_DRIVER_WITH_BAD_BLOCKING (rdar://3171542).
	(SC_ENABLE_LANGINFO, SC_TIME_HANDLER): add/fix caching, fix obsolete
	autoconf macros. Sync with tcl/unix/tcl.m4.

	* unix/configure.in: fix obsolete autoconf macros, sync gratuitous
	formatting/ordering differences with tcl/unix/configure.in.

	* unix/Makefile.in: add CFLAGS to wish/tktest link to make executable
	linking the same as during configure (needed to avoid loosing any linker
	relevant flags in CFLAGS, in particular flags that can't be in LDFLAGS).
	Avoid concurrent linking of wish and compiling of tkTestInit.o during
	parallel make, fix dependencies and flags for building tkMacOSXInit.o
	(checkstubs, checkexports): dependency and Darwin fixes
	(dist): add new macosx files.

	* macosx/tkMacOSXEvent.c (TkMacOSXProcessEvent):
	* macosx/tkMacOSXEvent.h:
	* macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent):
	* macosx/tkMacOSXCarbonEvents.c: install standard application event
	handler, add & call functions to start and stop carbon even timer that
	runs the tcl event loop periodically during a nested carbon event loop
	in the toolbox (e.g. during menutracking) to ensure tcl timers etc
	continue to fire, register app event handler for menu tracking and HI
	command carbon events, move menu event handling to new handlers for
	those carbon events, no longer register for/handle appleevent carbon
	event (now dealt with by standard application event handler), event
	debugging code dynamically acquires carbon event debugging functions to
	allow use on Tiger where they are no longer exported from HIToolbox.

	* macosx/tkMacOSXFont.c (TkMacOSXUseAntialiasedText):
	* macosx/tkMacOSXKeyEvent.c (GetKeyboardLayout):
	* macosx/tkMacOSXCarbonEvents.c (TkMacOSXInitCarbonEvents):
	* macosx/tkMacOSXInit.c:
	* macosx/tkMacOSXInt.h: abstract common code to dynamically acquire
	address of a named symbol (from a loaded dynamic library) into new
	function TkMacOSXGetNamedSymbol() and macro TkMacOSXInitNamedSymbol.

	* macosx/tkMacOSXMenu.c (TkpNewMenu):
	* macosx/tkMacOSXMenubutton.c (MenuButtonInitControl):
	* macosx/tkMacOSXMenus.c (TkMacOSXHandleMenuSelect): switch to  modern
	utf8 aware menu manager API, remove obsolete code, add error handling.

	* macosx/tkMacOSXMouseEvent.c: define OSX 10.3 or later only constants
	if necessary to allow compilation on OSX 10.2

	* macosx/tkMacOSXWm.c (UpdateSizeHints): remove code that is never
	executed.

	* xlib/xgc.c (XCreateGC): sync with core-8-4-branch change.

	* generic/tk.h: add/correct location of version numbers in macosx files.

	* generic/tkInt.h: clarify fat compile comment.

	* macosx/Wish.pbproj/default.pbxuser (new file):
	* macosx/Wish.pbproj/jingham.pbxuser:
	* macosx/Wish.pbproj/project.pbxproj:
	* macosx/Wish.xcode/default.pbxuser:
	* macosx/Wish.xcode/project.pbxproj:
	* macosx/Wish.xcodeproj/default.pbxuser (new file):
	* macosx/Wish.xcodeproj/project.pbxproj (new file): new/updated projects
	for Xcode 2.2 on 10.4, Xcode 1.5 on 10.3 & ProjectBuilder on 10.2, with
	native tktest targets and support for universal (fat) compiles.

	* macosx/Tk-Info.plist (removed):
	* macosx/Wish-Info.plist (removed):
	* macosx/buildTkConfig.tcl (removed): remove obsolete build files.

	* macosx/README: clarification/cleanup, document new Xcode projects and
	universal (fat) builds via CFLAGS (i.e. ppc and i386 at the same time).

	* unix/Makefile.in:
	* unix/aclocal.m4:
	* unix/configure.in:
	* macosx/configure.ac (new file): add support for inclusion of
	unix/configure.in by macosx/configure.ac, allows generation of a config
	headers enabled configure script in macosx (required by Xcode projects).

	* macosx/GNUmakefile: rename from Makefile to avoid overwriting by
	configure run in tk/macosx, add support for reusing configure cache,
	build target fixes.

	* generic/tk3d.h:
	* generic/tkButton.h:
	* generic/tkCanvas.c:
	* generic/tkCanvas.h:
	* generic/tkColor.h:
	* generic/tkEntry.h:
	* generic/tkFileFilter.h:
	* generic/tkFont.c:
	* generic/tkFont.h:
	* generic/tkImage.c:
	* generic/tkImgPhoto.c:
	* generic/tkInt.h:
	* generic/tkMenu.c:
	* generic/tkMenu.h:
	* generic/tkMenubutton.h:
	* generic/tkScale.h:
	* generic/tkScrollbar.h:
	* generic/tkSelect.h:
	* generic/tkStubInit.c:
	* generic/tkStubLib.c:
	* generic/tkText.h:
	* generic/tkUndo.h:
	* macosx/tkMacOSXButton.c:
	* macosx/tkMacOSXDebug.c:
	* macosx/tkMacOSXDebug.h:
	* macosx/tkMacOSXDialog.c:
	* macosx/tkMacOSXDraw.c:
	* macosx/tkMacOSXEntry.c:
	* macosx/tkMacOSXFont.c:
	* macosx/tkMacOSXInt.h:
	* macosx/tkMacOSXMenu.c:
	* macosx/tkMacOSXMenubutton.c:
	* macosx/tkMacOSXMouseEvent.c:
	* macosx/tkMacOSXSend.c:
	* macosx/tkMacOSXSubwindows.c:
	* macosx/tkMacOSXWindowEvent.c:
	* macosx/tkMacOSXWm.c:
	* macosx/tkMacOSXXStubs.c:
	* unix/tkUnixButton.c:
	* unix/tkUnixMenu.c:
	* xlib/xgc.c: ensure externally visible symbols not contained in stubs
	table are declared as MODULE_SCOPE (or as static if not used outside of
	own source file), #ifdef out a few Xlib and aqua functions that are
	never called. These changes allow 'make checkstubs' to complete without
	error on Darwin with gcc 4.

	* macosx/tkMacOSXTest.c:
	* macosx/tkMacOSXPort.h:
	* win/tkWinTest.c:
	* generic/tkInt.decls: add functions needed by tktest to internal stubs
	table, correct signature of TkMacOSXHandleMenuSelect, add XSync to aqua
	Xlib stubs.

	* unix/tkUnixSend.c:
	* generic/tkText.c:
	* generic/tkTest.c: #ifdef unix only declarations.
	(TestmetricsCmd): unify win and mac implementation.
	(TestsendCmd): move to tkUnixSend.c to avoid access to global var.
	(TesttextCmd): move to tkText.c to avoid having to put all the internal
	text functions it uses into the stubs table.

	* generic/tkTextDisp.c:
	* macosx/tkMacOSXInit.c:
	* macosx/tkMacOSXKeyEvent.c:
	* macosx/tkMacOSXWindowEvent.c:
	* macosx/tkMacOSXXStubs.c: fix gcc 4 warnings.

	* macosx/tkMacOSXNotify.c:
	* macosx/tkMacOSXScrlbr.c: sync with core-8-4-branch.

	* generic/tkIntDecls.h:
	* generic/tkIntPlatDecls.h:
	* generic/tkIntXlibDecls.h:
	* generic/tkStubInit.c:
	* unix/configure:
	* unix/tkConfig.h.in: regen.
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.9 2004/03/17 18:15:44 das Exp $
d97 1
a97 1
    char *version;
@


1.9
log
@Removed support for Mac OS Classic platform [Patch 918139]
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.8 2002/08/31 06:12:27 das Exp $
d53 1
a53 1
 * functions should be built as non-exported symbols.
d59 6
d94 1
a94 1
CONST char *
@


1.8
log
@	*** macosx-8-4-branch merged into the mainline [tcl patch #602770] ***

	* generic/tk.decls:
	* generic/tkInt.decls: added new "aqua" specific entries to the
	stubs tables. Changed all "unix" entries to "x11" to allow us to
	distinguish and build both "aqua" on MacOSX and "x11" on MacOSX.

	* generic/tk.h: added a #ifnded RESOURCE_INCLUDED so that tk.h can
	be passed to the resource compiler.

	* generic/tkCmds.c (Tk_TkObjCmd): added [tk windowingsystem]
	subcommand: returns "x11" when running on X11, "win32" on Windows,
	"classic" on MacOS9 and "aqua" on MacOSX Aqua (i.e. Carbon)

	* generic/tkFont.c (TkFontGetFirstTextLayout): new private function
	returning the first chunk of a Tk_TextLayout, i.e. until the first
	font change on the first line (or the whole first line if there is
	no such font change).

	* generic/tkMain.c: made Tcl_ThreadDataKey static

	* library/demos/puzzle.tcl: fixed button metrics for aqua

	* tests/cursor.test: check for presence of arrow cursor instead of
	heart cursor

	* xlib/xcolors.c: changed xColors static initialization to more
	standard C

	* macosx/Wish.pbproj/jingham.pbxuser (new):
	* macosx/Wish.pbproj/project.pbxproj (new): project for Apple's
	ProjectBuilder IDE.

	* macosx/Makefile (new): simple makefile for building the project
	from the command line via the ProjectBuilder tool 'pbxbuild'.

	* macosx/tkMacOSXAppInit.c (new): macosx specific AppInit looking
	for a AppMain.tcl file in its bundled Resources/Scripts folder. If
	present, argv[1] is set to that file and the Scripts folder is
	added to the auto_path. This allows tk apps to embed scripts within
	their bundle directory structure.

	* macosx/tkMacOSXInit.c (new): macosx adapted version of
	tkUnixInit.c: we initialize & cache the Carbon native encoding
	(e.g. 'macRoman') and try to find the tk script library files
	inside Tk packaged as a framework.

	* macosx/tkMacOSXNotify.c (new): new macosx specific merged
	Carbon/select-based notifier.

	* macosx/tkMacOSXEvent.c (new):
	* macosx/tkMacOSXEvent.h (new):
	* macosx/tkMacOSXKeyEvent.c (new):
	* macosx/tkMacOSXMouseEvent.c (new):
	* macosx/tkMacOSXWindowEvent.c (new): new macosx specific event
	handling functionality.

	* macosx/tkMacOSX.h (new):
	* macosx/tkMacOSXBitmap.c (new):
	* macosx/tkMacOSXButton.c (new):
	* macosx/tkMacOSXClipboard.c (new):
	* macosx/tkMacOSXColor.c (new):
	* macosx/tkMacOSXConfig.c (new):
	* macosx/tkMacOSXCursor.c (new):
	* macosx/tkMacOSXDefault.h (new):
	* macosx/tkMacOSXDialog.c (new):
	* macosx/tkMacOSXDraw.c (new):
	* macosx/tkMacOSXEmbed.c (new):
	* macosx/tkMacOSXFont.c (new):
	* macosx/tkMacOSXHLEvents.c (new):
	* macosx/tkMacOSXInt.h (new):
	* macosx/tkMacOSXKeyboard.c (new):
	* macosx/tkMacOSXMenu.c (new):
	* macosx/tkMacOSXMenubutton.c (new):
	* macosx/tkMacOSXMenus.c (new):
	* macosx/tkMacOSXPort.h (new):
	* macosx/tkMacOSXRegion.c (new):
	* macosx/tkMacOSXScale.c (new):
	* macosx/tkMacOSXScrlbr.c (new):
	* macosx/tkMacOSXSubwindows.c (new):
	* macosx/tkMacOSXTest.c (new):
	* macosx/tkMacOSXUtil.c (new):
	* macosx/tkMacOSXUtil.h (new):
	* macosx/tkMacOSXWm.c (new):
	* macosx/tkMacOSXWm.h (new):
	* macosx/tkMacOSXXStubs.c (new): macosx ports of classic mac Tk
	implementation in tk/mac.

	* macosx/tkMacOSXSend.c (new): only send to local interp
	implemented currently.

	* macosx/tkMacOSXDebug.h (new):
	* macosx/tkMacOSXDebug.c (new): new macosx specific functions for
	debugging MacOS events, regions, etc.

	* macosx/tkAboutDlg.r (new):
	* macosx/tkMacOSXApplication.r (new):
	* macosx/tkMacOSXCursors.r (new):
	* macosx/tkMacOSXLibrary.r (new):
	* macosx/tkMacOSXMenu.r (new):
	* macosx/tkMacOSXResource.r (new):
	* macosx/tkMacOSXXCursors.r (new):
	* macosx/tclets.r (new): sources for Rez resource compiler.

	* macosx/Wish.icns (new): Wish application icon.

	* generic/tk.h:
	* generic/default.h:
	* generic/tkBind.c:
	* generic/tkCmds.c:
	* generic/tkGrab.c:
	* generic/tkPointer.c:
	* generic/tkPort.h:
	* generic/tkSelect.c:
	* generic/tkStubLib.c:
	* generic/tkTest.c:
	* generic/tkText.c:
	* generic/tkWindow.c:
	* unix/tkUnix3d.c:
	* xlib/xgc.c:
	* xlib/X11/X.h:
	* xlib/X11/Xlib.h:
	* xlib/X11/Xutil.h: added #includes and #ifdefs for macosx

	* library/bgerror.tcl:
	* library/button.tcl:
	* library/console.tcl:
	* library/dialog.tcl:
	* library/entry.tcl:
	* library/listbox.tcl:
	* library/menu.tcl:
	* library/msgbox.tcl:
	* library/scrlbar.tcl:
	* library/spinbox.tcl:
	* library/text.tcl:
	* library/tk.tcl:
	* library/demos/menu.tcl:
	* library/demos/menubu.tcl:
	* library/demos/widget: check [tk windowingsystem] instead of
	and/or in addition to $tcl_platform(platform).

	* generic/tkInt.h:
	* mac/tkMacBitmap.c:
	* mac/tkMacWm.c: added missing CONSTification

	* generic/tkIntDecls.h:
	* generic/tkIntPlatDecls.h:
	* generic/tkIntXlibDecls.h:
	* generic/tkPlatDecls.h:
	* generic/tkStubInit.c: regen
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id$
a40 4
#ifdef MAC_TCL
#include "tkMacInt.h"
#endif

@


1.7
log
@	**  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 #435660)

	see ChangeLog for details
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.6 2001/05/22 00:22:41 hobbs Exp $
d43 4
@


1.6
log
@	* doc/TkInitStubs.3:
	* generic/tk.h:
	* generic/tkStubLib.c: CONST'ified Tk_InitStubs to match CONST
	changes to Tcl_PkgRequireEx.
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.5 1999/05/25 01:31:06 stanton Exp $
a15 10
/*
 * Because of problems with pre-compiled headers on the Mac, we need to
 * do these includes before we add the stubs defines.  This a hack.
 */

#ifdef MAC_TCL
#include "tkMacInt.h"
#include "tkInt.h"
#include "tkPort.h"
#endif /* MAC_TCL */
a33 2
#ifndef MAC_TCL

d41 3
a43 1
#endif /* !MAC_TCL */
@


1.6.2.1
log
@First checkin of support for Tk on Mac OS X.
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id$
d21 1
a21 1
#if defined(MAC_TCL)
a22 5
#else defined(MAC_OSX_TCL)
#include "tkMacOSXInt.h"
#endif

#if defined(MAC_TCL) || defined(MAC_OSX_TCL)
d44 1
a44 1
#if !defined(MAC_TCL) && !defined(MAC_OSX_TCL)
@


1.6.2.2
log
@Rest of the updated files for the MAC_OSX_TCL -> MAC_OSX_TK conversion.
@
text
@d23 1
a23 1
#else defined(MAC_OSX_TK)
d27 1
a27 1
#if defined(MAC_TCL) || defined(MAC_OSX_TK)
d49 1
a49 1
#if !defined(MAC_TCL) && !defined(MAC_OSX_TK)
@


1.6.2.3
log
@Merge with current TOT
Added support for the wm stackorder command
Fixed crash when selecting Menu items in the Application menu that we didn't
put there.
Added first bits of the use of CG for low-level drawing.  The line-drawing works,
the rest doesn't yet.  You have to set the file static useCGDrawing to 1 and
rebuild to activate this code.
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.6.2.2 2001/10/17 07:10:46 wolfsuit Exp $
d21 3
a23 1
#if defined(MAC_OSX_TK)
d25 1
d27 1
d49 2
d58 1
a58 3
#ifdef MAC_TCL
#include "tkMacInt.h"
#endif
@


1.6.2.4
log
@merged with trunk at tag macosx-8-4-merge-2002-08-20-trunk
@
text
@d13 1
a13 9
 * RCS: @@(#) $Id$
 */


/*
 * We need to ensure that we use the stub macros so that this file contains
 * no references to any of the stub functions.  This will make it possible
 * to build an extension that references Tk_InitStubs but doesn't end up
 * including the rest of the stub functions.
d26 8
a33 1
#endif /* MAC_OSX_TK */
@


1.6.2.5
log
@various project cleanups & enhancements
added macosx/Makefile to facilitate building from cli
added [tk windowingsystem] and removed $::tcl_plaform(windowingsystem)
changed all runtime library references to the above
removed duplicate entries in tk.decls & tkInt.decls
CONSTification and other small changes in macosx/ to remove compiler warnings
@
text
@d24 12
a54 4
#endif

#ifdef MAC_OSX_TK
#include "tkMacOSXInt.h"
@


1.5
log
@* generic/tkStubLib.c:
* generic/tkStubInit.c:
* generic/tkIntXlibDecls.h:
* generic/tkIntPlatDecls.h:
* generic/tkIntDecls.h:
* generic/tkInt.decls:
* generic/tkConsole.c: Various changes to try to get the Mac
builds working.
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id$
d98 1
a98 1
char *
d104 1
a104 1
    char *actualVersion;
@


1.5.12.1
log
@sync with head
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.7 2001/11/23 02:07:11 das Exp $
d16 10
d44 2
d53 1
a53 3
#ifdef MAC_TCL
#include "tkMacInt.h"
#endif
d98 1
a98 1
CONST char *
d104 1
a104 1
    CONST char *actualVersion;
@


1.5.14.1
log
@        * Merged in updates from HEAD branch.
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.6 2001/05/22 00:22:41 hobbs Exp $
d98 1
a98 1
CONST char *
d104 1
a104 1
    CONST char *actualVersion;
@


1.5.10.1
log
@	* generic/tkInt.decls: removed superfluous declarations.
	* generic/tkIntDecls.h:
	* generic/tkIntPlatDecls.h:
	* generic/tkMain.c: include unistd.h for mac.
	* generic/tkPointer.c: include tkMacInt.h for mac.
	* generic/tkStubInit.c:
	* generic/tkStubLib.c:
	* mac/MW_TkHeader.pch:
	* mac/MW_TkOldImgHeader.h:
	* mac/MW_TkTestHeader.pch:
	* mac/tclets.r:
	* mac/tkMac.h:
	* mac/tkMacAppearanceStubs.c:
	* mac/tkMacApplication.r:
	* mac/tkMacButton.c:
	* mac/tkMacDialog.c: support for -filetypes
	* mac/tkMacFont.c:
	* mac/tkMacInt.h:
	* mac/tkMacLibrary.r:
	* mac/tkMacMDEF.r:
	* mac/tkMacMenu.c:
	* mac/tkMacMenus.c:
	* mac/tkMacPort.h:
	* mac/tkMacResource.r:
	* mac/tkMacScrlbr.c: improved scrollbar code
	* mac/tkMacWindowMgr.c: added control of floating windows
	* mac/tkMacWm.c: improved use of precompiled headers, better
	support for Appearance Manager, change copyrights, resource files,
	use DLLIMPORT/DLLEXPORT, comment corrections.
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.5 1999/05/25 01:31:06 stanton Exp $
d16 10
d44 2
d53 1
a53 3
#ifdef MAC_TCL
#include "tkMacInt.h"
#endif
@


1.4
log
@merged 8.1.0 changes into mainline
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.3 1999/04/16 01:51:22 stanton Exp $
d17 11
a33 1

d44 2
d52 2
a53 3
#ifdef MAC_TCL
#include "tkMacInt.h"
#endif
d93 4
@


1.3
log
@* Merged 8.1 branch into the main trunk
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id$
d34 1
a35 1
#include "tkPort.h"
d39 3
@


1.3.4.1
log
@* generic/tkStubLib.c: Reordered declarations to avoid
circularities and forward references.
@
text
@d34 1
a35 1
#include "tkInt.h"
a38 3
#endif
#ifdef MAC_TCL
#include "tkMacInt.h"
@


1.2
log
@integrated stubs into 8.0 main branch
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.1.2.2 1999/03/07 00:15:45 redman Exp $
d23 5
@


1.2.2.1
log
@integrated stubs from development branch
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.1.4.1 1999/03/09 18:57:12 redman Exp $
@


1.2.2.2
log
@* unix/configure.in: Added missing stub related definitions.

* unix/Makefile.in: Install tkDecls.h in addition to tk.h.

* generic/tkStubLib.c: Added flags to ensure we are using Tcl
stub macros.
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.2.2.1 1999/03/10 07:13:46 stanton Exp $
a22 5

#ifndef USE_TCL_STUBS
#define USE_TCL_STUBS
#endif
#undef USE_TCL_STUB_PROCS
@


1.1
log
@file tkStubLib.c was initially added on branch dev-stubs-branch.
@
text
@d1 102
@


1.1.4.1
log
@Added files new to 8.1, from 8.0.6 dev-stubs-branch.
@
text
@a0 102
/* 
 * tkStubLib.c --
 *
 *	Stub object that will be statically linked into extensions that wish
 *	to access Tk.
 *
 * Copyright (c) 1998 Paul Duffin.
 * Copyright (c) 1998-1999 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: tkStubLib.c,v 1.1.2.2 1999/03/07 00:15:45 redman Exp $
 */

/*
 * We need to ensure that we use the stub macros so that this file contains
 * no references to any of the stub functions.  This will make it possible
 * to build an extension that references Tk_InitStubs but doesn't end up
 * including the rest of the stub functions.
 */


#ifndef USE_TK_STUBS
#define USE_TK_STUBS
#endif
#undef USE_TK_STUB_PROCS

#include "tkInt.h"
#include "tkPort.h"

#ifdef __WIN32__
#include "tkWinInt.h"
#endif

#include "tkDecls.h"
#include "tkIntDecls.h"
#include "tkPlatDecls.h"
#include "tkIntPlatDecls.h"
#include "tkIntXlibDecls.h"

/*
 * Ensure that Tk_InitStubs is built as an exported symbol.  The other stub
 * functions should be built as non-exported symbols.
 */

#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT

TkStubs *tkStubsPtr;
TkPlatStubs *tkPlatStubsPtr;
TkIntStubs *tkIntStubsPtr;
TkIntPlatStubs *tkIntPlatStubsPtr;
TkIntXlibStubs *tkIntXlibStubsPtr;


/*
 *----------------------------------------------------------------------
 *
 * Tk_InitStubs --
 *
 *	Checks that the correct version of Tk is loaded and that it
 *	supports stubs. It then initialises the stub table pointers.
 *
 * Results:
 *	The actual version of Tk that satisfies the request, or
 *	NULL to indicate that an error occurred.
 *
 * Side effects:
 *	Sets the stub table pointers.
 *
 *----------------------------------------------------------------------
 */

char *
Tk_InitStubs(interp, version, exact)
    Tcl_Interp *interp;
    char *version;
    int exact;
{
    char *actualVersion;

    actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, exact,
		(ClientData *) &tkStubsPtr);
    if (!actualVersion) {
	return NULL;
    }

    if (!tkStubsPtr) {
	Tcl_SetResult(interp,
		"This implementation of Tk does not support stubs",
		TCL_STATIC);
	return NULL;
    }
    
    tkPlatStubsPtr = tkStubsPtr->hooks->tkPlatStubs;
    tkIntStubsPtr = tkStubsPtr->hooks->tkIntStubs;
    tkIntPlatStubsPtr = tkStubsPtr->hooks->tkIntPlatStubs;
    tkIntXlibStubsPtr = tkStubsPtr->hooks->tkIntXlibStubs;
    
    return actualVersion;
}
@


1.1.2.1
log
@Added stub patches
@
text
@a0 90
/* 
 * tkStubLib.c --
 *
 *	Stub object that will be statically linked into extensions that wish
 *	to access Tk.
 *
 * Copyright (c) 1998 Paul Duffin.
 * Copyright (c) 1998-1999 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$
 */

/*
 * We need to ensure that we use the stub macros so that this file contains
 * no references to any of the stub functions.  This will make it possible
 * to build an extension that references Tk_InitStubs but doesn't end up
 * including the rest of the stub functions.
 */

#ifndef USE_TK_STUBS
#define USE_TK_STUBS
#endif
#undef USE_TK_STUB_PROCS

#ifndef USE_TCL_STUBS
#define USE_TCL_STUBS
#endif

/*
 * Ensure that Tk_InitStubs is built as an exported symbol.  The other stub
 * functions should be built as non-exported symbols.
 */

#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT

TkStubs *tkStubsPtr;
TkPlatStubs *tkPlatStubsPtr;
TkIntStubs *tkIntStubsPtr;
TkIntPlatStubs *tkIntPlatStubsPtr;


/*
 *----------------------------------------------------------------------
 *
 * Tk_InitStubs --
 *
 *	Checks that the correct version of Tk is loaded and that it
 *	supports stubs. It then initialises the stub table pointers.
 *
 * Results:
 *	The actual version of Tk that satisfies the request, or
 *	NULL to indicate that an error occurred.
 *
 * Side effects:
 *	Sets the stub table pointers.
 *
 *----------------------------------------------------------------------
 */

char *
Tk_InitStubs(interp, version, exact)
    Tcl_Interp *interp;
    char *version;
    int exact;
{
    char *actualVersion;

    actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, exact,
		(ClientData *) &tkStubsPtr);
    if (!actualVersion) {
	return NULL;
    }

    if (!tkStubsPtr) {
	Tcl_SetResult(interp,
		"This implementation of Tk does not support stubs",
		TCL_STATIC);
	return NULL;
    }
    
    tkPlatStubsPtr = tkStubsPtr->hooks->tkPlatStubs;
    tkIntStubsPtr = tkStubsPtr->hooks->tkIntStubs;
    tkIntPlatStubsPtr = tkStubsPtr->hooks->tkIntPlatStubs;
    
    return actualVersion;
}
@


1.1.2.2
log
@Stubs changes, now wish works on Windows.
@
text
@d13 1
a13 1
 * RCS: @@(#) $Id: tkStubLib.c,v 1.1.2.1 1999/03/06 23:07:51 stanton Exp $
a22 1

d28 2
a29 5
#include "tkInt.h"
#include "tkPort.h"

#ifdef __WIN32__
#include "tkWinInt.h"
a31 6
#include "tkDecls.h"
#include "tkIntDecls.h"
#include "tkPlatDecls.h"
#include "tkIntPlatDecls.h"
#include "tkIntXlibDecls.h"

a43 1
TkIntXlibStubs *tkIntXlibStubsPtr;
a87 1
    tkIntXlibStubsPtr = tkStubsPtr->hooks->tkIntXlibStubs;
@


