central(n) 1.0b1 central "Central"

Name

central - Central

Table Of Contents

Synopsis

  • package require Tcl 8.6
  • package require central ?1.0b1?

Description

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.

COMMANDS

central discover ?exclude?

Discovers packages. Ignores packages specified in ?exclude?. Returns a list of all discovered packages.

central packages

Returns a list of previously discovered packages.

central packagekeys package

Returns a list of all keys for package package.

central package ?key ...?

Returns all package info or info matching ?key?.

EXAMPLES

	# 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]]
		}
	}

See Also

Tcl_RegisterConfig(3), central::extras

Keywords

central, pkgconfig

Category

Programming tools