14
#define EXPORT_FUNC __declspec(dllexport)
16
EXPORT_FUNC int PKGINIT_Init( Tcl_Interp *interp ) ;
18
#include "wrapfort_lib.c"
20
static Tcl_Interp *saved_interp; /* TODO: allow several interpreters! */
29
TclStubs *tclStubsPtr;
30
TclPlatStubs *tclPlatStubsPtr;
31
struct TclIntStubs *tclIntStubsPtr;
32
struct TclIntPlatStubs *tclIntPlatStubsPtr;
35
MyInitTclStubs (Tcl_Interp *ip)
39
Tcl_FreeProc *freeProc;
44
HeadOfInterp *hoi = (HeadOfInterp*) ip;
46
if (hoi->stubTable == NULL || hoi->stubTable->magic != TCL_STUB_MAGIC) {
47
ip->result = "This extension requires stubs-support.";
48
ip->freeProc = TCL_STATIC;
52
tclStubsPtr = hoi->stubTable;
54
if (Tcl_PkgRequire(ip, "Tcl", "8.1", 0) == NULL) {
59
if (tclStubsPtr->hooks != NULL) {
60
tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs;
61
tclIntStubsPtr = tclStubsPtr->hooks->tclIntStubs;
62
tclIntPlatStubsPtr = tclStubsPtr->hooks->tclIntPlatStubs;
69
int PKGINIT_Init( Tcl_Interp *interp )
74
/* Register the Fortran logical values
77
ftcl_init_log( &ftcl_true, &ftcl_false ) ;
80
/* Initialise the stubs
84
if (Tcl_InitStubs(interp, "8.0", 0) == NULL) {
88
if (MyInitTclStubs(interp) == 0) {
95
/* Inquire about the package's version
97
if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL)
99
if (TCL_VERSION[0] == '7')
101
if (Tcl_PkgRequire(interp, "Tcl", "8.0", 0) == NULL)
108
if (Tcl_PkgProvide(interp, "PKGNAME", "1.0") != TCL_OK)
113
/* Register the package's commands
122
/* End of file ftempl.c */