Tcl Source Code

Artifact [62c581b439]
Login

Artifact 62c581b439d48adeb94d56e628f6e48689483bb1:

Attachment "crazyALT2.c" to ticket [1055668fff] added by davygrvy 2004-10-29 00:06:50.
#include <windows.h>
#define USE_TCL_STUBS
#include "tcl.h"


typedef int (*tcl_Main_t)(int argc, char *argv[], Tcl_AppInitProc *aip);
tcl_Main_t tcl_Main;

void
LoadTcl (char *lib)
{
    HMODULE hTcl;
    typedef Tcl_Interp *(*tcl_CI_t)(void);
    tcl_CI_t tcl_CI;
    Tcl_Interp *interp;

    hTcl = LoadLibrary(lib);
    tcl_CI = (tcl_CI_t) GetProcAddress(hTcl, "Tcl_CreateInterp");
    tcl_Main = (tcl_Main_t) GetProcAddress(hTcl, "Tcl_Main");
    interp = tcl_CI();
    Tcl_InitStubs(interp, "8.1", 0);
    Tcl_DeleteInterp(interp);
}

int
Tcl_AppInit (Tcl_Interp *interp)
{
    if (Tcl_Init(interp) == TCL_ERROR) {
	return TCL_ERROR;
    }
    return TCL_OK;
}

int
main (int argc, char *argv[])
{
    LoadTcl(argv[1]);
    argv[1] = argv[0];
    tcl_Main(argc-1, &argv[1], Tcl_AppInit);
    return 0;  // not reached
}