Fossil SCM

fossil-scm / compat / tcl-8.6 / generic / tclStubLib.c
Blame History Raw 74 lines
1
/*
2
* tclStubLib.c --
3
*
4
* Stub object that will be statically linked into extensions that want
5
* to access Tcl.
6
*
7
* Copyright (c) 1998-1999 by Scriptics Corporation.
8
* Copyright (c) 1998 Paul Duffin.
9
*
10
* See the file "license.terms" for information on usage and redistribution of
11
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
12
*/
13
14
#include "tcl.h"
15
#include <assert.h>
16
17
const TclStubs *tclStubsPtr = NULL;
18
19
20
/*
21
*----------------------------------------------------------------------
22
*
23
* Tcl_InitStubs --
24
*
25
* Tries to initialise the stub table pointers and ensures that the
26
* correct version of Tcl is loaded.
27
*
28
* Results:
29
* The actual version of Tcl that satisfies the request, or NULL to
30
* indicate that an error occurred.
31
*
32
* FOSSIL MODIFICATION!!!!!!!!!!!!!!!
33
*
34
* Because Fossil only uses public functions, and the "exact" parameter
35
* is always 0, everything not needed is stripped off.
36
*
37
* FOSSIL MODIFICATION!!!!!!!!!!!!!!!
38
*
39
* Side effects:
40
* Sets the stub table pointers.
41
*
42
*----------------------------------------------------------------------
43
*/
44
#undef Tcl_InitStubs
45
46
typedef struct {
47
char *unused1;
48
Tcl_FreeProc *unused2;
49
int unused3;
50
const TclStubs *stubTable;
51
} Interp;
52
53
const char *
54
Tcl_InitStubs(
55
Tcl_Interp *interp,
56
const char *version,
57
int exact)
58
{
59
tclStubsPtr = ((Interp *) interp)->stubTable;
60
61
assert(tclStubsPtr && (tclStubsPtr->magic == TCL_STUB_MAGIC));
62
63
return Tcl_PkgRequireEx(interp, "Tcl", version, exact,
64
(void *)&tclStubsPtr);
65
}
66
67
/*
68
* Local Variables:
69
* mode: c
70
* c-basic-offset: 4
71
* fill-column: 78
72
* End:
73
*/
74

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button