File 'base/cgi_opt.tcl' (part of 'Pool_Base')

Description (short)
Option handling
Written by
Andreas Kupries
Description
Defines an option handling package like the standard one coming with Pool_base, see base/getopt.tcl, but using key=value pairs to specify data instead of -key value as is usual. This is done to blend in with the standard attribute handling of cgi and HTML. Uses the functionality of base/getopt.tcl internally. Especially the typecheckers are borrowed from that part of the Pool.
Depends on
Tcl
Keywords
options, key, value, attribute, cgi, html


::pool::cgi::checkValues (optDef optVal)

Checks the values in the given array using the type checker procedures mentioned in the definition array.
Argument: optDef The name of the array containing the option and alias definitions and their type checkers.
Argument: optVal The name of the array containing the values to check

::pool::cgi::initValues (optDef optVal)

Initializes the given storage array with the default values of the options in the definition array.
Argument: optDef The name of the array containing the option and alias definitions and their default values
Argument: optVal The name of the array to initalize.

::pool::cgi::parseArguments (optDef optList optVal)

This is the main parser procedure.
Argument: optDef The name of the array containing the option and alias definitions to recognize here.
Argument: optList The name of the variable containing the list of arguments to parse.
Argument: optVal The name of the array to hold the found values.

::pool::cgi::process (optDef optlist optval)

Parses optlist as a list of key=value elements followed by normal arguments. The end of the option sequence is detected by the presence of arguments not containing '='. Only options and aliases defined in optDef are allowed. Values given to an alias are stored under the name of the option, *not* the alias. All values are stored in the array optval. The option-names are used as keys. The storage array is initialized with the default values of the allowed options. The moment all option values are known and not changing anymore the 'type' procedures are called with option-names and -values to determine the legality of the specified value. The return value 'False' signals an illegal value.
Argument: optDef The name of the array containing the option and alias definitions to recognize.
Argument: optlist The list of arguments to parse.
Argument: optval The name of the array to hold the found values.
Returns: A list containing the arguments not processed here.

::pool::cgi::processOpt (optDef optlist optval)

Basically the same functionality as ::pool::cgi::process, but with the following differences:
The storage array is not initialized with the default values.
The <optlist> must not contain arguments after the key=value elements.
There is no return value.
Argument: optDef The name of the array containing the option and alias definitions to recognize here.
Argument: optlist The list of arguments to parse.
Argument: optval The name of the array to hold the found values.


Generated by AutoDoc 2.4 at 09/14/2000, invoked by Andreas Kupries