central - Central
Central is a passive registration system for Tcl extensions and programs, based on the idea and workings of the Tcl pkgconfig command.
To participate, a pkgconfig command should exist in the namespace of an extension or program ("package"). Central itself is not needed by a providing package, only by a querying program.
Central can be used by a program to scan the namespace hierarchy (discover), and query any package information found.
The pkgconfig command provided by a package should behave like the Tcl pkgconfig command.
Central makes no effort to interpret the information returned by a pkgconfig command; this information is entirely up to the package.
Central is all about "about": allowing a program to easily provide information about itself to the outside world.
The usage example files, the program centraltool.tcl, and the Central extension itself contain pkgconfig commands and other code bits that can be copied or serve as examples and should make it easy to add Central functionality to extensions or programs.
Central works with Jim as well as with Tcl.
Discovers packages. Ignores packages specified in ?exclude?. Returns a list of all discovered packages.
Returns a list of previously discovered packages.
Returns a list of all keys for package package.
Returns all package info or info matching ?key?.
# Discover packages and display package info. package require central namespace import ::central::central central discover foreach package [central packages] { foreach key [central packagekeys $package] { puts [string cat $key " -> " [central package $package $key]] } }
Tcl_RegisterConfig(3), central::extras
central, pkgconfig
Programming tools
Copyright © 2020 Stuart Cassoff <stwo@users.sourceforge.net>