Artifact b7775c704855ff92c368b992be6ed5f138da8e23d30b271d5caa3ebe1ef06830:
- File doc/markdown/Init.md — part of check-in [61e103c3e2] at 2025-07-20 07:06:12 on branch tip-700 — - added 55 section 3 manual pages in initial markdown versions - unified bold font for #include line in TclZlib.3 - removed unnecessary blank line in AddErrInfo.3, GetHostName.3 - unwrapped lines in Synopsis section of CrtAlias.3, FileSystem.3, NRE.3, Method.3 to avoid line breaks - removed prefixed dash from Markdown 'version' attribute - more documentation (user: Torsten, size: 1484) [annotate] [blame] [check-ins using]
CommandName: Tcl_Init ManualSection: 3 Version: 9.0 TclPart: Tcl TclDescription: Tcl Library Procedures Links:
- Tcl_AppInit
- Tcl_Main Keywords:
- application
- initialization
- interpreter Copyright:
- Copyright (c) 1998-2000 Scriptics Corporation. ---
Name
Tcl_Init - find and source initialization script
Synopsis
::: {.synopsis} ::: #include <tcl.h> [int]{.ret} [Tcl_Init]{.ccmd}[interp]{.cargs} [const char *]{.ret} [Tcl_SetPreInitScript]{.ccmd}[scriptPtr]{.cargs} :::
Arguments
.AP Tcl_Interp *interp in Interpreter to initialize. .AP "const char" *scriptPtr in Address of the initialization script.
Description
Tcl_Init is a helper procedure that finds and sources the init.tcl script, which should exist somewhere on the Tcl library path.
Tcl_Init is typically called from Tcl_AppInit procedures.
Tcl_SetPreInitScript registers the pre-initialization script and returns the former (now replaced) script pointer. A value of NULL may be passed to not register any script. The pre-initialization script is executed by Tcl_Init before accessing the file system. The purpose is to typically prepare a custom file system (like an embedded zip-file) to be activated before the search.
When used in stub-enabled embedders, the stubs table must be first initialized using one of Tcl_InitSubsystems, Tcl_SetPanicProc, Tcl_FindExecutable or TclZipfs_AppHook before Tcl_SetPreInitScript may be called.