Tcl_OOInitStubs(3)
β¨ NAME β¨
Tcl_OOInitStubs β bestie, this is the lil function that initializes your library's access to all the TclOO functionality π
πΈ SYNOPSIS πΈ
#include <tclOO.h>
const char *
Tcl_OOInitStubs(interp)
π ARGUMENTS π
Tcl_Interp *interp(in) β the Tcl interpreter that the TclOO API is integrated with, aka the one whose C interface you're about to be using, no cap π
π¦ DESCRIPTION π¦
Okay so, when your extension library is gonna use the C interface that TclOO exposes, you call Tcl_OOInitStubs to set up your access to that interface. Where do you call it? From inside your *_Init (or *_SafeInit) function, and you pass in the interp that got handed to that routine as context. That's the whole vibe β¨
Now, the plot twist: if Tcl_OOInitStubs hands you back NULL, that means the initialization failed, and an error message will have been left sitting in the interpreter's result. π If you get anything else, you're golden β initialization succeeded, the TclOO API is yours to use from that point on, and the return value is the version of the TclOO API. π
And here's the choose-your-own-adventure part, bestie, you have to pick one:
- the C
#definesymbolUSE_TCLOO_STUBSgets defined, and your library code is linked against the Tcl stub library, or - that
#definesymbol does not get defined, and your library code is linked against the Tcl main library directly.
Pick one, don't be chaotic about it π«Ά
π BACKWARD COMPATIBILITY NOTE π
If you're linking against the Tcl 8.5 forward compatibility package for TclOO, heads up: only the stub-enabled configuration is supported. So you should also link against the TclOO independent stub library. And fun fact, that library is an integrated part of the main Tcl stub library in Tcl 8.6 π
Not me warning you that the 8.5 route has exactly one (1) supported configuration. The stub-enabled one. That's it. That's the option. π
π KEYWORDS π
stubs
π SEE ALSO π
That's the whole page, bestie, go forth and stub responsibly π This one's from the TclOO manual, version 1.0, and it lives under the name Tcl_OOInitStubs(3) β slay, ate, periodt π
β¨
π¦ where this page comes from
- alpine 3.22: tcl-doc 8.6.16-r0 Β· TCL
- alpine 3.23: tcl-doc 8.6.17-r0 Β· TCL
- alpine 3.23: tcl9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tcl-doc 8.6.17-r1 Β· TCL
- alpine 3.24: tcl9-doc 9.0.3-r2 Β· TCL
- arch rolling: tcl 8.6.16-1 Β· TCL
- centos-stream 10: tcl-doc 1:8.6.13-4.el10 Β· TCL AND GPL-3.0-or-later WITH bison-exception-2.2 AND BSD-3-Clause
- centos-stream 9: tcl-doc 1:8.6.10-7.el9 Β· TCL
- fedora 43: tcl-doc 1:9.0.2-1.fc43 Β· TCL AND GPL-3.0-or-later WITH Bison-exception-2.2 AND BSD-3-Clause
- fedora 44: tcl-doc 1:9.0.2-1.fc44 Β· TCL AND GPL-3.0-or-later WITH Bison-exception-2.2 AND BSD-3-Clause
- nixos 26.05: tcl 9.0.3
- nixpkgs unstable: tcl 9.1.0
- opensuse-leap 16.0: tcl-devel 8.6.15-160000.2.2 Β· TCL
- opensuse-leap 16.0: tcl-devel 8.6.15-160000.2.2 Β· TCL
- opensuse-leap 16.0: tcl-devel 8.6.15-160000.2.2 Β· TCL
- opensuse-leap 16.0: tcl-devel 8.6.15-160000.2.2 Β· TCL
- Copyright (c) 2012 Donal K. Fellows
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms