critcl::util(n)
π¦ critcl::util(n) β CriTcl β Utilities π¦
okay so bestie, welcome to the critcl::util(n) page π this is the reference manpage for the critcl::util package, and it's highkey giving "convenience commands for advanced functionality built on top of the core" energy. The intended audience? Mainly developers who want to write Tcl packages with embedded C code. No cap.
πΈ NAME πΈ
critcl::util - CriTcl - Utilities
β¨ SYNOPSIS β¨
package require Tcl 8.6
package require critcl ?3.2?
package require critcl::util ?1.2?
::critcl::util::checkfun name ?label?
::critcl::util::def path define ?value?
::critcl::util::undef path define
::critcl::util::locate label paths ?cmd?
π DESCRIPTION π
Be welcome to the C Runtime In Tcl (short: CriTcl), a system for embedding and using C code from within Tcl [http://core.tcl-lang.org/tcl] scripts β¨
This document is the reference manpage for the critcl::util package. This package provides convenience commands for advanced functionality built on top of the core. Its intended audience are mainly developers wishing to write Tcl packages with embedded C code.
This package resides in the Core Package Layer of CriTcl. The stack is literally:
+----------------+
|Applications |
| critcl |
| critcl::app |
+----------------+
*================*
|Core Packages |
| critcl |
| critcl::util |
*================*
+----------------+
|Support Packages|
| stubs::* |
| md5, platform |
| ... |
+----------------+
The way that layer chart is laid out, with Applications on top, Core Packages in the middle, and Support Packages underneath, is iconic tbh π«Ά
π οΈ API π οΈ
π ::critcl::util::checkfun name ?label?
This command checks the build-time environment for the existence of the C function name π₯ It returns true on success, and false otherwise. The signature carries an optional label too, so keep the ?label? exactly where it is.
π ::critcl::util::def path define ?value?
This command extends the specified configuration file path with a #define directive for the named define π
If value is not specified it will default to 1.
The result of the command is an empty string.
Note that the configuration file is maintained in the critcl::cache directory. Periodt.
π ::critcl::util::undef path define
This command extends the specified configuration file path with an #undef directive for the named define π¦
The result of the command is an empty string.
Note that the configuration file is maintained in the critcl::cache directory. Same vibe, different directive.
π ::critcl::util::locate label paths ?cmd?
This command checks the build-time environment for the existence of a file in a set of possible paths πΈ
If the optional cmd prefix is specified it will be called with the full path of a found file as its only argument to perform further checks. A return value of false will reject the path and continue the search.
The return value of the command is the found path, as listed in paths. As a side effect the command will also print the found path, prefixed with the label, using critcl::msg.
Failure to find the path is reported via critcl::error, and a possible empty string as the result, if critcl::error does not terminate execution. A relative path is resolved relative to the directory containing the CriTcl script. That last bit is lowkey important, iykyk.
π AUTHORS π
Andreas Kupries π
π BUGS, IDEAS, FEEDBACK π
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such at https://github.com/andreas-kupries/critcl. Please also report any ideas for enhancements you may have for either package and/or documentation. Fr fr, feedback is welcome π«Ά
π KEYWORDS π
C code, Embedded C Code, code generator, compile & run, compiler, dynamic code generation, dynamic compilation, generate package, linker, on demand compilation, on-the-fly compilation
π·οΈ CATEGORY π·οΈ
Glueing/Embedded C code
Β©οΈ COPYRIGHT Β©οΈ
Copyright (c) 2011-2024 Andreas Kupries
Cute sign-off, bestie: source doc, version 1.2, date/footer tag critcl::util(n) πππ«Ά
π¦ where this page comes from
- alpine 3.24: critcl-doc 3.3.1-r1 Β· TCL
- Copyright (c) 2011-2024 Andreas Kupries
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms