Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
| Artifact ID: | 55815f519e7554ddf40032b25f2a4a4f50ac8624 |
|---|---|
| Page Name: | Embedding Support |
| Date: | 2014-09-03 10:39:26 |
| Original User: | hypnotoad |
| Parent: | 6742af2ff60495b95c749b0210e2b2d009f5579f (diff) |
| Next | ed5e2660f48662dc8a08b42b9d167b40268d795f |
Source Files
Public Interface
- Tcl_SetStartupScript
- Tcl_GetStartupScript
- Tcl_SourceRCFile
- Tcl_Main
- Tcl_MainEx
- Tcl_SetMainLoop
- Tcl_SetPanicProc
- Tcl_PanicVA
- Tcl_Panic
Private Interface
- TclFullFinalizationRequested
- TclGetMainLoop
Directly Depends On Public Interface
- Threads
- Object System and Fundamental Object Types
- Variable Commands and Interfaces
- Pathname Management
- Filesystem Access
- Channel System
- list Object Type
- Preservation
- Parsing and Evaluation
- interp
- Event Loops
- dict Object Type
- Linked C Variables
- history
- unistd.h
Directly Depends On Private Interface of
- Initialization, Library, Autoloader
- Pathname Management
- Object System and Fundamental Object Types
- Parsing and Evaluation
- Allocation
- Environment Variables
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
# Build an empty zipfile and concat it to the executable
touch .empty
zip null.zip .empty
cat null.zip >> mynewkit
#
echo "puts {hello world}" > main.tcl
# The -A argument tells zip to offset itself from the executable
zip -A mynewkit main.tcl
./mynewkit
hello world
(Program exit)
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.