PRACTCL(n)
π practcl(n) β The Proper Rational API for C to Tool Command Language Modules π
okay bestie, sit DOWN because this one is a whole journey. this is the manual page for practcl, and it's giving "single file that does literally everything" energy. buckle up. π
β¨ NAME β¨
practcl β The Practcl Module. that's it. that's the name. iconic, no notes. π
πΈ SYNOPSIS πΈ
so here's the whole roster of procs and methods, copied exactly, no cap. yes there are a LOT. yes i listed every single one. π«Ά
package require TclOO 1.0
proc practcl::cat fname
proc practcl::docstrip text
proc putb ?map? text
proc Proc name arglist body
proc noop ?args?
proc practcl::debug ?args?
proc practcl::doexec ?args?
proc practcl::doexec_in path ?args?
proc practcl::dotclexec ?args?
proc practcl::domake path ?args?
proc practcl::domake.tcl path ?args?
proc practcl::fossil path ?args?
proc practcl::fossil_status dir
proc practcl::os
proc practcl::mkzip exename barekit vfspath
proc practcl::sort_dict list
proc practcl::local_os
proc practcl::config.tcl path
proc practcl::read_configuration path
proc practcl::tcllib_require pkg ?args?
proc practcl::platform::tcl_core_options os
proc practcl::platform::tk_core_options os
proc practcl::read_rc_file filename ?localdat ?
proc practcl::read_sh_subst line info
proc practcl::read_sh_file filename ?localdat ?
proc practcl::read_Config.sh filename
proc practcl::read_Makefile filename
proc practcl::cputs varname ?args?
proc practcl::tcl_to_c body
proc practcl::_tagblock text ?style tcl? ?note ?
proc practcl::de_shell data
proc practcl::grep pattern ?files ?
proc practcl::file_lexnormalize sp
proc practcl::file_relative base dst
proc practcl::findByPattern basedir patterns
proc practcl::log fname comment
proc practcl::_pkgindex_simpleIndex path
proc practcl::_pkgindex_directory path
proc practcl::_pkgindex_path_subdir path
proc practcl::pkgindex_path ?args?
proc practcl::installDir d1 d2
proc practcl::copyDir d1 d2 ?toplevel 1?
proc practcl::buildModule modpath
proc practcl::installModule modpath DEST
proc practcl::trigger ?args?
proc practcl::depends ?args?
proc practcl::target name info ?action ?
method constructor
method argspec argspec
method comment block
method keyword.Annotation resultvar commentblock type name body
method keyword.Class resultvar commentblock name body
method keyword.class resultvar commentblock name body
method keyword.Class_Method resultvar commentblock name ?args?
method keyword.method resultvar commentblock name ?args?
method keyword.proc commentblock name argspec
method reset
method Main
method section.method keyword method minfo
method section.annotation type name iinfo
method section.class class_name class_info
method section.command procinfo
method manpage ?header value? ?footer value? ?authors list?
method scan_text text
method scan_file filename
method _MorphPatterns
method define submethod ?args?
method graft ?args?
method initialize
method link command ?args?
method morph classname
method script script
method select
method source filename
classmethod select object
method config.sh
method BuildDir PWD
method MakeDir srcdir
method read_configuration
method build-cflags PROJECT DEFS namevar versionvar defsvar
method critcl ?args?
method Autoconf
method BuildDir PWD
method ConfigureOpts
method MakeDir srcdir
method make {} autodetect
method make {} clean
method make {} compile
method make {} install DEST
method build-compile-sources PROJECT COMPILE CPPCOMPILE INCLUDES
method build-Makefile path PROJECT
method build-library outfile PROJECT
method build-tclsh outfile PROJECT ?path auto?
method BuildDir PWD
method make {} autodetect
method make {} clean
method make {} compile
method make {} install DEST
method MakeDir srcdir
method NmakeOpts
method constructor module_object name info ?action_body ?
method do
method check
method output
method reset
method triggers
method constructor parent ?args?
method child method
method go
method cstructure name definition ?argdat ?
method include header
method include_dir ?args?
method include_directory ?args?
method c_header body
method c_code body
method c_function header body ?info ?
method c_tcloomethod name body ?arginfo ?
method cmethod name body ?arginfo ?
method c_tclproc_nspace nspace
method c_tclcmd name body ?arginfo ?
method c_tclproc_raw name body ?arginfo ?
method tcltype name argdat
method project-compile-products
method implement path
method initialize
method linktype
method generate-cfile-constant
method generate-cfile-header
method generate-cfile-tclapi
method generate-loader-module
method Collate_Source CWD
method select
classmethod select object
method code section body
method Collate_Source CWD
method project-compile-products
method generate-debug ?spaces ?
method generate-cfile-constant
method generate-cfile-public-structure
method generate-cfile-header
method generate-cfile-global
method generate-cfile-private-typedef
method generate-cfile-private-structure
method generate-cfile-functions
method generate-cfile-tclapi
method generate-hfile-public-define
method generate-hfile-public-macro
method generate-hfile-public-typedef
method generate-hfile-public-structure
method generate-hfile-public-headers
method generate-hfile-public-function
method generate-hfile-public-includes
method generate-hfile-public-verbatim
method generate-loader-external
method generate-loader-module
method generate-stub-function
method IncludeAdd headervar ?args?
method generate-tcl-loader
method generate-tcl-pre
method generate-tcl-post
method linktype
method Ofile filename
method project-static-packages
method toolset-include-directory
method target method ?args?
method project-compile-products
method generate-loader-module
method project-compile-products
method linker-products configdict
method initialize
variable make_object
method _MorphPatterns
method add ?args?
method install-headers ?args?
method make {} _preamble
method make {} pkginfo
method make {} objects
method make {} object name
method make {} reset
method make {} trigger ?args?
method make {} depends ?args?
method make {} filename name
method make {} target name Info body
method make {} todo
method make {} do
method child which
method generate-c
method generate-h
method generate-loader
method initialize
method implement path
method linktype
method _MorphPatterns
method constructor ?args?
method add_object object
method add_project pkg info ?oodefine ?
method add_tool pkg info ?oodefine ?
method build-tclcore
method child which
method linktype
method project pkg ?args?
method tclcore
method tkcore
method tool pkg ?args?
method clean PATH
method project-compile-products
method go
method generate-decls pkgname path
method implement path
method generate-make path
method linktype
method package-ifneeded ?args?
method shared_library ?filename ?
method static_library ?filename ?
method build-tclkit_main PROJECT PKG_OBJS
method Collate_Source CWD
method wrap PWD exename vfspath ?args?
classmethod Sandbox object
classmethod select object
classmethod claim_option
classmethod claim_object object
classmethod claim_path path
method scm_info
method DistroMixIn
method Sandbox
method SrcDir
method ScmTag
method ScmClone
method ScmUnpack
method ScmUpdate
method Unpack
classmethod claim_object object
classmethod claim_option
classmethod claim_path path
method ScmUnpack
classmethod claim_object obj
classmethod claim_option
classmethod claim_path path
method scm_info
method ScmClone
method ScmTag
method ScmUnpack
method ScmUpdate
classmethod claim_object obj
classmethod claim_option
classmethod claim_path path
method ScmTag
method ScmUnpack
method ScmUpdate
method _MorphPatterns
method BuildDir PWD
method child which
method compile
method go
method install ?args?
method linktype
method linker-products configdict
method linker-external configdict
method linker-extra configdict
method env-bootstrap
method env-exec
method env-install
method env-load
method env-present
method sources
method update
method unpack
method env-bootstrap
method env-present
method linktype
method env-bootstrap
method env-install
method env-present
method install DEST
method kettle path ?args?
method install DEST
method install DEST
method env-bootstrap
method env-install
method env-present
method install DEST
method install-module DEST ?args?
method env-bootstrap
method env-install
method install DEST
method install-module DEST ?args?
method clean
method env-install
method project-compile-products
method ComputeInstall
method go
method linker-products configdict
method project-static-packages
method BuildDir PWD
method compile
method Configure
method install DEST
method install DEST
method install DEST
method env-bootstrap
method env-present
method env-install
method go
method linktype
π¦ DESCRIPTION π¦
so like. what IS Practcl, you ask? the Practcl module is a tool for integrating large modules for C API Tcl code that requires custom Tcl types and TclOO objects. fr fr, that's the whole assignment.
the concept with Practcl is that it's a single file package that can help literally any tcl based project with:
- distribution
- compilation
- linking
- VFS preparation
- executable assembly
- installation
like, the range? unmatched. π
and get this β Practcl also lets one project invoke the build system from another project, which means complex projects such as a statically linked basekit can be assembled with relative ease. no cap. it just. does that. π₯
also, bestie, the dependency situation is gorgeous: Practcl ships as a single file, and aside from a Tcl 8.6 interpreter, it has no external dependencies. literally nothing else to install. we love a low-maintenance icon. π
π Making a practcl project
(more of the story incoming β this page continues in the next parts, so don't go anywhere bestie π)
π COMMANDS π
okay bestie, this is the whole command menu π
every single one of these is a proc, listed exactly like the page lists them, and I'm not skipping a single one. Let's get into it, no cap.
proc practcl::cat fnameβ concatenates a file. That's it, that's the whole vibe π±proc practcl::docstrip textβ strips the global comments out of Tcl code. Why? so the documentation markup comments don't clog up files that are meant to ship in a machine readable format. it's giving "take out the glitter before you mail the letter" β¨proc putb ?map? textβ appends a line of text onto a variable. optionally you can hand it a string mapping and it'll apply that too πproc Proc name arglist bodyβ makes a proc, but only if there isn't already a command with that name. no overwriting, we respect existing main characters πproc noop ?args?β the command that does absolutely nothing. lowkey iconic. it's how you disable an instruction without fully commenting it out, and it's also a handy lil attachment point for an object you want to name later π«Άproc practcl::debug ?args?β the page gives it no description, so we simply vibe with the mystery πproc practcl::doexec ?args?β drops in a static copy of Tcl π₯proc practcl::doexec_in path ?args?β the page lists it and moves on, bestie πproc practcl::dotclexec ?args?β listed, no notes β¨proc practcl::domake path ?args?β listed, no notes πproc practcl::domake.tcl path ?args?β listed, no notes πΈproc practcl::fossil path ?args?β listed, no notes π¦proc practcl::fossil_status dirβ listed, no notes πproc practcl::osβ listed, no notes πproc practcl::mkzip exename barekit vfspathβ builds a zipfile. on tcl8.6 this calls the native Zip implementation, and on older interpreters it shells out tozipviaexecποΈproc practcl::sort_dict listβ dictionary-sorts a key/value list. it exists because anything before tcl8.6 doesn't havelsort -stride 2. periodt πproc practcl::local_osβ returns a dictionary describing the local operating system. the fields it returns include:downloadβ filesystem path where fossil repositories and source tarballs get downloaded for the current userEXEEXTβ the extension to give to executables (i.e..exeon windows)fossil_mirrorβ a URI for a local network web server that acts as a fossil repository mirrorlocal_installβ filesystem path where packages for local consumption by the current user are installedprefixβ the prefix as given to the Tcl core/TEA for installation tolocal_installin./configuresandboxβ the file location where this project unpacks external projectsTEACUP_PROFILEβ the ActiveState/Teacup canonical name for this platform (i.e.win32-ix86 macosx10.5-i386-x86_84)TEACUP_OSβ the local operating system (windows,macosx,openbsd, etc). gives the same answer astcl.m4, except that macosx is given asmacosxinstead ofDarwinTEA_PLATFORMβ the platform returned byuname -s-uname -r(on Unix), or"windows"on WindowsTEACUP_ARCHβ the processor architecture for the local os (i.e.ix86,x86_64)TEACUP_ARCHβ the processor architecture for the local os (i.e.ix86,x86_64)teapotβ filesystem path where teapot package files get downloaded for the current useruserhomeβ file path to store localized preferences, cache download files, etc for the current user
yes bestie, TEACUP_ARCH really is listed twice in the original. I am not the one who did that, I'm just the one who's telling you π
this command figures all that out using a combination of local checks with Exec, any tclConfig.sh file that's resident, autoconf data where it's already been computed, and data gleaned from a file named practcl.rc in userhome. and where userhome lives changes by platform and operating system:
- Windows:
::env(LOCALAPPDATA)/Tcl - Macos:
~/Library/Application Support/Tcl - Other:
~/tcl proc practcl::config.tcl pathβ a transparent call to::practcl::read_configuration, kept around so older copies of Practcl still work π«Άproc practcl::read_configuration pathβ detects the local platform. it looks for data gleaned by autoconf or autosetup in the path you specify, or it runs its own logic tests if neither of those has been run. if a file namedconfig.siteis sitting in that location, that means the project is cross compiling, and the data stored in that file gets used for the compiler and linker.
this command looks for information from the following files, in this exact order:
config.tclβ a file generated by autoconf/configure in newer editions of TEA, encoded as a Tcl scriptconfig.siteβ a file containing cross compiler information, encoded as a SH script::env(VisualStudioVersion)β on Windows, an environmental value that indicates MS Visual Studio is installed
this command returns a dictionary containing all of the data cleaned from the sources above. in the absence of any guidance, this command returns the same output as ::practcl::local_os. in that mode, if the environmental variable VisualStudioVersion exists, this command will provide a template of fields that are appropriate for compiling on Windows under Microsoft Visual Studio. the USEMSVC flag in the dictionary is a boolean flag that tells you if that's indeed the case πͺ
proc practcl::tcllib_require pkg ?args?β tries to load a package, and if that flops, retrieves tcllib instead π¦proc practcl::platform::tcl_core_options osβ returns the string you pass to./configureto compile the Tcl core for the given OS.- windows:
--with-tzdata --with-encoding utf-8 - macosx:
--enable-corefoundation=yes --enable-framework=no --with-tzdata --with-encoding utf-8 - other:
--with-tzdata --with-encoding utf-8
- windows:
proc practcl::platform::tk_core_options osβ listed, no notes πΈproc practcl::read_rc_file filename ?localdat ?β reads a stylized key/value list stored in a file πproc practcl::read_sh_subst line infoβ converts aXXX.shfile into a series of Tcl variables π§proc practcl::read_sh_file filename ?localdat ?β listed, no notes πproc practcl::read_Config.sh filenameβ a simpler form ofread_sh_file, tailored to pulling data out of(tcl|tk)Config.shβοΈproc practcl::read_Makefile filenameβ a simpler form ofread_sh_file, tailored to pulling data out of a Makefile π οΈproc practcl::cputs varname ?args?β appends arguments to a buffer. it works likeputsin that every call also inserts a line feed. unlikeputs, blank lines in the interstitial get suppressed βοΈproc practcl::tcl_to_c bodyβ listed, no notes πproc practcl::_tagblock text ?style tcl? ?note ?β listed, no notes π·οΈproc practcl::de_shell dataβ listed, no notes πproc practcl::grep pattern ?files ?β searches for the pattern pattern amongst$filesπproc practcl::file_lexnormalize spβ listed, no notes β¨proc practcl::file_relative base dstβ calculates a relative path betweenbaseanddst.
Example:
::practcl::file_relative ~/build/tcl/unix ~/build/tcl/library
> ../library
proc practcl::findByPattern basedir patternsβ listed, no notes πproc practcl::log fname commentβ records an event in the practcl log πproc practcl::_pkgindex_simpleIndex pathβ listed, no notes πproc practcl::_pkgindex_directory pathβ returns true if the pkgindex file contains any statement other than"package ifneeded", and/or if anypackage ifneededloads a DLL πproc practcl::_pkgindex_path_subdir pathβ helper function for::practcl::pkgindex_pathπ§©proc practcl::pkgindex_path ?args?β indexes all paths you give it as though they're going to end up in the same virtual file system ποΈproc practcl::installDir d1 d2β deletes the contents ofd2, and then recursively copies the contents ofd1tod2πproc practcl::copyDir d1 d2 ?toplevel 1?β recursively copies the contents ofd1tod2πproc practcl::buildModule modpathβ listed, no notes ποΈproc practcl::installModule modpath DESTβ installs a module fromMODPATHto the directory specified.dpathis assumed to be the fully qualified path where the module is to be placed. any existing files at that path get deleted. if the path is a symlink, the process returns with no error and no action. if the module has contents in thebuild/directory that are newer than the.tclfiles in the module source directory, and abuild/build.tclfile exists, thenbuild/build.tclgets run. if the source directory includes a file namedindex.tcl, the directory is assumed to be in the tao style of modules, and the entire directory (and all subdirectories) gets copied verbatim. if noindex.tclfile is present, all.tclfiles are copied from the module source directory, and apkgIndex.tclfile is generated if none exists yet. if a folder namedhtdocsexists in the source directory, that directory gets copied verbatim to the destination π¦β¨proc practcl::trigger ?args?β triggers build targets, and recomputes dependencies.
Internals:
::practcl::LOCAL make trigger {*}$args
foreach {name obj} [::practcl::LOCAL make objects] {
set ::make($name) [$obj do]
}
proc practcl::depends ?args?β calculates whether a dependency for any of the arguments needs to be fulfilled or rebuilt.
Internals:
::practcl::LOCAL make depends {*}$args
proc practcl::target name info ?action ?β declares a build product. this proc is just shorthand for::practcl::LOCAL make task $name $info $action.
registering a build product with this command will create an entry in the global array, and populate a value in the global array.
Internals:
set obj [::practcl::LOCAL make task $name $info $action]
set ::make($name) 0
set filename [$obj define get filename]
if {$filename ne {}} {
set ::target($name) $filename
}
and that's the whole command list, bestie β every single proc the page names, in the same order it names them π
more coming, don't go anywhere π¦
β¨ CLASSES β¨
Okay bestie, this is where the real main-character energy lives β all the classes, all the methods, all the lore. Let's go. π
π CLASS PRACTCL::DOCTOOL π
{ set authors {
{John Doe} {jdoe@illustrious.edu}
{Tom RichardHarry} {tomdickharry@illustrius.edu}
}
# Create the object
::practcl::doctool create AutoDoc
set fout [open [file join $moddir module.tcl] w]
foreach file [glob [file join $srcdir *.tcl]] {
set content [::practcl::cat [file join $srcdir $file]]
# Scan the file
AutoDoc scan_text $content
# Strip the comments from the distribution
puts $fout [::practcl::docstrip $content]
}
# Write out the manual page
set manout [open [file join $moddir module.man] w]
dict set args header [string map $modmap [::practcl::cat [file join $srcdir manual.txt]]]
dict set args footer [string map $modmap [::practcl::cat [file join $srcdir footer.txt]]]
dict set args authors $authors
puts $manout [AutoDoc manpage {*}$args]
close $manout
}
Tool for build scripts to dynamically generate manual files from comments in source code files. It's giving auto-doc royalty, no cap. π
Methods
method constructorβ constructor things, bestie. No extra description in the original, so we're keeping it mysterious. πmethod argspec argspecβ Process an argument list into an informational dict. This method also understands non-positional arguments expressed in the notation of Tip 471 https://core.tcl-lang.org/tips/doc/trunk/tip/479.md.
The output will be a dictionary of all of the fields and whether the fields are positional, mandatory, and whether they have a default value.
Example:
my argspec {a b {c 10}}
> a {positional 1 mandatory 1} b {positional 1 mandatory 1} c {positional 1 mandatory 0 default 10}
method comment blockβ Convert a block of comments into an informational dictionary. If lines in the comment start with a single word ending in a colon, all subsequent lines are appended to a dictionary field of that name. If no fields are given, all of the text is appended to the description field.
Example:
my comment {Does something cool}
> description {Does something cool}
my comment {
title : Something really cool
author : Sean Woods
author : John Doe
description :
This does something really cool!
}
> description {This does something really cool!}
title {Something really cool}
author {Sean Woods
John Doe}
method keyword.Annotation resultvar commentblock type name bodyβ no description in the original, just the signature. Keep it cute. β¨method keyword.Class resultvar commentblock name bodyβ Process an oo::objdefine call that modifies the class object itself.method keyword.class resultvar commentblock name bodyβ Process an oo::define, clay::define, etc statement.method keyword.Class_Method resultvar commentblock name ?args?β Process a statement for a clay style class method.method keyword.method resultvar commentblock name ?args?β Process a statement for a tcloo style object method.method keyword.proc commentblock name argspecβ Process a proc statement.method resetβ Reset the state of the object and its embedded coroutine.method Mainβ Main body of the embedded coroutine for the object.method section.method keyword method minfoβ Generate the manual page text for a method or proc.method section.annotation type name iinfoβ no description in the original, just the signature. π¦method section.class class_name class_infoβ Generate the manual page text for a class.method section.command procinfoβ Generate the manual page text for the commands section.method manpage ?header value? ?footer value? ?authors list?β Generate the manual page. Returns the completed text suitable for saving in .man file. The header argument is a block of doctools text to go in before the machine generated section. footer is a block of doctools text to go in after the machine generated section. authors is a list of individual authors and emails in the form of AUTHOR EMAIL ?AUTHOR EMAIL?...method scan_text textβ Scan a block of text.method scan_file filenameβ Scan a file of text.
π¦ CLASS PRACTCL::METACLASS π¦
The metaclass for all practcl objects.
Methods
method _MorphPatternsmethod define submethod ?args?method graft ?args?method initializemethod link command ?args?method morph classnamemethod script scriptmethod selectmethod source filename
π CLASS PRACTCL::TOOLSET π
Ancestor-less class intended to be a mixin which defines a family of build related behaviors that are modified when targetting either gcc or msvc.
Class Methods
classmethod select objectβ Perform the selection for the toolset mixin.
Methods
method config.shβ find or fake a key/value list describing this project.method BuildDir PWDβ Compute the location where the product will be built.method MakeDir srcdirβ Return where the Makefile is located relative to srcdir. For this implementation the MakeDir is always srcdir.method read_configurationβ Read information about the build process for this package. For this implementation, data is sought in the following locations in the following order: config.tcl (generated by practcl.) PKGConfig.sh. The Makefile
If the Makefile needs to be consulted, but does not exist, the Configure method is invoked.
method build-cflags PROJECT DEFS namevar versionvar defsvarβ method DEFS This method populates 4 variables: name - The name of the package version - The version of the package defs - C flags passed to the compiler includedir - A list of paths to feed to the compiler for finding headersmethod critcl ?args?β Invoke critcl in an external process.
π CLASS PRACTCL::TOOLSET.GCC π
ancestors: practcl::toolset
Methods
method Autoconfmethod BuildDir PWDmethod ConfigureOptsmethod MakeDir srcdirβ Detect what directory contains the Makefile template.method make {} autodetectmethod make {} cleanmethod make {} compilemethod make {} install DESTmethod build-compile-sources PROJECT COMPILE CPPCOMPILE INCLUDESmethod build-Makefile path PROJECTmethod build-library outfile PROJECTβ Produce a static or dynamic library.method build-tclsh outfile PROJECT ?path auto?β Produce a static executable.
π CLASS PRACTCL::TOOLSET.MSVC π
ancestors: practcl::toolset
Methods
method BuildDir PWDβ MSVC always builds in the source directory.method make {} autodetectβ Do nothing.method make {} cleanmethod make {} compilemethod make {} install DESTmethod MakeDir srcdirβ Detect what directory contains the Makefile template.method NmakeOpts
π§ CLASS PRACTCL::MAKE_OBJ π§
ancestors: practcl::metaclass
A build deliverable object. Normally an object file, header, or tcl script which must be compiled or generated in some way.
Methods
method constructor module_object name info ?action_body ?method domethod checkmethod outputmethod resetmethod triggers
β CLASS PRACTCL::OBJECT β
ancestors: practcl::metaclass
A generic Practcl object.
Methods
method constructor parent ?args?method child methodmethod go
π₯ CLASS PRACTCL::DYNAMIC π₯
Dynamic blocks do not generate their own .c files, instead the contribute to the amalgamation of the main library file.
Methods
method cstructure name definition ?argdat ?β Parser functions.method include headermethod include_dir ?args?method include_directory ?args?method c_header bodymethod c_code bodymethod c_function header body ?info ?method c_tcloomethod name body ?arginfo ?method cmethod name body ?arginfo ?β Alias to classic name.method c_tclproc_nspace nspacemethod c_tclcmd name body ?arginfo ?method c_tclproc_raw name body ?arginfo ?β Alias to classic name.method tcltype name argdatmethod project-compile-productsβ Module interactions.method implement pathmethod initializeβ Practcl internals.method linktypemethod generate-cfile-constantmethod generate-cfile-headermethod generate-cfile-tclapiβ Generate code that provides implements Tcl API calls.method generate-loader-moduleβ Generate code that runs when the package/module is initialized into the interpreter.method Collate_Source CWDmethod selectβ Once an object marks itself as some flavor of dynamic, stop trying to morph it into something else.
π CLASS PRACTCL::PRODUCT π
A deliverable for the build system.
Class Methods
classmethod select object
Methods
method code section bodymethod Collate_Source CWDmethod project-compile-productsmethod generate-debug ?spaces ?method generate-cfile-constantmethod generate-cfile-public-structureβ Populate const static data structures.method generate-cfile-headermethod generate-cfile-globalmethod generate-cfile-private-typedefmethod generate-cfile-private-structuremethod generate-cfile-functionsβ Generate code that provides subroutines called by Tcl API methods.method generate-cfile-tclapiβ Generate code that provides implements Tcl API calls.method generate-hfile-public-definemethod generate-hfile-public-macromethod generate-hfile-public-typedefmethod generate-hfile-public-structuremethod generate-hfile-public-headersmethod generate-hfile-public-functionmethod generate-hfile-public-includesmethod generate-hfile-public-verbatimmethod generate-loader-externalmethod generate-loader-modulemethod generate-stub-functionmethod IncludeAdd headervar ?args?method generate-tcl-loadermethod generate-tcl-preβ This methods generates any Tcl script file which is required to pre-initialize the C library.method generate-tcl-postmethod linktypemethod Ofile filenamemethod project-static-packagesβ Methods called by the master project.method toolset-include-directoryβ Methods called by the toolset.method target method ?args?
π¦ CLASS PRACTCL::PRODUCT.CHEADER π¦
ancestors: practcl::product
A product which generated from a C header file. Which is to say, nothing.
Methods
method project-compile-products
Okay so we're back in the class zone, and there's one more method floating around before the class parade starts: generate-loader-module. No description, just a method name doing its thing. Periodt. π
π CLASS PRACTCL::PRODUCT.CSOURCE π
ancestors: practcl::product
A product which generated from a C source file. Normally an object (.o) file. Lowkey a glow-up from source to object, you know? Iconic.
β¨ Methods β¨
method project-compile-productsβ no extra deets, just the method name. Slay.
π CLASS PRACTCL::PRODUCT.CLIBRARY π
ancestors: practcl::product
A product which is generated from a compiled C library. Usually a .a or a .dylib file, but in complex cases may actually just be a conduit for one project to integrate the source code of another. It's giving middleman energy, but make it compile.
β¨ Methods β¨
method linker-products configdictβ no description, just the signature. Vibes.
π CLASS PRACTCL::PRODUCT.DYNAMIC π
ancestors: practcl::dynamic practcl::product
A product which is generated from C code that itself is generated by practcl or some other means. This C file may or may not produce its own .o file, depending on whether it is eligible to become part of an amalgamation. So it's like, maybe an object, maybe not? The audacity.
β¨ Methods β¨
method initializeβ yep, just initialize. Basic but necessary.
π CLASS PRACTCL::PRODUCT.CRITCL π
ancestors: practcl::dynamic practcl::product
A binary product produced by critcl. Note: The implementation is not written yet, this class does nothing. So it's iconic but unfinished, no cap.
π CLASS PRACTCL::MODULE π
ancestors: practcl::object practcl::product.dynamic
In the end, all C code must be loaded into a module. This will either be a dynamically loaded library implementing a tcl extension, or a compiled in segment of a custom shell/app. It's the final boss of C code loading, fr fr.
π§ Variable π§
variable make_objectβ that's the variable, bestie. Noted.
β¨ Methods β¨
method _MorphPatternsβ no note, just the method.method add ?args?β no note.method install-headers ?args?β no note.method make {} _preambleβ no note.method make {} pkginfoβ no note.method make {} objectsβ Return a dictionary of all handles and associated objects. Dictionary realness.method make {} object nameβ Return the object associated with handle name.method make {} resetβ Reset all deputy objects.method make {} trigger ?args?β Exercise the triggers method for all handles listed.method make {} depends ?args?β Exercise the check method for all handles listed.method make {} filename nameβ Return the file name of the build product for the listed handle.method make {} target name Info bodyβ no note.method make {} todoβ Return a list of handles for object which return true for the do method.method make {} doβ For each target exercise the action specified in the action definition if the do method returns true.method child whichβ no note.method generate-cβ This methods generates the contents of an amalgamated.cfile which implements the loader for a batch of tools. Amalgamation? We love to see it.method generate-hβ This methods generates the contents of an amalgamated.hfile which describes the public API of this module.method generate-loaderβ no note.method initializeβ no note.method implement pathβ no note.method linktypeβ no note.
π CLASS PRACTCL::PROJECT π
ancestors: practcl::module
A toplevel project that is a collection of other projects. Main character energy.
β¨ Methods β¨
method _MorphPatternsβ no note.method constructor ?args?β no note.method add_object objectβ no note.method add_project pkg info ?oodefine ?β no note.method add_tool pkg info ?oodefine ?β no note.method build-tclcoreβ Compile the Tcl core. If the define tk is true, compile the Tk core as well. Tcl core, Tk core, we love a double feature.method child whichβ no note.method linktypeβ no note.method project pkg ?args?β Exercise the methods of a sub-object.method tclcoreβ no note.method tkcoreβ no note.method tool pkg ?args?β no note.
π CLASS PRACTCL::LIBRARY π
ancestors: practcl::project
A toplevel project that produces a library. Library era.
β¨ Methods β¨
method clean PATHβ no note.method project-compile-productsβ no note.method goβ no note.method generate-decls pkgname pathβ no note.method implement pathβ no note.method generate-make pathβ Backward compadible call. Yes, "compadible" β we keep the typo, it's iconic.method linktypeβ no note.method package-ifneeded ?args?β Create a "package ifneeded" Args are a list of aliases for which this package will answer to.method shared_library ?filename ?β no note.method static_library ?filename ?β no note.
π CLASS PRACTCL::TCLKIT π
ancestors: practcl::library
A toplevel project that produces a self-contained executable. Self-contained? Obsessed.
β¨ Methods β¨
method build-tclkit_main PROJECT PKG_OBJSβ no note.method Collate_Source CWDβ no note.method wrap PWD exename vfspath ?args?β Wrap an executable.
π CLASS PRACTCL::DISTRIBUTION π
Standalone class to manage code distribution. This class is intended to be mixed into another class (thus the lack of ancestors). Mix-in realness.
π§ Class Methods π§
classmethod Sandbox objectβ no note.classmethod select objectβ no note.classmethod claim_optionβ no note.classmethod claim_object objectβ no note.classmethod claim_path pathβ no note.
β¨ Methods β¨
method scm_infoβ no note.method DistroMixInβ no note.method Sandboxβ no note.method SrcDirβ no note.method ScmTagβ no note.method ScmCloneβ no note.method ScmUnpackβ no note.method ScmUpdateβ no note.method Unpackβ no note.
π CLASS PRACTCL::DISTRIBUTION.SNAPSHOT π
ancestors: practcl::distribution
A file distribution from zip, tarball, or other non-scm archive format. Zip it, tarball it, slay it.
π§ Class Methods π§
classmethod claim_object objectβ no note.classmethod claim_optionβ no note.classmethod claim_path pathβ no note.
β¨ Methods β¨
method ScmUnpackβ no note.
π CLASS PRACTCL::DISTRIBUTION.FOSSIL π
ancestors: practcl::distribution
A file distribution based on fossil. Fossil vibes.
π§ Class Methods π§
classmethod claim_object objβ Check for markers in the metadata.classmethod claim_optionβ no note.classmethod claim_path pathβ Check for markers in the source root.
β¨ Methods β¨
method scm_infoβ no note.method ScmCloneβ Clone the source.method ScmTagβ no note.method ScmUnpackβ no note.method ScmUpdateβ no note.
π CLASS PRACTCL::DISTRIBUTION.GIT π
ancestors: practcl::distribution
A file distribution based on git. Git it, girl.
π§ Class Methods π§
classmethod claim_object objβ no note.classmethod claim_optionβ no note.classmethod claim_path pathβ no note.
β¨ Methods β¨
method ScmTagβ no note.method ScmUnpackβ no note.method ScmUpdateβ no note.
π CLASS PRACTCL::SUBPROJECT π
ancestors: practcl::module
A subordinate project. Supporting role, but still important.
β¨ Methods β¨
method _MorphPatternsβ no note.method BuildDir PWDβ no note.method child whichβ no note.method compileβ no note.method goβ no note.method install ?args?β Install project into the local build system.method linktypeβ no note.method linker-products configdictβ no note.method linker-external configdictβ no note.method linker-extra configdictβ no note.method env-bootstrapβ Methods for packages/tools that can be downloaded possibly built and used internally by this Practcl process Load the facility into the interpreter. Big mood.method env-execβ Return a file path that exec can call.method env-installβ Install the tool into the local environment.method env-loadβ Do whatever is necessary to get the tool into the local environment.method env-presentβ Check if tool is available for load/already loaded.method sourcesβ no note.method updateβ no note.method unpackβ no note.
π CLASS PRACTCL::SUBPROJECT.SOURCE π
ancestors: practcl::subproject practcl::library
A project which the kit compiles and integrates the source for itself. DIY but make it build.
β¨ Methods β¨
method env-bootstrapβ no note.method env-presentβ no note.method linktypeβ no note.
π CLASS PRACTCL::SUBPROJECT.TEAPOT π
ancestors: practcl::subproject
A copy from the teapot. Teapot said copy that.
β¨ Methods β¨
method env-bootstrapβ no note.method env-installβ no note.method env-presentβ no note.method install DESTβ no note.
π CLASS PRACTCL::SUBPROJECT.KETTLE π
ancestors: practcl::subproject
No description, just kettle things. Put the kettle on.
β¨ Methods β¨
method kettle path ?args?β no note.method install DESTβ no note.
π CLASS PRACTCL::SUBPROJECT.CRITCL π
ancestors: practcl::subproject
Critcl subproject, no extra deets.
β¨ Methods β¨
method install DESTβ no note.
π CLASS PRACTCL::SUBPROJECT.SAK π
ancestors: practcl::subproject
SAK subproject, no description.
β¨ Methods β¨
method env-bootstrapβ no note.method env-installβ no note.method env-presentβ no note.method install DESTβ no note.method install-module DEST ?args?β no note.
π CLASS PRACTCL::SUBPROJECT.PRACTCL π
ancestors: practcl::subproject
Practcl subproject, no description.
β¨ Methods β¨
method env-bootstrapβ no note.method env-installβ no note.method install DESTβ no note.method install-module DEST ?args?β no note.
π CLASS PRACTCL::SUBPROJECT.BINARY π
ancestors: practcl::subproject
A subordinate binary package. Binary babe.
β¨ Methods β¨
method cleanβ no note.method env-installβ no note.method project-compile-productsβ no note.method ComputeInstallβ no note.method goβ no note.method linker-products configdictβ no note.method project-static-packagesβ no note.method BuildDir PWDβ no note.method compileβ no note.method Configureβ no note.method install DESTβ no note.
π CLASS PRACTCL::SUBPROJECT.TEA π
ancestors: practcl::subproject.binary
A subordinate TEA based binary package. Tea time.
π CLASS PRACTCL::SUBPROJECT.LIBRARY π
ancestors: practcl::subproject.binary practcl::library
A subordinate C library built by this project. Built different.
β¨ Methods β¨
method install DESTβ no note.
π CLASS PRACTCL::SUBPROJECT.EXTERNAL π
ancestors: practcl::subproject.binary
A subordinate external C library. External but still in the family.
β¨ Methods β¨
method install DESTβ no note.
π CLASS PRACTCL::SUBPROJECT.CORE π
ancestors: practcl::subproject.binary
Core subproject, no description.
β¨ Methods β¨
method env-bootstrapβ no note.method env-presentβ no note.method env-installβ no note.method goβ no note.method linktypeβ no note.
π BUGS, IDEAS, FEEDBACK π
Okay so this document, and the package it describes, will undoubtedly contain bugs and other problems. Not a vibe, but it's real. Please report such in the category practcl of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. Please also report any ideas for enhancements you may have for either package and/or documentation.
When proposing code changes, please provide unified diffs, i.e the output of diff -u.
Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. Periodt.
π KEYWORDS π
practcl
π·οΈ CATEGORY π·οΈ
TclOO
Β©οΈ COPYRIGHT Β©οΈ
Copyright (c) 2016-2018 Sean Woods <yoda@etoyoc.com>
And that's the whole page, bestie! This came from the tcllib fam, version 0.16.6, and the page is pr...l(n). No date in the footer, so we're just vibing. Stay iconic, stay compiling. πβ¨
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2016-2018 Sean Woods <yoda@etoyoc\&.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms