Update of ”Embedding Support”
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: 0adff0d77e8a55fb5cbbae9ad616ed2ac9892e7e
Page Name:Embedding Support
Date: 2014-09-02 21:38:40
Original User: hypnotoad
Parent: 93366cc3392d2a73286ed428c0cc2c6774274be7 (diff)
Next ff2a7278e03e044563169e1f5d4345201b73b2b5
Content

Source Files

Public Interface

Private Interface

Directly Depends On Public Interface

Directly Depends On Private Interface of

The core_zip_vfs Patch

The core_zip_vfs branch adds the ability to mount a zip archive concatenated to the current executable as a virtual file system, capable of hosting both env(TCL_LIBRARY) and kick off a bootloader (if a file called main.tcl is present).

This patch: * Adds tclZipVfs.c * Modifies tclAppInit.c * Modifies tclAppInit.c

To build a self-contained executable:

cp tclsh mynewkit
zip mynewkit.zip main.tcl
cat mynewkit.zip >> mynewkit
./mynewkit
(Launches using the code embedded in main.tcl)

Discussion

This has been considered a single module, but tclPanic.c is essentially a self contained bit without dependencies, while tclMain.c depends on nearly everything. Most other parts of Tcl that claim a dependence on this module are really just callers of Tcl_Panic.

One wrinkle is the routine tclWinDebugPanic which is in multiple places, tclWinError.c and tclWinFile.c. There's also a great deal of #ifdef in tclPanic.c. A restructuring into a generic caller of TclpPanic might be a path to increasing simplicity and conventionality.

The routine TclGetMainLoop is another to note. It appears in no header file. It gets declared with MODULE_SCOPE but there doesn't appear to be any reason it could not be a static function.

The routine TclFullFinalizationRequested probably should move into Event Loops.