Package Server API v1
Not logged in

Private Procedure "hasPerms" (from "common.tcl")

    Required argument "name"

This TH1 procedure returns non-zero if the logged-in user has the
specified named permission -OR- the server has been configured in
such a way to permit anybody to have it, e.g. any user may lookup
packages.



Private Procedure "emitFormStart" (from "common.tcl")

    Required argument "name"
    Required argument "title"

This TH1 procedure emits the necessary HTML to start a <FORM> element
suitable for use with Fossil and optionally having a title to be used
as header text. The name must not contain any characters reserved in
HTML; however, the title will be properly escaped.



Private Procedure "emitHidden" (from "common.tcl")

    Required argument "name"
    Required argument "value"

This TH1 procedure emits the necessary HTML for a hidden form element
that has a name and value. The name must not contain any characters
reserved in HTML; however, the value will be properly escaped.



Private Procedure "emitTextBox" (from "common.tcl")

    Required argument "name"
    Required argument "value"
    Required argument "size"

This TH1 procedure emits the necessary HTML for a text box form element
that has a name, value, and size. The name and size must not contain
any characters reserved in HTML; however, the value will be properly
escaped.



Private Procedure "emitTextArea" (from "common.tcl")

    Required argument "name"
    Required argument "value"
    Required argument "rows"
    Required argument "columns"

This TH1 procedure emits the necessary HTML for a text area form
element that has a name, value, rows, and columns. The name, rows,
and columns must not contain any characters reserved in HTML; however,
the value will be properly escaped.



Private Procedure "emitCheckBox" (from "common.tcl")

    Required argument "name"
    Required argument "value"

This TH1 procedure emits the necessary HTML for a check box form
element that has a name and value. The name must not contain any
characters reserved in HTML; however, the value will be properly
escaped.



Private Procedure "emitSubmitButton" (from "common.tcl")

    Required argument "name"
    Required argument "value"

This TH1 procedure emits the necessary HTML for a submit button form
element that has a name and value. The name must not contain any
characters reserved in HTML; however, the value will be properly
escaped.



Private Procedure "emitFormEnd" (from "common.tcl")

This TH1 procedure emits the necessary HTML to end a <FORM> element
suitable for use with Fossil. There are no arguments.



Private Procedure "isValidApiKey" (from "common.tcl")

    Required argument "value"
    Optional argument "writing" with default value "false"
    Optional argument "emptyOk" with default value "false"

This Tcl procedure returns non-zero if the specified string value is
a valid API key. An API key has no relationship to a Fossil check-in
hash, even though it may look like one. The emptyOk argument can be
non-zero if the caller wishes to permit an empty string.



Private Procedure "isValidOwnerName" (from "common.tcl")

    Required argument "value"
    Optional argument "emptyOk" with default value "false"

This Tcl procedure returns non-zero if the specified string value is
suitable for use as an owner (entity) name. Only the Latin alphabet
and the space character are allowed.



Private Procedure "isValidMessage" (from "common.tcl")

    Required argument "value"
    Optional argument "emptyOk" with default value "false"

This Tcl procedure returns non-zero if the specified string value is
a valid (log) message. It must be valid Base64 data and the encoded
length is limited to 256K. Therefore, the unencoded length limit is
about 192K.



Private Procedure "isValidScriptName" (from "common.tcl")

    Required argument "value"
    Optional argument "emptyOk" with default value "false"

This Tcl procedure returns non-zero if the specified string value is
a valid script name. The emptyOk argument can be non-zero if the
caller wishes to permit an empty string.



Private Procedure "isValidHash" (from "common.tcl")

    Required argument "value"
    Optional argument "emptyOk" with default value "false"

This Tcl procedure returns non-zero if the specified string value is
a valid SHA1 hash. This has no relationship to a Fossil check-in
hash, even though it may look like one. The emptyOk argument can be
non-zero if the caller wishes to permit an empty string.



Private Procedure "verifyMessageAgainstHash" (from "common.tcl")

    Required argument "hmacKey"
    Required argument "message"
    Required argument "hash"

This Tcl procedure returns non-zero if the specified message string,
which must be Base64 encoded, validates based on the specified HMAC
key and hash. This procedure does not raise script errors.



Private Procedure "appendLogFile" (from "common.tcl")

    Required argument "fileName"
    Required argument "data"

This Tcl procedure appends binary data to the specified log file. No
trailing new line is emitted. The log file may be created if needed.



Private Procedure "htmlize" (from "common.tcl")

    Required argument "value"

This Tcl procedure (which uses a Fossil TH1 command) returns the HTML
escaped version of the specified string value. If TH1 integration is
not available for any reason, a script error will be raised.



Private Procedure "httpize" (from "common.tcl")

    Required argument "value"

This Tcl procedure (which uses a Fossil TH1 command) returns the HTTP
escaped version of the specified string value. If TH1 integration is
not available for any reason, a script error will be raised.



Private Procedure "getTablePreHeader" (from "common.tcl")

    Required argument "title"

This Tcl procedure (which uses a Fossil TH1 command) returns the HTML
necessary for some header text to accompany a table containing data.
The title will be HTML escaped. If TH1 integration is not available
for any reason, a script error will be raised.



Private Procedure "emitLink" (from "common.tcl")

    Required argument "href"
    Required argument "value"

This Tcl procedure returns the HTML necessary for a link to another
(arbitrary) page. The href argument must be a properly formed URI
and must not contain any characters reserved in HTML; however, the
value will be properly escaped. The value will be used as the text
for the link.



Private Procedure "emitBoldLink" (from "common.tcl")

    Required argument "href"
    Required argument "value"

This Tcl procedure returns the HTML necessary for a link to another
(arbitrary) page. The href argument must be a properly formed URI
and must not contain any characters reserved in HTML; however, the
value will be properly escaped. The value will be used as the text
for the link -AND- it will have bold styling.



Private Procedure "emitCodeLink" (from "common.tcl")

    Required argument "code"
    Required argument "value"

This Tcl procedure returns the HTML necessary for a link to another
page within the Fossil repository. The code argument must be a URN
name and must not contain any characters reserved in HTML; however,
the value will be properly escaped. The value will be used as the
text for the link.



Private Procedure "emitFormLink" (from "common.tcl")

    Required argument "name"
    Required argument "value"
    Required argument "extra"

This Tcl procedure returns the HTML necessary for a link to another
documentation page within the Fossil repository. It is hard-coded
to the latest trunk check-in. The name argument must be the name
of an existing wiki, markdown, or TH1 page and must not contain any
characters reserved in HTML; however, the value will be properly
escaped. The extra argument is designed to facilitate inclusion of
arbitrary query parameters. It should be an empty string if query
parameters are not required. The value will be used as the text for
the link.



Private Procedure "emitFormBoldLink" (from "common.tcl")

    Required argument "name"
    Required argument "value"
    Required argument "extra"

This Tcl procedure returns the HTML necessary for a link to another
documentation page within the Fossil repository. It is hard-coded
to the latest trunk check-in. The name argument must be the name
of an existing wiki, markdown, or TH1 page and must not contain any
characters reserved in HTML; however, the value will be properly
escaped. The extra argument is designed to facilitate inclusion of
arbitrary query parameters. It should be an empty string if query
parameters are not required. The value will be used as the text for
the link -AND- it will have bold styling.



Private Procedure "sql_function_vsatisfies" (from "package.tcl")

    Optional argument list "args"

This Tcl procedure is used to implement a SQL function for SQLite.
It compares two package requirement strings; however, it will only
return zero (i.e. package requirement not satisfied) or one (i.e.
package requirement satisfied).



Private Procedure "sql_collation_patchlevel_compare" (from "package.tcl")

    Required argument "a"
    Required argument "b"

This Tcl procedure is used to implement a SQL collation for SQLite.
It compares two package versions. If the first package version is
less than the second, negative one will be returned. If the package
versions are equal, zero is returned. If the first package version
is greater than the second, one will be returned. This procedure
may not raise script errors. This collation is critically important
for the database of packages and may of the associated SQL queries
rely on it.



Private Procedure "fixForTip268" (from "package.tcl")

    Required argument "version"

This Tcl procedure returns a patch level that replaces any "alpha"
or "beta" suffix with an appropriate numerical value that will sort
less than zero (i.e. which is presumed to be an officially released
version, e.g. RTM). This procedure is compliant with TIP #268.



Private Procedure "isValidPackageName" (from "package.tcl")

    Required argument "value"
    Optional argument "emptyOk" with default value "false"

This Tcl procedure returns non-zero if the specified string value is
a valid package name. The emptyOk argument can be non-zero if the
caller wishes to permit an empty string.



Private Procedure "isValidPackageVersion" (from "package.tcl")

    Required argument "value"
    Optional argument "emptyOk" with default value "false"

This Tcl procedure returns non-zero if the specified string value is
a valid package version. This should not be confused with a package
requirement (e.g. TIP #268). The emptyOk argument can be non-zero
if the caller wishes to permit an empty string. The package version
must consist of between two and four dot-separated integers, each
with a value greater than or equal to zero. It is recommended that
each dot-separated integer have a value less than or equal to 65535,
primarily for reasons of portability.



Private Procedure "isValidPackageRequirement" (from "package.tcl")

    Required argument "value"
    Required argument "rangeOk"
    Optional argument "emptyOk" with default value "false"

This Tcl procedure returns non-zero if the specified string value is
The emptyOk argument can be non-zero if the caller wishes to permit
an empty string. The rangeOk argument can be non-zero if the caller
wishes to allow a range of versions.



Private Procedure "getPkgDb" (from "package.tcl")

This Tcl procedure returns a fully qualified path and file name for
the database of packages. There are no arguments.



Private Procedure "openAndSetupPkgDb" (from "package.tcl")

    Required argument "cmdName"
    Required argument "readOnly"
    Required argument "functions"

This Tcl procedure attempts to open the database of packages and
enable the options it needs, e.g. via PRAGMA, etc. The custom
collation is always required. The custom function is registered
when the functions argument is non-zero. The readOnly argument
should be non-zero to prevent writes to the database.



Private Procedure "getOwnerFromApiKey" (from "package.tcl")

    Required argument "apiKey"
    Required argument "fullOnly"

This Tcl procedure attempts to obtain the name of the owner based on
an API key. Another connection to the database of packages will be
opened and closed by this procedure, even if one is already open.
An empty string will be returned if the owner cannot be found. The
fullOnly argument can be non-zero to indicate that read-only API
keys should not be considered.



Private Procedure "prepareSqlApiKeys" (from "package.tcl")

    Required argument "apiKeys"

This Tcl procedure accepts a comma-delimited list of API keys and
creates two arrays in the context of the immediate caller. The
sqlApiKeys array will be modified to contain only those API keys.
The sqlApiKeyNames array will be modified to contain only all the
qualified array element names of the sqlApiKeys array.



Private Procedure "combineWithReaderApiKeys" (from "package.tcl")

    Required argument "apiKey"
    Required argument "apiKeys"
    Required argument "package"
    Required argument "version"
    Required argument "exact"

This Tcl procedure returns a comma-delimited list of API keys with
at least read access. The returned list will be a logical union
of the API keys specified by the apiKey and apiKeys arguments -AND-
the active (read-only) API keys associated with authorized readers
of packages matching the specified criteria. The apiKey argument
is an optional (extra) API key to include in the final list. The
apiKeys argument is an optional comma-delimited list of API keys to
include in the final list. The optional package argument is a name
or glob pattern used to filter the list of packages. The optional
version argument is a package version or TIP #268 requirement used
to filter the list of packages. The boolean exact argument should
be non-zero to use exact matching for the package name -OR- zero to
use glob pattern matching for the package name. Another connection
to the database of packages will be opened and closed by this
procedure, even if one is already open. This procedure may raise
script errors.