ADDED embedded/www/tcllib/files/modules/clay/clay.html Index: embedded/www/tcllib/files/modules/clay/clay.html ================================================================== --- /dev/null +++ embedded/www/tcllib/files/modules/clay/clay.html @@ -0,0 +1,491 @@ + +
+ +
[ + Main Table Of Contents +| Table Of Contents +| Keyword Index +| Categories +| Modules +| Applications + ]
+
+

clay(n) 0.3 tcllib "Clay Framework"

+

Name

+

clay - A minimalist framework for large scale OO Projects

+
+ +

Synopsis

+
+
    +
  • package require Tcl 8.6
  • +
  • package require uuid
  • +
  • package require oo::dialect
  • +
+ +
+
+

Description

+

Clay introduces a method ensemble to both oo::class and oo::object called +clay. This ensemble handles all of the high level interactions within the framework. +Clay stores structured data. Clan manages method delegation. Clay has facilities to +manage the complex interactions that come about with mixins.

+

The central concept is that inside of every object and class +(which are actually objects too) is a dict called clay. What is stored in that dict is +left to the imagination. But because this dict is exposed via a public method, we can +share structured data between object, classes, and mixins.

+

Structured Data

+

Clay uses a standardized set of method interactions and introspection that TclOO already provides to perform on-the-fly searches. On-the-fly searches mean that the data is never stale, and we avoid many of the sorts of collisions that would arise when objects start mixing in other classes during operation.

+

The clay methods for both classes and objects have a get and a set method. For objects, get will search through the local clay dict. If the requested leaf is not found, or the query is for a branch, the system will then begin to poll the clay methods of all of the class that implements the object, all of that classes’ ancestors, as well as all of the classes that have been mixed into this object, and all of their ancestors.

+

Intended branches on a tree end with a directory slash (/). Intended leaves are left unadorned. This is a guide for the tool that builds the search +results to know what parts of a dict are intended to be branches and which are intended to be leaves. +For simple cases, branch marking can be ignored:

+
+::oo::class create ::foo { }
+::foo clay set property/ color blue
+::foo clay set property/ shape round
+set A [::foo new]
+$A clay get property/
+{color blue shape round}
+$A clay set property/ shape square
+$A clay get property/
+{color blue shape square}
+
+

But when you start storing blocks of text, guessing what field is a dict and what isn’t gets messy:

+
+::foo clay set description {A generic thing of designated color and shape}
+$A clay get description
+{A generic thing of designated color and shape}
+Without a convention for discerning branches for leaves what should have been a value can be accidentally parsed as a dictionary, and merged with all of the other values that were never intended to be merge. Here is an example of it all going wrong:
+::oo::class create ::foo { }
+# Add description as a leaf
+::foo clay set description  {A generic thing of designated color and shape}
+# Add description as a branch
+::foo clay set description/  {A generic thing of designated color and shape}
+::oo::class create ::bar {
+  superclass foo
+}
+# Add description as a leaf
+::bar clay set description  {A drinking establishment of designated color and shape and size}
+# Add description as a branch
+::bar clay set description/  {A drinking establishment of designated color and shape and size}
+set B [::bar new]
+# As a leaf we get the value verbatim from he nearest ancestor
+$B clay get description
+  {A drinking establishment of designated color and shape and size}
+# As a branch we get a recursive merge
+$B clay get description/
+{A drinking establishment of designated color and size thing of}
+
+
+

Clay Dialect

+

Clay is built using the oo::dialect module from Tcllib. oo::dialect allows you to either add keywords directly to clay, or to create your own +metaclass and keyword set using Clay as a foundation. For details on the keywords and what they do, consult the functions in the ::clay::define namespace.

+
+

Method Delegation

+

Method Delegation +It is sometimes useful to have an external object that can be invoked as if it were a method of the object. Clay provides a delegate ensemble method to perform that delegation, as well as introspect which methods are delegated in that manner. All delegated methods are marked with html-like tag markings (< >) around them.

+
+::clay::define counter {
+  Variable counter 0
+  method incr {{howmuch 1}} {
+    my variable counter
+    incr counter $howmuch
+  }
+  method value {} {
+    my variable counter
+    return $counter
+  }
+  method reset {} {
+    my variable counter
+    set counter 0
+  }
+}
+::clay::define example {
+  variable buffer
+  constructor {} {
+    # Build a counter object
+    set obj [namespace current]::counter
+    ::counter create $obj
+    # Delegate the counter
+    my delegate <counter> $obj
+  }
+  method line {text} {
+    my <counter> incr
+    append buffer $text
+  }
+}
+set A [example new]
+$A line {Who’s line is it anyway?}
+$A <counter> value
+1
+
+
+
+ +

Classes

+

Class oo::class

+

Methods

+
+
method clay ancestors
+

Return this class and all ancestors in search order.

+
method clay dump
+

Return a complete dump of this object's clay data, but only this object's clay data.

+
method clay find path ?path...?
+

Pull a chunk of data from the clay system. If the last element of path is a branch, + returns a recursive merge of all data from this object and it's constituent classes of the data in that branch. + If the last element is a leaf, search this object for a matching leaf, or search all constituent classes for a matching + leaf and return the first value found. + If no value is found, returns an empty string. + If a branch is returned the topmost . entry is omitted.

+
method clay get path ?path...?
+

Pull a chunk of data from the class's clay system. + If no value is found, returns an empty string. + If a branch is returned the topmost . entry is omitted.

+
method clay GET path ?path...?
+

Pull a chunk of data from the class's clay system. + If no value is found, returns an empty string.

+
method clay merge dict ?dict...?
+

Recursively merge the dictionaries given into the object's local clay storage.

+
method clay replace dictionary
+

Replace the contents of the internal clay storage with the dictionary given.

+
method clay search path ?path...?
+

Return the first matching value for the path in either this class's clay data or one of its ancestors

+
method clay set path ?path...? value
+

Merge the conents of value with the object's clay storage at path.

+
+
+

Class oo::object

+

Methods

+
+
method clay ancestors
+

Return the class this object belongs to, all classes mixed into this object, and all ancestors of those classes in search order.

+
method clay cget field
+

Pull a value from either the object's clay structure or one of its constituent classes that matches the field name. + The order of search us:

+

1. The as a value in local dict variable config

+

2. The as a value in local dict variable clay

+

3. As a leaf in any ancestor as a root of the clay tree

+

4. As a leaf in any ancestor as const field

+

5. As a leaf in any ancestor as option field default

+
method clay delegate ?stub? ?object?
+

Introspect or control method delegation. With no arguments, the method will return a + key/value list of stubs and objects. With just the stub argument, the method will + return the object (if any) attached to the stub. With a stub and an object + this command will forward all calls to the method stub to the object.

+
method clay dump
+

Return a complete dump of this object's clay data, as well as the data from all constituent classes recursively blended in.

+
method clay ensemble_map
+

Return a dictionary describing the method ensembles to be assembled for this object

+
method clay eval script
+

Evaluated a script in the namespace of this object

+
method clay evolve
+

Trigger the InitializePublic private method

+
method clay exists path ?path...?
+

Returns 1 if path exists in either the object's clay data. Values greater than one indicate the element exists in one of the object's constituent classes. A value of zero indicates the path could not be found.

+
method clay flush
+

Wipe any caches built by the clay implementation

+
method clay forward method object
+

A convenience wrapper for

+
oo::objdefine [self] forward {*}$args
+
+
method clay get path ?path...?
+

Pull a chunk of data from the clay system. If the last element of path is a branch (ends in a slash /), + returns a recursive merge of all data from this object and it's constituent classes of the data in that branch. + If the last element is a leaf, search this object for a matching leaf, or search all constituent classes for a matching + leaf and return the first value found. + If no value is found, returns an empty string.

+
method clay leaf path ?path...?
+

A modified get which is tailored to pull only leaf elements

+
method clay merge dict ?dict...?
+

Recursively merge the dictionaries given into the object's local clay storage.

+
method clay mixin class ?class...?
+

Perform [oo::objdefine [self] mixin] on this object, with a few additional rules: + Prior to the call, for any class was previously mixed in, but not in the new result, execute the script registered to mixin/ unmap-script (if given.) + For all new classes, that were not present prior to this call, after the native TclOO mixin is invoked, execute the script registered to mixin/ map-script (if given.) + Fall all classes that are now present and “mixed in”, execute the script registered to mixin/ react-script (if given.)

+
method clay mixinmap ?stub? ?classes?
+

With no arguments returns the map of stubs and classes mixed into the current object. When only stub is given, + returns the classes mixed in on that stub. When stub and classlist given, replace the classes currently on that stub with the given + classes and invoke clay mixin on the new matrix of mixed in classes.

+
method clay provenance path ?path...?
+

Return either self if that path exists in the current object, or return the first class (if any) along the clay search path which contains that element.

+
method clay replace dictionary
+

Replace the contents of the internal clay storage with the dictionary given.

+
method clay source filename
+

Source the given filename within the object's namespace

+
method clay set path ?path...? value
+

Merge the conents of value with the object's clay storage at path.

+
method InitializePublic
+

Instantiate variables. Called on object creation and during clay mixin.

+
+
+

Class clay::object

+

clay::object + This class is inherited by all classes that have options.

+

Methods

+
+
method InitializePublic
+

Instantiate variables and build ensemble methods.

+
+
+
+ +

Bugs, Ideas, Feedback

+

This document, and the package it describes, will undoubtedly contain +bugs and other problems. +Please report such in the category oo of the +Tcllib Trackers. +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.

+
+ +

Category

+

Programming tools

+
+ +
ADDED embedded/www/tcllib/files/modules/math/trig.html Index: embedded/www/tcllib/files/modules/math/trig.html ================================================================== --- /dev/null +++ embedded/www/tcllib/files/modules/math/trig.html @@ -0,0 +1,339 @@ + +
+ +
[ + Main Table Of Contents +| Table Of Contents +| Keyword Index +| Categories +| Modules +| Applications + ]
+
+

math::trig(n) 1.0.0 tcllib "Tcl Math Library"

+

Name

+

math::trig - Trigonometric anf hyperbolic functions

+
+ + +

Description

+

The math::trig package defines a set of trigonomic and hyperbolic functions +and their inverses. In addition it defines versions of the trigonomic functions +that take arguments in degrees instead of radians.

+

For easy use these functions may be imported into the tcl::mathfunc namespace, +so that they can be used directly in the expr command.

+
+

FUNCTIONS

+

The functions radian_reduced and degree_reduced return a reduced angle, in +respectively radians and degrees, in the intervals [0, 2pi) and [0, 360):

+
+
::math::trig::radian_reduced angle
+

Return the equivalent angle in the interval [0, 2pi).

+
+
float angle
+

Angle (in radians)

+
+
::math::trig::degree_reduced angle
+

Return the equivalent angle in the interval [0, 360).

+
+
float angle
+

Angle (in degrees)

+
+
+

The following trigonomic functions are defined in addition to the ones defined +in the expr command:

+
+
::math::trig::cosec angle
+

Calculate the cosecant of the angle (1/cos(angle))

+
+
float angle
+

Angle (in radians)

+
+
::math::trig::sec angle
+

Calculate the secant of the angle (1/sin(angle))

+
+
float angle
+

Angle (in radians)

+
+
::math::trig::cotan angle
+

Calculate the cotangent of the angle (1/tan(angle))

+
+
float angle
+

Angle (in radians)

+
+
+

For these functions also the inverses are defined:

+
+
::math::trig::acosec value
+

Calculate the arc cosecant of the value

+
+
float value
+

Value of the argument

+
+
::math::trig::asec value
+

Calculate the arc secant of the value

+
+
float value
+

Value of the argument

+
+
::math::trig::acotan value
+

Calculate the arc cotangent of the value

+
+
float value
+

Value of the argument

+
+
+

The following hyperbolic and inverse hyperbolic functions are defined:

+
+
::math::trig::cosech value
+

Calculate the hyperbolic cosecant of the value (1/sinh(value))

+
+
float value
+

Value of the argument

+
+
::math::trig::sech value
+

Calculate the hyperbolic secant of the value (1/cosh(value))

+
+
float value
+

Value of the argument

+
+
::math::trig::cotanh value
+

Calculate the hyperbolic cotangent of the value (1/tanh(value))

+
+
float value
+

Value of the argument

+
+
::math::trig::asinh value
+

Calculate the arc hyperbolic sine of the value

+
+
float value
+

Value of the argument

+
+
::math::trig::acosh value
+

Calculate the arc hyperbolic cosine of the value

+
+
float value
+

Value of the argument

+
+
::math::trig::atanh value
+

Calculate the arc hyperbolic tangent of the value

+
+
float value
+

Value of the argument

+
+
::math::trig::acosech value
+

Calculate the arc hyperbolic cosecant of the value

+
+
float value
+

Value of the argument

+
+
::math::trig::asech value
+

Calculate the arc hyperbolic secant of the value

+
+
float value
+

Value of the argument

+
+
::math::trig::acotanh value
+

Calculate the arc hyperbolic cotangent of the value

+
+
float value
+

Value of the argument

+
+
+

The following versions of the common trigonometric functions and their +inverses are defined:

+
+
::math::trig::sind angle
+

Calculate the sine of the angle (in degrees)

+
+
float angle
+

Angle (in degrees)

+
+
::math::trig::cosd angle
+

Calculate the cosine of the angle (in degrees)

+
+
float angle
+

Angle (in radians)

+
+
::math::trig::tand angle
+

Calculate the cotangent of the angle (in degrees)

+
+
float angle
+

Angle (in degrees)

+
+
::math::trig::cosecd angle
+

Calculate the cosecant of the angle (in degrees)

+
+
float angle
+

Angle (in degrees)

+
+
::math::trig::secd angle
+

Calculate the secant of the angle (in degrees)

+
+
float angle
+

Angle (in degrees)

+
+
::math::trig::cotand angle
+

Calculate the cotangent of the angle (in degrees)

+
+
float angle
+

Angle (in degrees)

+
+
+
+

Bugs, Ideas, Feedback

+

This document, and the package it describes, will undoubtedly contain +bugs and other problems. +Please report such in the category math :: trig of the +Tcllib Trackers. +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.

+
+ +

Category

+

Mathematics

+
+ +
ADDED examples/httpd/htdocs/html_static_page.html Index: examples/httpd/htdocs/html_static_page.html ================================================================== --- /dev/null +++ examples/httpd/htdocs/html_static_page.html @@ -0,0 +1,5 @@ +
Static Content
+ +

Static Content

+This page is static content embedded in the file system. Nothing fancy. + Index: idoc/man/files/modules/clay/clay.n ================================================================== --- idoc/man/files/modules/clay/clay.n +++ idoc/man/files/modules/clay/clay.n @@ -1,10 +1,10 @@ '\" '\" Generated from file 'clay\&.man' by tcllib/doctools with format 'nroff' '\" Copyright (c) 2018 Sean Woods '\" -.TH "clay" n 0\&.8\&.6 tcllib "Clay Framework" +.TH "clay" n 0\&.3 tcllib "Clay Framework" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. @@ -278,14 +278,10 @@ .sp package require \fBuuid \fR .sp package require \fBoo::dialect \fR .sp -proc \fBclay::PROC\fR \fIname\fR \fIarglist\fR \fIbody\fR ?\fIninja\fR \fB\fR? -.sp -proc \fBclay::_ancestors\fR \fIresultvar\fR \fIclass\fR -.sp proc \fBclay::ancestors\fR ?\fIargs\fR? .sp proc \fBclay::args_to_dict\fR ?\fIargs\fR? .sp proc \fBclay::args_to_options\fR ?\fIargs\fR? @@ -298,129 +294,47 @@ .sp proc \fBclay::is_null\fR \fIvalue\fR .sp proc \fBclay::leaf\fR ?\fIargs\fR? .sp -proc \fBclay::K\fR \fIa\fR \fIb\fR -.sp -proc \fBclay::noop\fR ?\fIargs\fR? -.sp -proc \fBclay::cleanup\fR -.sp -proc \fBclay::object_create\fR \fIobjname\fR ?\fIclass\fR \fB\fR? -.sp -proc \fBclay::object_rename\fR \fIobject\fR \fInewname\fR -.sp -proc \fBclay::object_destroy\fR ?\fIargs\fR? -.sp proc \fBclay::path\fR ?\fIargs\fR? .sp -proc \fBclay::putb\fR ?\fImap\fR? \fItext\fR -.sp proc \fBclay::script_path\fR .sp proc \fBclay::NSNormalize\fR \fIqualname\fR .sp proc \fBclay::uuid_generate\fR ?\fIargs\fR? .sp -proc \fBclay::uuid::generate_tcl_machinfo\fR -.sp -proc \fBclay::uuid::tostring\fR \fIuuid\fR -.sp -proc \fBclay::uuid::fromstring\fR \fIuuid\fR -.sp -proc \fBclay::uuid::equal\fR \fIleft\fR \fIright\fR -.sp -proc \fBclay::uuid\fR \fIcmd\fR ?\fIargs\fR? -.sp -proc \fBclay::tree::sanitize\fR \fIdict\fR -.sp -proc \fBclay::tree::_sanitizeb\fR \fIpath\fR \fIvarname\fR \fIdict\fR -.sp -proc \fBclay::tree::storage\fR \fIrawpath\fR -.sp -proc \fBclay::tree::dictset\fR \fIvarname\fR ?\fIargs\fR? -.sp -proc \fBclay::tree::dictmerge\fR \fIvarname\fR ?\fIargs\fR? -.sp -proc \fBclay::tree::merge\fR ?\fIargs\fR? -.sp -proc \fBdictargs::proc\fR \fIname\fR \fIargspec\fR \fIbody\fR -.sp -proc \fBdictargs::method\fR \fIname\fR \fIargspec\fR \fIbody\fR -.sp -proc \fBclay::dialect::Push\fR \fIclass\fR -.sp -proc \fBclay::dialect::Peek\fR -.sp -proc \fBclay::dialect::Pop\fR -.sp -proc \fBclay::dialect::create\fR \fIname\fR ?\fIparent\fR \fB\fR? -.sp -proc \fBclay::dialect::NSNormalize\fR \fInamespace\fR \fIqualname\fR -.sp -proc \fBclay::dialect::DefineThunk\fR \fItarget\fR ?\fIargs\fR? -.sp -proc \fBclay::dialect::Canonical\fR \fInamespace\fR \fINSpace\fR \fIclass\fR -.sp -proc \fBclay::dialect::Define\fR \fInamespace\fR \fIclass\fR ?\fIargs\fR? -.sp -proc \fBclay::dialect::Aliases\fR \fInamespace\fR ?\fIargs\fR? -.sp -proc \fBclay::dialect::SuperClass\fR \fInamespace\fR ?\fIargs\fR? -.sp proc \fBclay::dynamic_methods\fR \fIclass\fR .sp proc \fBclay::dynamic_methods_class\fR \fIthisclass\fR .sp proc \fBclay::define::Array\fR \fIname\fR ?\fIvalues\fR \fB\fR? .sp -proc \fBclay::define::Delegate\fR \fIname\fR \fIinfo\fR +proc \fBclay::define::component\fR \fIname\fR \fIinfo\fR .sp proc \fBclay::define::constructor\fR \fIarglist\fR \fIrawbody\fR .sp -proc \fBclay::define::Class_Method\fR \fIname\fR \fIarglist\fR \fIbody\fR -.sp proc \fBclay::define::class_method\fR \fIname\fR \fIarglist\fR \fIbody\fR .sp proc \fBclay::define::clay\fR ?\fIargs\fR? .sp proc \fBclay::define::destructor\fR \fIrawbody\fR .sp proc \fBclay::define::Dict\fR \fIname\fR ?\fIvalues\fR \fB\fR? .sp -proc \fBclay::define::Option\fR \fIname\fR ?\fIargs\fR? -.sp -proc \fBclay::define::Method\fR \fIname\fR \fIargstyle\fR \fIargspec\fR \fIbody\fR -.sp -proc \fBclay::define::Option_Class\fR \fIname\fR ?\fIargs\fR? -.sp proc \fBclay::define::Variable\fR \fIname\fR ?\fIdefault\fR \fB\fR? +.sp +proc \fBclay::object_create\fR \fIobjname\fR ?\fIclass\fR \fB\fR? +.sp +proc \fBclay::object_rename\fR \fIobject\fR \fInewname\fR +.sp +proc \fBclay::object_destroy\fR \fIobjname\fR .sp proc \fBclay::ensemble_methodbody\fR \fIensemble\fR \fIeinfo\fR .sp -proc \fBclay::define::Ensemble\fR \fIrawmethod\fR ?\fIargs\fR? -.sp -proc \fBclay::event::cancel\fR \fIself\fR ?\fItask\fR \fB*\fR? -.sp -proc \fBclay::event::generate\fR \fIself\fR \fIevent\fR ?\fIargs\fR? -.sp -proc \fBclay::event::nextid\fR -.sp -proc \fBclay::event::Notification_list\fR \fIself\fR \fIevent\fR ?\fIstackvar\fR \fB\fR? -.sp -proc \fBclay::event::notify\fR \fIrcpt\fR \fIsender\fR \fIevent\fR \fIeventinfo\fR -.sp -proc \fBclay::event::process\fR \fIself\fR \fIhandle\fR \fIscript\fR -.sp -proc \fBclay::event::schedule\fR \fIself\fR \fIhandle\fR \fIinterval\fR \fIscript\fR -.sp -proc \fBclay::event::subscribe\fR \fIself\fR \fIwho\fR \fIevent\fR -.sp -proc \fBclay::event::unsubscribe\fR \fIself\fR ?\fIargs\fR? -.sp -proc \fBclay::singleton\fR \fIname\fR \fIscript\fR +proc \fBclay::define::Ensemble\fR \fIrawmethod\fR \fIarglist\fR \fIbody\fR .sp method \fBclay ancestors\fR .sp method \fBclay dump\fR .sp @@ -438,12 +352,10 @@ .sp method \fBclay set\fR \fIpath\fR ?\fBpath\&.\&.\&.\fR? \fIvalue\fR .sp method \fBclay ancestors\fR .sp -method \fBclay cache\fR \fIpath\fR \fIvalue\fR -.sp method \fBclay cget\fR \fIfield\fR .sp method \fBclay delegate\fR ?\fIstub\fR? ?\fIobject\fR? .sp method \fBclay dump\fR @@ -472,15 +384,15 @@ .sp method \fBclay provenance\fR \fIpath\fR ?\fBpath\&.\&.\&.\fR? .sp method \fBclay replace\fR \fIdictionary\fR .sp -method \fBclay search\fR \fIpath\fR \fIvaluevar\fR \fIisleafvar\fR -.sp method \fBclay source\fR \fIfilename\fR .sp method \fBclay set\fR \fIpath\fR ?\fBpath\&.\&.\&.\fR? \fIvalue\fR +.sp +method \fBInitializePublic\fR .sp method \fBInitializePublic\fR .sp .BE .SH DESCRIPTION @@ -597,20 +509,10 @@ 1 .CE .SH COMMANDS .TP -proc \fBclay::PROC\fR \fIname\fR \fIarglist\fR \fIbody\fR ?\fIninja\fR \fB\fR? -Because many features in this package may be added as -commands to future tcl cores, or be provided in binary -form by packages, I need a declaritive way of saying -\fICreate this command if there isn't one already\fR\&. -The \fIninja\fR argument is a script to execute if the -command is created by this mechanism\&. -.TP -proc \fBclay::_ancestors\fR \fIresultvar\fR \fIclass\fR -.TP proc \fBclay::ancestors\fR ?\fIargs\fR? .TP proc \fBclay::args_to_dict\fR ?\fIargs\fR? .TP proc \fBclay::args_to_options\fR ?\fIargs\fR? @@ -623,288 +525,59 @@ .TP proc \fBclay::is_null\fR \fIvalue\fR .TP proc \fBclay::leaf\fR ?\fIargs\fR? .TP -proc \fBclay::K\fR \fIa\fR \fIb\fR -.TP -proc \fBclay::noop\fR ?\fIargs\fR? -Perform a noop\&. Useful in prototyping for commenting out blocks -of code without actually having to comment them out\&. It also makes -a handy default for method delegation if a delegate has not been -assigned yet\&. -.TP -proc \fBclay::cleanup\fR -Process the queue of objects to be destroyed -.TP -proc \fBclay::object_create\fR \fIobjname\fR ?\fIclass\fR \fB\fR? -.TP -proc \fBclay::object_rename\fR \fIobject\fR \fInewname\fR -.TP -proc \fBclay::object_destroy\fR ?\fIargs\fR? -Mark an objects for destruction on the next cleanup -.TP proc \fBclay::path\fR ?\fIargs\fR? .TP -proc \fBclay::putb\fR ?\fImap\fR? \fItext\fR -Append a line of text to a variable\&. Optionally apply a string mapping\&. -.TP proc \fBclay::script_path\fR .TP proc \fBclay::NSNormalize\fR \fIqualname\fR .TP proc \fBclay::uuid_generate\fR ?\fIargs\fR? .TP -proc \fBclay::uuid::generate_tcl_machinfo\fR -.TP -proc \fBclay::uuid::tostring\fR \fIuuid\fR -.TP -proc \fBclay::uuid::fromstring\fR \fIuuid\fR -Convert a string representation of a uuid into its binary format\&. -.TP -proc \fBclay::uuid::equal\fR \fIleft\fR \fIright\fR -Compare two uuids for equality\&. -.TP -proc \fBclay::uuid\fR \fIcmd\fR ?\fIargs\fR? -uuid generate -> string rep of a new uuid -uuid equal uuid1 uuid2 -.TP -proc \fBclay::tree::sanitize\fR \fIdict\fR -Output a dictionary removing any \&. entries added by \fBclay::tree::merge\fR -.TP -proc \fBclay::tree::_sanitizeb\fR \fIpath\fR \fIvarname\fR \fIdict\fR -Helper function for ::clay::tree::sanitize -Formats the string representation for a dictionary element within -a human readable stream of lines, and determines if it needs to call itself -with further indentation to express a sub-branch -.TP -proc \fBclay::tree::storage\fR \fIrawpath\fR -Return the path as a storage path for clay::tree -with all branch terminators removed\&. -This command will also break arguments up if they -contain /\&. -.sp -Example: -.CS - - > clay::tree::storage {foo bar baz bang} - foo bar baz bang - > clay::tree::storage {foo bar baz bang/} - foo bar baz bang - > clay::tree::storage {foo bar baz bang:} - foo bar baz bang: - > clay::tree::storage {foo/bar/baz bang:} - foo bar baz bang: - > clay::tree::storage {foo/bar/baz/bang} - foo bar baz bang - - - -.CE -.TP -proc \fBclay::tree::dictset\fR \fIvarname\fR ?\fIargs\fR? -Set an element with a recursive dictionary, -marking all branches on the way down to the -final element\&. -If the value does not exists in the nested dictionary -it is added as a leaf\&. If the value already exists as a branch -the value given is merged if the value is a valid dict\&. If the -incoming value is not a valid dict, the value overrides the value -stored, and the value is treated as a leaf from then on\&. -.sp -Example: -.CS - - > set r {} - > ::clay::tree::dictset r option color default Green - \&. {} option {\&. {} color {\&. {} default Green}} - > ::clay::tree::dictset r option {Something not dictlike} - \&. {} option {Something not dictlike} - # Note that if the value is not a dict, and you try to force it to be - # an error with be thrown on the merge - > ::clay::tree::dictset r option color default Blue - missing value to go with key - - - -.CE -.TP -proc \fBclay::tree::dictmerge\fR \fIvarname\fR ?\fIargs\fR? -A recursive form of dict merge, intended for modifying variables in place\&. -.sp -Example: -.CS - - > set mydict {sub/ {sub/ {description {a block of text}}}} - > ::clay::tree::dictmerge mydict {sub/ {sub/ {field {another block of text}}}}] - > clay::tree::print $mydict - sub/ { - sub/ { - description {a block of text} - field {another block of text} - } - } - - - -.CE -.TP -proc \fBclay::tree::merge\fR ?\fIargs\fR? -A recursive form of dict merge -.sp -A routine to recursively dig through dicts and merge -adapted from http://stevehavelka\&.com/tcl-dict-operation-nested-merge/ -.sp -Example: -.CS - - > set mydict {sub/ {sub/ {description {a block of text}}}} - > set odict [clay::tree::merge $mydict {sub/ {sub/ {field {another block of text}}}}] - > clay::tree::print $odict - sub/ { - sub/ { - description {a block of text} - field {another block of text} - } - } - - - -.CE -.TP -proc \fBdictargs::proc\fR \fIname\fR \fIargspec\fR \fIbody\fR -Named Procedures as new command -.TP -proc \fBdictargs::method\fR \fIname\fR \fIargspec\fR \fIbody\fR -.TP -proc \fBclay::dialect::Push\fR \fIclass\fR -.TP -proc \fBclay::dialect::Peek\fR -.TP -proc \fBclay::dialect::Pop\fR -.TP -proc \fBclay::dialect::create\fR \fIname\fR ?\fIparent\fR \fB\fR? -This proc will generate a namespace, a "mother of all classes", and a -rudimentary set of policies for this dialect\&. -.TP -proc \fBclay::dialect::NSNormalize\fR \fInamespace\fR \fIqualname\fR -Support commands; not intended to be called directly\&. -.TP -proc \fBclay::dialect::DefineThunk\fR \fItarget\fR ?\fIargs\fR? -.TP -proc \fBclay::dialect::Canonical\fR \fInamespace\fR \fINSpace\fR \fIclass\fR -.TP -proc \fBclay::dialect::Define\fR \fInamespace\fR \fIclass\fR ?\fIargs\fR? -Implementation of the languages' define command -.TP -proc \fBclay::dialect::Aliases\fR \fInamespace\fR ?\fIargs\fR? -.TP -proc \fBclay::dialect::SuperClass\fR \fInamespace\fR ?\fIargs\fR? -.TP proc \fBclay::dynamic_methods\fR \fIclass\fR .TP proc \fBclay::dynamic_methods_class\fR \fIthisclass\fR .TP proc \fBclay::define::Array\fR \fIname\fR ?\fIvalues\fR \fB\fR? New OO Keywords for clay .TP -proc \fBclay::define::Delegate\fR \fIname\fR \fIinfo\fR -An annotation that objects of this class interact with delegated -methods\&. The annotation is intended to be a dictionary, and the -only reserved key is \fIdescription\fR, a human readable description\&. +proc \fBclay::define::component\fR \fIname\fR \fIinfo\fR .TP proc \fBclay::define::constructor\fR \fIarglist\fR \fIrawbody\fR .TP -proc \fBclay::define::Class_Method\fR \fIname\fR \fIarglist\fR \fIbody\fR -Specify the a method for the class object itself, instead of for objects of the class -.TP proc \fBclay::define::class_method\fR \fIname\fR \fIarglist\fR \fIbody\fR -And alias to the new Class_Method keyword .TP proc \fBclay::define::clay\fR ?\fIargs\fR? .TP proc \fBclay::define::destructor\fR \fIrawbody\fR .TP proc \fBclay::define::Dict\fR \fIname\fR ?\fIvalues\fR \fB\fR? .TP -proc \fBclay::define::Option\fR \fIname\fR ?\fIargs\fR? -Define an option for the class -.TP -proc \fBclay::define::Method\fR \fIname\fR \fIargstyle\fR \fIargspec\fR \fIbody\fR -.TP -proc \fBclay::define::Option_Class\fR \fIname\fR ?\fIargs\fR? -Define a class of options -All field / value pairs will be be inherited by an option that -specify \fIname\fR as it class field\&. -.TP proc \fBclay::define::Variable\fR \fIname\fR ?\fIdefault\fR \fB\fR? This keyword can also be expressed: .CS property variable NAME {default DEFAULT} .CE .sp Variables registered in the variable property are also initialized (if missing) when the object changes class via the \fImorph\fR method\&. +.TP +proc \fBclay::object_create\fR \fIobjname\fR ?\fIclass\fR \fB\fR? +.TP +proc \fBclay::object_rename\fR \fIobject\fR \fInewname\fR +.TP +proc \fBclay::object_destroy\fR \fIobjname\fR .TP proc \fBclay::ensemble_methodbody\fR \fIensemble\fR \fIeinfo\fR -Produce the body of an ensemble's public dispatch method -ensemble is the name of the the ensemble\&. -einfo is a dictionary of methods for the ensemble, and each value is a script -to execute on dispatch -.sp -Example: -.CS - - ::clay::ensemble_methodbody foo { - bar {tailcall my Foo_bar {*}$args} - baz {tailcall my Foo_baz {*}$args} - clock {return [clock seconds]} - default {puts "You gave me $method"} - } - - - -.CE -.TP -proc \fBclay::define::Ensemble\fR \fIrawmethod\fR ?\fIargs\fR? -.TP -proc \fBclay::event::cancel\fR \fIself\fR ?\fItask\fR \fB*\fR? -Cancel a scheduled event -.TP -proc \fBclay::event::generate\fR \fIself\fR \fIevent\fR ?\fIargs\fR? -Generate an event -Adds a subscription mechanism for objects -to see who has recieved this event and prevent -spamming or infinite recursion -.TP -proc \fBclay::event::nextid\fR -.TP -proc \fBclay::event::Notification_list\fR \fIself\fR \fIevent\fR ?\fIstackvar\fR \fB\fR? -Called recursively to produce a list of -who recieves notifications -.TP -proc \fBclay::event::notify\fR \fIrcpt\fR \fIsender\fR \fIevent\fR \fIeventinfo\fR -Final delivery to intended recipient object -.TP -proc \fBclay::event::process\fR \fIself\fR \fIhandle\fR \fIscript\fR -Evaluate an event script in the global namespace -.TP -proc \fBclay::event::schedule\fR \fIself\fR \fIhandle\fR \fIinterval\fR \fIscript\fR -Schedule an event to occur later -.TP -proc \fBclay::event::subscribe\fR \fIself\fR \fIwho\fR \fIevent\fR -Subscribe an object to an event pattern -.TP -proc \fBclay::event::unsubscribe\fR \fIself\fR ?\fIargs\fR? -Unsubscribe an object from an event pattern -.TP -proc \fBclay::singleton\fR \fIname\fR \fIscript\fR -An object which is intended to be it's own class\&. +.TP +proc \fBclay::define::Ensemble\fR \fIrawmethod\fR \fIarglist\fR \fIbody\fR .PP .SH CLASSES -.SS "CLASS CLAY::CLASS" +.SS "CLASS OO::CLASS" .PP \fBMethods\fR .TP method \fBclay ancestors\fR Return this class and all ancestors in search order\&. @@ -940,22 +613,17 @@ .TP method \fBclay set\fR \fIpath\fR ?\fBpath\&.\&.\&.\fR? \fIvalue\fR Merge the conents of \fBvalue\fR with the object's clay storage at \fBpath\fR\&. .PP .PP -.SS "CLASS CLAY::OBJECT" -clay::object -This class is inherited by all classes that have options\&. +.SS "CLASS OO::OBJECT" .PP \fBMethods\fR .TP method \fBclay ancestors\fR Return the class this object belongs to, all classes mixed into this object, and all ancestors of those classes in search order\&. .TP -method \fBclay cache\fR \fIpath\fR \fIvalue\fR -Store VALUE in such a way that request in SEARCH for PATH will always return it until the cache is flushed -.TP method \fBclay cget\fR \fIfield\fR Pull a value from either the object's clay structure or one of its constituent classes that matches the field name\&. The order of search us: .sp 1\&. The as a value in local dict variable config @@ -1027,22 +695,29 @@ Return either \fBself\fR if that path exists in the current object, or return the first class (if any) along the clay search path which contains that element\&. .TP method \fBclay replace\fR \fIdictionary\fR Replace the contents of the internal clay storage with the dictionary given\&. .TP -method \fBclay search\fR \fIpath\fR \fIvaluevar\fR \fIisleafvar\fR -Return true, and set valuevar to the value and isleafar to true for false if PATH was found in the cache\&. -.TP method \fBclay source\fR \fIfilename\fR Source the given filename within the object's namespace .TP method \fBclay set\fR \fIpath\fR ?\fBpath\&.\&.\&.\fR? \fIvalue\fR Merge the conents of \fBvalue\fR with the object's clay storage at \fBpath\fR\&. .TP method \fBInitializePublic\fR Instantiate variables\&. Called on object creation and during clay mixin\&. .PP +.PP +.SS "CLASS CLAY::OBJECT" +clay::object +This class is inherited by all classes that have options\&. +.PP +\fBMethods\fR +.TP +method \fBInitializePublic\fR +Instantiate variables and build ensemble methods\&. +.PP .PP .SH AUTHORS Sean Woods \fImailto:\fR .PP .SH "BUGS, IDEAS, FEEDBACK" Index: idoc/man/files/modules/cron/cron.n ================================================================== --- idoc/man/files/modules/cron/cron.n +++ idoc/man/files/modules/cron/cron.n Index: idoc/man/files/modules/dicttool/dicttool.n ================================================================== --- idoc/man/files/modules/dicttool/dicttool.n +++ idoc/man/files/modules/dicttool/dicttool.n @@ -1,10 +1,10 @@ '\" '\" Generated from file 'dicttool\&.man' by tcllib/doctools with format 'nroff' -'\" Copyright (c) 2017 Sean Woods +'\" Copyright (c) 2018 Sean Woods '\" -.TH "dicttool" n 1\&.0 tcllib "Extensions to the standard "dict" command" +.TH "dicttool" n 1\&.2 tcllib "Extensions to the standard "dict" command" .\" The -*- nroff -*- definitions below are for supplemental macros used .\" in Tcl/Tk manual entries. .\" .\" .AP type name in/out ?indent? .\" Start paragraph describing an argument to a library procedure. @@ -295,64 +295,288 @@ .PP The \fBdicttool\fR package enhances the standard \fIdict\fR command with several new commands\&. In addition, the package also defines several "creature comfort" list commands as well\&. Each command checks to see if a command already exists of the same name before adding itself, just in case any of these slip into the core\&. +.SH COMMANDS +.TP +proc \fBPROC\fR \fIname\fR \fIarglist\fR \fIbody\fR ?\fIninja\fR \fB\fR? +Because many features in this package may be added as +commands to future tcl cores, or be provided in binary +form by packages, I need a declaritive way of saying +\fICreate this command if there isn't one already\fR\&. +The \fIninja\fR argument is a script to execute if the +command is created by this mechanism\&. +.TP +proc \fBnoop\fR ?\fIargs\fR? +Perform a noop\&. Useful in prototyping for commenting out blocks +of code without actually having to comment them out\&. It also makes +a handy default for method delegation if a delegate has not been +assigned yet\&. +.TP +proc \fBputb\fR ?\fImap\fR? \fItext\fR +Append a line of text to a variable\&. Optionally apply a string mapping\&. +.TP +proc \fBtcl::dict::getnull\fR \fIdictionary\fR ?\fIelement\fR? ?\fBelement\&.\&.\&.\fR? +If the path (given by the list of elements) exists, return that value\&. +Otherwise return an empty string\&. Designed to replace +.CS + + + if {[dict exists $dictionary {*}$args]} { + return [dict get $dictionary {*}$args] + } else { + return {} + } + +.CE +.sp +Example: +.CS + + set value [dict getnull $arglist $option] + +.CE +.TP +proc \fBtcl::dict::is_dict\fR \fId\fR +Test if value is a dict\&. +.sp +This command is added to the \fBdict\fR ensemble as \fBdict is_dict\fR +.TP +proc \fBdicttool::is_branch\fR \fIdict\fR \fIpath\fR +Return true if the element with the value +is a dict\&. is given as a list to descend into sub-dicts of +the current dict\&. +The rules are as follows: +.RS +.IP [1] +If the last character of the last element of is a colon (:) +return false +.IP [2] +If the last character of the last element of is a slash (/) +return true +.IP [3] +If a sub-element if named \fB\&.info\fR is present return true +.RE +.sp +.sp +This command is added to the \fBdict\fR ensemble as \fBdicttool::is_branch\fR +.sp +Example: +.CS + + > set mydict {sub/ {sub/ {field {A block of text}}} + > dicttool::is_branch $mydict sub/ + 1 + > dicttool::is_branch $mydict {sub/ sub/} + 1 + > dicttool::is_branch $mydict {sub/ sub/ field} + 0 + + + +.CE +.TP +proc \fBdicttool::print\fR \fIdict\fR +Output a dictionary as an indented stream of +data suitable for output to the screen\&. The system uses +the rules for \fBdicttool::is_branch\fR to determine if +an value in a dictionary is a leaf or a branch\&. +.sp +Example: +.CS + + > set mydict {sub/ {sub/ {field {A block of text}}} + > dicttool::print $mydict + sub/ { + sub/ { + field {A block of text} + } + } + + + +.CE +.TP +proc \fBdicttool::_dictputb\fR \fIlevel\fR \fIvarname\fR \fIdict\fR +Helper function for ::dicttool::print +Formats the string representation for a dictionary element within +a human readable stream of lines, and determines if it needs to call itself +with further indentation to express a sub-branch +.TP +proc \fBdicttool::sanitize\fR \fIdict\fR +Output a dictionary removing any \&. entries added by \fBdicttool::merge\fR +.TP +proc \fBdicttool::_sanitizeb\fR \fIpath\fR \fIvarname\fR \fIdict\fR +Helper function for ::dicttool::sanitize +Formats the string representation for a dictionary element within +a human readable stream of lines, and determines if it needs to call itself +with further indentation to express a sub-branch +.TP +proc \fBdicttool::canonical\fR \fIrawpath\fR +Return the path as a canonical path for dicttool +with all branch keys +ending in a / and the final element ending in a / +if the final element in the path ended in a / +This command will also break arguments up if they +contain /\&. +.sp +Example: +.CS + + > dicttool::canonical foo bar baz bang + foo/ bar/ baz/ bang + > dicttool::canonical foo bar baz bang/ + foo/ bar/ baz/ bang/ + > dicttool::canonical foo bar baz bang: + foo/ bar/ baz/ bang + > dicttool::canonical foo/bar/baz bang: + foo/ bar/ baz/ bang + > dicttool::canonical foo/bar/baz/bang + foo/ bar/ baz/ bang + + + +.CE +.TP +proc \fBdicttool::storage\fR \fIrawpath\fR +Return the path as a storage path for dicttool +with all branch terminators removed\&. +This command will also break arguments up if they +contain /\&. +.sp +Example: +.CS + + > dicttool::storage foo bar baz bang + foo bar baz bang + > dicttool::storage foo bar baz bang/ + foo bar baz bang + > dicttool::storage foo bar baz bang: + foo bar baz bang + > dicttool::storage foo/bar/baz bang: + foo bar baz bang + > dicttool::storage foo/bar/baz/bang + foo bar baz bang + + + +.CE +.TP +proc \fBdicttool::dictset\fR \fIvarname\fR ?\fIargs\fR? +Set an element with a recursive dictionary, +marking all branches on the way down to the +final element\&. +If the value does not exists in the nested dictionary +it is added as a leaf\&. If the value already exists as a branch +the value given is merged if the value is a valid dict\&. If the +incoming value is not a valid dict, the value overrides the value +stored, and the value is treated as a leaf from then on\&. +.sp +Example: +.CS + + > set r {} + > ::dicttool::dictset r option color default Green + \&. 1 option {\&. 1 color {\&. 1 default Green}} + > ::dicttool::dictset r option {Something not dictlike} + \&. 1 option {Something not dictlike} + # Note that if the value is not a dict, and you try to force it to be + # an error with be thrown on the merge + > ::dicttool::dictset r option color default Blue + missing value to go with key + + + +.CE +.TP +proc \fBdicttool::dictmerge\fR \fIvarname\fR ?\fIargs\fR? +A recursive form of dict merge, intended for modifying variables in place\&. +.sp +Example: +.CS + + > set mydict {sub/ {sub/ {description {a block of text}}}} + > ::dicttool::dictmerge mydict {sub/ {sub/ {field {another block of text}}}}] + > dicttool::print $mydict + sub/ { + sub/ { + description {a block of text} + field {another block of text} + } + } + + + +.CE .TP -\fBladd\fR \fIvarname\fR \fIargs\fR -This command will add a new instance of each element in \fIargs\fR to \fIvarname\fR, but only if that element -is not already present\&. +proc \fBdicttool::merge\fR ?\fIargs\fR? +A recursive form of dict merge +.sp +A routine to recursively dig through dicts and merge +adapted from http://stevehavelka\&.com/tcl-dict-operation-nested-merge/ +.sp +Example: +.CS + + > set mydict {sub/ {sub/ {description {a block of text}}}} + > set odict [dicttool::merge $mydict {sub/ {sub/ {field {another block of text}}}}] + > dicttool::print $odict + sub/ { + sub/ { + description {a block of text} + field {another block of text} + } + } + + + +.CE .TP \fBldelete\fR \fIvarname\fR \fIargs\fR This command will delete all instances of each element in \fIargs\fR from \fIvarname\fR\&. .TP -\fBdict getnull\fR \fIargs\fR -Operates like \fBdict get\fR, however if the key \fIargs\fR does not exist, it returns an empty -list instead of throwing an error\&. -.TP -\fBdict print\fR \fIdict\fR -This command will produce a string representation of \fIdict\fR, with each nested branch on -a newline, and indented with two spaces for every level\&. -.TP -\fBdict is_dict\fR \fIvalue\fR -This command will return true if \fIvalue\fR can be interpreted as a dict\&. The command operates in -such a way as to not force an existing dict representation to shimmer into another internal rep\&. -.TP -\fBrmerge\fR \fIargs\fR -Return a dict which is the product of a recursive merge of all of the arguments\&. Unlike \fBdict merge\fR, -this command descends into all of the levels of a dict\&. Dict keys which end in a : indicate a leaf, which -will be interpreted as a literal value, and not descended into further\&. -.CS - - - -set items [dict merge { - option {color {default: green}} -} { - option {fruit {default: mango}} -} { - option {color {default: blue} fruit {widget: select values: {mango apple cherry grape}}} -}] -puts [dict print $items] - -.CE -.IP -Prints the following result: -.CS - - -option { - color { - default: blue - } - fruit { - widget: select - values: {mango apple cherry grape} - } -} - -.CE +proc \fBladd\fR \fIvarname\fR ?\fIelement\fR? ?\fBelement\&.\&.\&.\fR? +Add elements to a list if that are not already present in the list\&. +As a side effect, if variable does not exists, +create it as an empty list\&. +.sp +Example: +.CS + + ladd contents foo bar + puts $contents + > foo bar + ladd contents foo bar baz bang + puts $contents + > foo bar baz bang + + + +.CE +.TP +proc \fBldelete\fR \fIvarname\fR ?\fIelement\fR? ?\fBelement\&.\&.\&.\fR? +Delete all instances of the elements given from a list contained in \&. +If the variable does exist this is a noop\&. +.sp +Example: +.CS + + set contents {foo bar baz bang foo foo foo} + ldelete contents foo + puts $contents + > bar baz bang + + + +.CE +.TP +proc \fBlrandom\fR \fIlist\fR +Return a random element from +.PP +.SH AUTHORS +Sean Woods \fImailto:\fR .PP .SH "BUGS, IDEAS, FEEDBACK" This document, and the package it describes, will undoubtedly contain bugs and other problems\&. Please report such in the category \fIdict\fR of the @@ -371,8 +595,8 @@ dict .SH CATEGORY Utilities .SH COPYRIGHT .nf -Copyright (c) 2017 Sean Woods +Copyright (c) 2018 Sean Woods .fi Index: idoc/man/files/modules/doctools/cvs.n ================================================================== --- idoc/man/files/modules/doctools/cvs.n +++ idoc/man/files/modules/doctools/cvs.n Index: idoc/man/files/modules/doctools/doctools_lang_intro.n ================================================================== --- idoc/man/files/modules/doctools/doctools_lang_intro.n +++ idoc/man/files/modules/doctools/doctools_lang_intro.n Index: idoc/man/files/modules/fumagic/cfront.n ================================================================== --- idoc/man/files/modules/fumagic/cfront.n +++ idoc/man/files/modules/fumagic/cfront.n @@ -299,13 +299,15 @@ runtime package\&. For the generator backed used by this compiler see the package \fBfileutil::magic::cgen\fR\&. .SH COMMANDS .TP \fB::fileutil::magic::cfront::compile\fR \fIpath\fR\&.\&.\&. -This command takes the paths of one or more files and directories and -compiles all the files, and the files in all the directories into a -single recognizer for all the file types specified in these files\&. +This command takes the paths of one or more files and directories and compiles +all the files, and the files in all the directories into a single analyzer for +all the file types specified in these files\&. It returns a list whose first +item is a list per-file dictionaries of analyzer scripts and whose second item +is a list of analyzer commands\&. .sp All the files have to be in the format specified by magic(5)\&. .sp The result of the command is a Tcl script containing the generated recognizer\&. Index: idoc/man/files/modules/fumagic/rtcore.n ================================================================== --- idoc/man/files/modules/fumagic/rtcore.n +++ idoc/man/files/modules/fumagic/rtcore.n @@ -279,39 +279,29 @@ .sp \fB::fileutil::magic::rt::>\fR .sp \fB::fileutil::magic::rt::<\fR .sp -\fB::fileutil::magic::rt::open\fR \fIfilename\fR -.sp -\fB::fileutil::magic::rt::close\fR +\fB::fileutil::magic::rt::new\fR \fIchan\fR \fInamed\fR \fIanalyze\fR .sp \fB::fileutil::magic::rt::file_start\fR \fIname\fR .sp -\fB::fileutil::magic::rt::result\fR ?\fImsg\fR? -.sp -\fB::fileutil::magic::rt::resultv\fR ?\fImsg\fR? -.sp \fB::fileutil::magic::rt::emit\fR \fImsg\fR .sp -\fB::fileutil::magic::rt::offset\fR \fIwhere\fR -.sp -\fB::fileutil::magic::rt::Nv\fR \fItype\fR \fIoffset\fR ?\fIqual\fR? -.sp -\fB::fileutil::magic::rt::N\fR \fItype\fR \fIoffset\fR \fIcomp\fR \fIval\fR ?\fIqual\fR? -.sp -\fB::fileutil::magic::rt::Nvx\fR \fItype\fR \fIoffset\fR ?\fIqual\fR? -.sp -\fB::fileutil::magic::rt::Nx\fR \fItype\fR \fIoffset\fR \fIcomp\fR \fIval\fR ?\fIqual\fR? -.sp -\fB::fileutil::magic::rt::S\fR \fIoffset\fR \fIcomp\fR \fIval\fR ?\fIqual\fR? -.sp -\fB::fileutil::magic::rt::Sx\fR \fIoffset\fR \fIcomp\fR \fIval\fR ?\fIqual\fR? +\fB::fileutil::magic::rt::O\fR \fIwhere\fR +.sp +\fB::fileutil::magic::rt::R\fR \fIwhere\fR +.sp +\fB::fileutil::magic::rt::Nv\fR \fItype\fR \fIoffset\fR \fIcompinvert\fR \fIcomp\fR \fIexpected\fR +.sp +\fB::fileutil::magic::rt::N\fR \fItype\fR \fIoffset\fR \fItestinvert\fR \fIcompinvert\fR \fImod\fR \fImand\fR \fIcomp\fR \fIexpected\fR +.sp +\fB::fileutil::magic::rt::S\fR \fItype\fR \fIoffset\fR \fItestinvert\fR \fImod\fR \fImand\fR \fIcomp\fR \fIval\fR .sp \fB::fileutil::magic::rt::L\fR \fInewlevel\fR .sp -\fB::fileutil::magic::rt::I\fR \fIbase\fR \fItype\fR \fIdelta\fR +\fB::fileutil::magic::rt::I\fR \fIoffset\fR \fIit\fR \fIioi\fR \fIioo\fR \fIiir\fR \fIio\fR .sp \fB::fileutil::magic::rt::R\fR \fIoffset\fR .sp \fB::fileutil::magic::rt::U\fR \fIfileindex\fR \fIname\fR .sp @@ -318,62 +308,35 @@ .BE .SH DESCRIPTION .PP This package provides the runtime core for file type recognition engines written in pure Tcl and is thus used by all other packages in -this module, i\&.e\&. the two frontend packages -\fBfileutil::magic::mimetypes\fR and -\fBfileutil::magic::filetypes\fR, and the two engine compiler +this module such as \fBfileutil::magic::filetype\fR and the two compiler packages \fBfileutil::magic::cgen\fR and \fBfileutil::magic::cfront\fR\&. .SH COMMANDS .TP \fB::fileutil::magic::rt::>\fR -Shorthand for \fBincr level\fR\&. +Increment the level and perform related housekeeping .TP \fB::fileutil::magic::rt::<\fR -Shorthand for \fBincr level -1\fR\&. -.TP -\fB::fileutil::magic::rt::open\fR \fIfilename\fR -This command initializes the runtime and prepares the file -\fIfilename\fR for use by the system\&. -This command has to be invoked first, before any other command of this -package\&. -.sp -The command returns the channel handle of the opened file as its -result\&. -.TP -\fB::fileutil::magic::rt::close\fR -This command closes the last file opened via -\fB::fileutil::magic::rt::open\fR and shuts the runtime down\&. -This command has to be invoked last, after the file has been dealt -with completely\&. -Afterward another invokation of \fB::fileutil::magic::rt::open\fR is -required to process another file\&. -.sp -This command returns the empty string as its result\&. +Decrement the level and perform related housekeeping +.TP +\fB::fileutil::magic::rt::new\fR \fIchan\fR \fInamed\fR \fIanalyze\fR +Create a new command which returns one description of the file each time it is +called, and a code of \fIbreak\fR when there are no more descriptions\&. +\fIchan\fR is the channel containing the data to describe\&. The channel +configuration is then managed as needed\&. +\fInamed\fR is a dictionary of named tests, as generated by +\fBfileutil::magic::cfront::compile\fR\&. +\fItest\fR is a command prefix for a routine composed of the list of commands +as returned by \fBfileutil::magic::cfront::compile\fR\&. .TP \fB::fileutil::magic::rt::file_start\fR \fIname\fR This command marks the start of a magic file when debugging\&. It returns the empty string as its result\&. .TP -\fB::fileutil::magic::rt::result\fR ?\fImsg\fR? -This command returns the current result and stops processing\&. -.sp -If \fImsg\fR is specified its text is added to the result before it is -returned\&. See \fB::fileutil::magic::rt::emit\fR for the allowed -special character sequences\&. -.TP -\fB::fileutil::magic::rt::resultv\fR ?\fImsg\fR? -This command returns the current result\&. -In contrast to \fB::fileutil::magic::rt::result\fR processing -continues\&. -.sp -If \fImsg\fR is specified its text is added to the result before it is -returned\&. See \fB::fileutil::magic::rt::emit\fR for the allowed -special character sequences\&. -.TP \fB::fileutil::magic::rt::emit\fR \fImsg\fR This command adds the text \fImsg\fR to the result buffer\&. The message may contain the following special character sequences\&. They will be replaced with buffered values before the message is added to the result\&. The command returns the empty string as its result\&. @@ -388,103 +351,61 @@ \fB%ld\fR Replaced with the last buffered numeric value\&. .TP \fB%d\fR See above\&. -.RE -.TP -\fB::fileutil::magic::rt::Nv\fR \fItype\fR \fIoffset\fR ?\fIqual\fR? -This command fetches the numeric value with \fItype\fR from the -absolute location \fIoffset\fR and returns it as its result\&. The -fetched value is further stored in the numeric buffer\&. -.sp -If \fIqual\fR is specified it is considered to be a mask and applied -to the fetched value before it is stored and returned\&. It has to have -the form of a partial Tcl bit-wise expression, i\&.e\&. -.CS - - - & number - -.CE -.IP -For example: -.CS - - - Nv lelong 0 &0x8080ffff - -.CE -.IP -For the possible types see section \fBNUMERIC TYPES\fR\&. -.TP -\fB::fileutil::magic::rt::N\fR \fItype\fR \fIoffset\fR \fIcomp\fR \fIval\fR ?\fIqual\fR? -This command behaves mostly like \fB::fileutil::magic::rt::Nv\fR, -except that it compares the fetched and masked value against \fIval\fR -as specified with \fIcomp\fR and returns the result of that -comparison\&. -.sp -The argument \fIcomp\fR has to contain one of Tcl's comparison -operators, and the comparison made will be -.CS - - - +.TP +\fB${x:\&.\&.\&.?\&.\&.\&.}\fR +Substitute one string if the file is executable, and +another string otherwise\&. +.RE +.TP +\fB::fileutil::magic::rt::O\fR \fIwhere\fR +Produce an offset from \fIwhere\fR, relative to the cursor one level up\&. +Produce an offset from \fIwhere\fR, relative to the offset one level up\&. +.TP +\fB::fileutil::magic::rt::Nv\fR \fItype\fR \fIoffset\fR \fIcompinvert\fR \fIcomp\fR \fIexpected\fR +A limited form of \fB::fileutile::magic::rt::N\fR that only checks for +equality and can't be told to invert the test\&. +.TP +\fB::fileutil::magic::rt::N\fR \fItype\fR \fIoffset\fR \fItestinvert\fR \fIcompinvert\fR \fImod\fR \fImand\fR \fIcomp\fR \fIexpected\fR +Fetch the numeric value with \fItype\fR from the absolute location +\fIoffset\fR, compare it with \fIexpected\fR using \fIcomp\fR as the comparision +operator, and returns the result\&. +.sp +The argument \fIcomp\fR must be one of Tcl's comparison +operators\&. +.CS + + + .CE .sp The special comparison operator \fBx\fR signals that no comparison should be done, or, in other words, that the fetched value will always match \fIval\fR\&. .TP -\fB::fileutil::magic::rt::Nvx\fR \fItype\fR \fIoffset\fR ?\fIqual\fR? -This command behaves like \fB::fileutil::magic::rt::Nv\fR, except that -it additionally remembers the location in the file after the fetch in -the calling context, for the current level, for later use by -\fB::fileutil::magic::rt::R\fR\&. -.TP -\fB::fileutil::magic::rt::Nx\fR \fItype\fR \fIoffset\fR \fIcomp\fR \fIval\fR ?\fIqual\fR? -This command behaves like \fB::fileutil::magic::rt::N\fR, except that -it additionally remembers the location in the file after the fetch in -the calling context, for the current, for later use by -\fB::fileutil::magic::rt::R\fR\&. -.TP -\fB::fileutil::magic::rt::S\fR \fIoffset\fR \fIcomp\fR \fIval\fR ?\fIqual\fR? -This command behaves like \fB::fileutil::magic::rt::N\fR, except that -it fetches and compares strings, not numeric data\&. The fetched value -is also stored in the internal string buffer instead of the numeric -buffer\&. -.TP -\fB::fileutil::magic::rt::Sx\fR \fIoffset\fR \fIcomp\fR \fIval\fR ?\fIqual\fR? -This command behaves like \fB::fileutil::magic::rt::S\fR, except that -it additionally remembers the location in the file after the fetch in -the calling context, for the current level, for later use by -\fB::fileutil::magic::rt::R\fR\&. +\fB::fileutil::magic::rt::S\fR \fItype\fR \fIoffset\fR \fItestinvert\fR \fImod\fR \fImand\fR \fIcomp\fR \fIval\fR +Like \fB::fileutil::magic::rt::N\fR except that it fetches and compares string +types , not numeric data\&. .TP \fB::fileutil::magic::rt::L\fR \fInewlevel\fR -This command sets the current level in the calling context to +Sets the current level in the calling context to \fInewlevel\fR\&. The command returns the empty string as its result\&. .TP -\fB::fileutil::magic::rt::I\fR \fIbase\fR \fItype\fR \fIdelta\fR -This command handles base locations specified indirectly through the -contents of the inspected file\&. It returns the sum of \fIdelta\fR and -the value of numeric \fItype\fR fetched from the absolute location -\fIbase\fR\&. -.sp -For the possible types see section \fBNUMERIC TYPES\fR\&. +\fB::fileutil::magic::rt::I\fR \fIoffset\fR \fIit\fR \fIioi\fR \fIioo\fR \fIiir\fR \fIio\fR +Calculates an offset based on an initial offset and the provided modifiers\&. .TP \fB::fileutil::magic::rt::R\fR \fIoffset\fR -This command handles base locations specified relative to the end of -the last field one level above\&. +Given an initial offset, calculates an offset relative to the cursor at the +next level up\&. The cursor is the position in the data one character after the +data extracted from the file one level up\&. .sp -In other words, the command computes an absolute location in the file -based on the relative \fIoffset\fR and returns it as its result\&. The -base the offset is added to is the last location remembered for the -level in the calling context\&. .TP \fB::fileutil::magic::rt::U\fR \fIfileindex\fR \fIname\fR -Use a named test script at the current level\&. +Add a level and use a named test script\&. .PP .SH "NUMERIC TYPES" .TP \fBbyte\fR 8-bit integer Index: idoc/man/files/modules/htmlparse/htmlparse.n ================================================================== --- idoc/man/files/modules/htmlparse/htmlparse.n +++ idoc/man/files/modules/htmlparse/htmlparse.n Index: idoc/man/files/modules/httpd/httpd.n ================================================================== --- idoc/man/files/modules/httpd/httpd.n +++ idoc/man/files/modules/httpd/httpd.n @@ -275,10 +275,20 @@ httpd \- A TclOO and coroutine based web server .SH SYNOPSIS package require \fBTcl 8\&.6\fR .sp package require \fBuuid \fR +.sp +package require \fBsha1 \fR +.sp +package require \fBdicttool \fR +.sp +package require \fBoo::meta \fR +.sp +package require \fBoo::dialect \fR +.sp +package require \fBtool \fR .sp package require \fBclay \fR .sp package require \fBcoroutine \fR .sp Index: idoc/man/files/modules/ldap/ldap.n ================================================================== --- idoc/man/files/modules/ldap/ldap.n +++ idoc/man/files/modules/ldap/ldap.n Index: idoc/man/files/modules/ldap/ldapx.n ================================================================== --- idoc/man/files/modules/ldap/ldapx.n +++ idoc/man/files/modules/ldap/ldapx.n Index: idoc/man/files/modules/log/log.n ================================================================== --- idoc/man/files/modules/log/log.n +++ idoc/man/files/modules/log/log.n Index: idoc/man/files/modules/math/math_geometry.n ================================================================== --- idoc/man/files/modules/math/math_geometry.n +++ idoc/man/files/modules/math/math_geometry.n Index: idoc/man/files/modules/math/statistics.n ================================================================== --- idoc/man/files/modules/math/statistics.n +++ idoc/man/files/modules/math/statistics.n Index: idoc/man/files/modules/math/trig.n ================================================================== --- idoc/man/files/modules/math/trig.n +++ idoc/man/files/modules/math/trig.n Index: idoc/man/files/modules/mime/mime.n ================================================================== --- idoc/man/files/modules/mime/mime.n +++ idoc/man/files/modules/mime/mime.n @@ -270,245 +270,69 @@ .de MT .QW "" .. .BS .SH NAME -mime \- Manipulation of MIME body parts +mime \- Manipulation of Internet messages .SH SYNOPSIS package require \fBTcl 8\&.5\fR .sp package require \fBmime ?1\&.6\&.3?\fR .sp -\fB::mime::initialize\fR ?\fB-canonical\fR \fItype/subtype\fR ?\fB-param\fR {\fIkey value\fR}\&.\&.\&.? ?\fB-encoding\fR \fIvalue\fR? ?\fB-header\fR {\fIkey value\fR}\&.\&.\&.?? (\fB-file\fR \fIname\fR | \fB-string\fR \fIvalue\fR | \fB-parts\fR {\fItoken1\fR \&.\&.\&. \fItokenN\fR}) +\fB::mime::initialize\fR ?\fB-canonical\fR \fItype/subtype\fR? ?\fB-params\fR \fIdictionary\fR? ?\fB-encoding\fR \fIvalue\fR? ?\fB-headers\fR \fIdictionary\fR? ?(\fB-chan\fR \fIname\fR | \fB-file\fR \fIname\fR | \fB-string\fR \fIvalue\fR | \fB-parts\fR \fIparts\fR)? +.sp +\fB::mime::body\fR \fItoken\fR ?\fB-decode\fR? ?\fB-blocksize\fR \fIoctets\fR?" +.sp +\fB::mime::datetime\fR (\fItime\fR | \fB-now\fR) \fIproperty\fR .sp \fB::mime::finalize\fR \fItoken\fR ?\fB-subordinates\fR \fBall\fR | \fBdynamic\fR | \fBnone\fR? .sp -\fB::mime::getproperty\fR \fItoken\fR ?\fIproperty\fR | \fB-names\fR? -.sp -\fB::mime::getheader\fR \fItoken\fR ?\fIkey\fR | \fB-names\fR? -.sp -\fB::mime::setheader\fR \fItoken\fR \fIkey value\fR ?\fB-mode\fR \fBwrite\fR | \fBappend\fR | \fBdelete\fR? -.sp -\fB::mime::getbody\fR \fItoken\fR ?\fB-decode\fR? ?\fB-command\fR \fIcallback\fR ?\fB-blocksize\fR \fIoctets\fR?? -.sp -\fB::mime::copymessage\fR \fItoken\fR \fIchannel\fR -.sp -\fB::mime::buildmessage\fR \fItoken\fR -.sp -\fB::mime::parseaddress\fR \fIstring\fR -.sp -\fB::mime::parsedatetime\fR (\fIstring\fR | \fB-now\fR) \fIproperty\fR +\fB::mime::header\fR \fBserialize\fR \fIvalue\fR \fIparameters\fR +.sp +\fB::mime::header\fR \fBget\fR \fItoken\fR ?\fIkey\fR | \fB-names\fR? +.sp +\fB::mime::header\fR \fBset\fR \fItoken\fR \fIname value\fR ?\fIparameters\fR ?\fB-mode\fR \fBwrite\fR | \fBappend\fR | \fBdelete\fR?? +.sp +\fB::mime::property\fR \fItoken\fR ?\fIname\fR | \fB-names\fR? +.sp +\fB::mime::serialize\fR \fItoken\fR ?\fB-chan\fR \fIchannel\fR? +.sp +\fB::mime::parseaddress\fR \fIaddresses\fR .sp \fB::mime::mapencoding\fR \fIencoding_name\fR .sp \fB::mime::reversemapencoding\fR \fIcharset_type\fR .sp .BE .SH DESCRIPTION .PP -The \fBmime\fR library package provides the commands to create and -manipulate MIME body parts\&. -.TP -\fB::mime::initialize\fR ?\fB-canonical\fR \fItype/subtype\fR ?\fB-param\fR {\fIkey value\fR}\&.\&.\&.? ?\fB-encoding\fR \fIvalue\fR? ?\fB-header\fR {\fIkey value\fR}\&.\&.\&.?? (\fB-file\fR \fIname\fR | \fB-string\fR \fIvalue\fR | \fB-parts\fR {\fItoken1\fR \&.\&.\&. \fItokenN\fR}) -This command creates a MIME part and returns a token representing it\&. -.RS -.IP \(bu -If the \fB-canonical\fR option is present, then the body is in -canonical (raw) form and is found by consulting either the -\fB-file\fR, \fB-string\fR, or \fB-parts\fR option\&. -.sp -In addition, both the \fB-param\fR and \fB-header\fR options may -occur zero or more times to specify \fBContent-Type\fR parameters -(e\&.g\&., \fBcharset\fR) and header keyword/values (e\&.g\&., -\fBContent-Disposition\fR), respectively\&. -.sp -Also, \fB-encoding\fR, if present, specifies the -\fBContent-Transfer-Encoding\fR when copying the body\&. -.IP \(bu -If the \fB-canonical\fR option is not present, then the MIME part -contained in either the \fB-file\fR or the \fB-string\fR option -is parsed, dynamically generating subordinates as appropriate\&. -.RE -.TP -\fB::mime::finalize\fR \fItoken\fR ?\fB-subordinates\fR \fBall\fR | \fBdynamic\fR | \fBnone\fR? -This command destroys the MIME part represented by \fItoken\fR\&. It -returns an empty string\&. -.sp -If the \fB-subordinates\fR option is present, it specifies which -subordinates should also be destroyed\&. The default value is -\fBdynamic\fR, destroying all subordinates which were created by -\fB::mime::initialize\fR together with the containing body part\&. -.TP -\fB::mime::getproperty\fR \fItoken\fR ?\fIproperty\fR | \fB-names\fR? -This command returns a string or a list of strings containing the -properties of a MIME part\&. If the command is invoked with the name of -a specific property, then the corresponding value is returned; -instead, if \fB-names\fR is specified, a list of all properties is -returned; otherwise, a serialized array of properties and values is -returned\&. -.sp -The possible properties are: -.RS -.TP -\fBcontent\fR -The type/subtype describing the content -.TP -\fBencoding\fR -The "Content-Transfer-Encoding" -.TP -\fBparams\fR -A list of "Content-Type" parameters -.TP -\fBparts\fR -A list of tokens for the part's subordinates\&. This property is -present only if the MIME part has subordinates\&. -.TP -\fBsize\fR -The approximate size of the content (unencoded) -.RE -.TP -\fB::mime::getheader\fR \fItoken\fR ?\fIkey\fR | \fB-names\fR? -This command returns the header of a MIME part, as a list of strings\&. -.sp -A header consists of zero or more key/value pairs\&. Each value is a -list containing one or more strings\&. -.sp -If this command is invoked with the name of a specific \fIkey\fR, then -a list containing the corresponding value(s) is returned; instead, if --names is specified, a list of all keys is returned; otherwise, a -serialized array of keys and values is returned\&. Note that when a key -is specified (e\&.g\&., "Subject"), the list returned usually contains -exactly one string; however, some keys (e\&.g\&., "Received") often occur -more than once in the header, accordingly the list returned usually -contains more than one string\&. -.TP -\fB::mime::setheader\fR \fItoken\fR \fIkey value\fR ?\fB-mode\fR \fBwrite\fR | \fBappend\fR | \fBdelete\fR? -This command writes, appends to, or deletes the \fIvalue\fR associated -with a \fIkey\fR in the header\&. It returns a list of strings -containing the previous value associated with the key\&. -.sp -The value for \fB-mode\fR is one of: -.RS -.TP -\fBwrite\fR -The \fIkey\fR/\fIvalue\fR is either created or overwritten (the default)\&. -.TP -\fBappend\fR -A new \fIvalue\fR is appended for the \fIkey\fR (creating it as necessary)\&. -.TP -\fBdelete\fR -All values associated with the key are removed (the \fIvalue\fR -parameter is ignored)\&. -.RE -.TP -\fB::mime::getbody\fR \fItoken\fR ?\fB-decode\fR? ?\fB-command\fR \fIcallback\fR ?\fB-blocksize\fR \fIoctets\fR?? -This command returns a string containing the body of the leaf MIME -part represented by \fItoken\fR in canonical form\&. -.sp -If the \fB-command\fR option is present, then it is repeatedly -invoked with a fragment of the body as this: -.CS - - - uplevel #0 $callback [list "data" $fragment] - -.CE -.sp -(The \fB-blocksize\fR option, if present, specifies the maximum -size of each fragment passed to the callback\&.) -.sp -When the end of the body is reached, the callback is invoked as: -.CS - - - uplevel #0 $callback "end" - -.CE -.sp -Alternatively, if an error occurs, the callback is invoked as: -.CS - - - uplevel #0 $callback [list "error" reason] - -.CE -.sp -Regardless, the return value of the final invocation of the callback -is propagated upwards by \fB::mime::getbody\fR\&. -.sp -If the \fB-command\fR option is absent, then the return value of -\fB::mime::getbody\fR is a string containing the MIME part's entire -body\&. -.sp -If the option \fB-decode\fR is absent the return value computed -above is returned as is\&. This means that it will be in the charset -specified for the token and not the usual utf-8\&. -If the option \fB-decode\fR is present however the command will use -the charset information associated with the token to convert the -string from its encoding into utf-8 before returning it\&. -.TP -\fB::mime::copymessage\fR \fItoken\fR \fIchannel\fR -This command copies the MIME represented by \fItoken\fR part to the -specified \fIchannel\fR\&. The command operates synchronously, and uses -fileevent to allow asynchronous operations to proceed -independently\&. It returns an empty string\&. -.TP -\fB::mime::buildmessage\fR \fItoken\fR -This command returns the MIME part represented by \fItoken\fR as a -string\&. It is similar to \fB::mime::copymessage\fR, only it returns -the data as a return string instead of writing to a channel\&. -.TP -\fB::mime::parseaddress\fR \fIstring\fR -This command takes a string containing one or more 822-style address -specifications and returns a list of serialized arrays, one element -for each address specified in the argument\&. If the string contains -more than one address they will be separated by commas\&. -.sp -Each serialized array contains the properties below\&. Note that one or -more of these properties may be empty\&. -.RS -.TP -\fBaddress\fR -local@domain -.TP -\fBcomment\fR -822-style comment -.TP -\fBdomain\fR -the domain part (rhs) -.TP -\fBerror\fR -non-empty on a parse error -.TP -\fBgroup\fR -this address begins a group -.TP -\fBfriendly\fR -user-friendly rendering -.TP -\fBlocal\fR -the local part (lhs) -.TP -\fBmemberP\fR -this address belongs to a group -.TP -\fBphrase\fR -the phrase part -.TP -\fBproper\fR -822-style address specification -.TP -\fBroute\fR -822-style route specification (obsolete) -.RE -.TP -\fB::mime::parsedatetime\fR (\fIstring\fR | \fB-now\fR) \fIproperty\fR -This command takes a string containing an 822-style date-time -specification and returns the specified property as a serialized -array\&. -.sp -The list of properties and their ranges are: +Provides commands to create and manipulate Internet messages\&. +.TP +\fB::mime::initialize\fR ?\fB-canonical\fR \fItype/subtype\fR? ?\fB-params\fR \fIdictionary\fR? ?\fB-encoding\fR \fIvalue\fR? ?\fB-headers\fR \fIdictionary\fR? ?(\fB-chan\fR \fIname\fR | \fB-file\fR \fIname\fR | \fB-string\fR \fIvalue\fR | \fB-parts\fR \fIparts\fR)? +Parses a message and returns a token for the message\&. One of \fB-chan\fR, \fB-file\fR, or \fB-string\fR must be provided as the source of the input\&. If \fB-canonical\fR is provided the input is the body only and is already formatted according to +the provided \fItype/subtype\fR, and therefore should not be parsed\&. If \fIparts\fR is provided it is a list of tokens for messages that comprise a \fBmultipart/mixed\fR message body\&. \fB-params\fR is a multidict (a dictionary where the keys may not be unique) +of parameters for the \fBContent-Type\fR header\&. \fB-headers\fR is a multidict of headers\&. +.sp +\fB-encoding\fR sets the \fBContent-Transfer-Encoding\fR\&. +.TP +\fB::mime::body\fR \fItoken\fR ?\fB-decode\fR? ?\fB-blocksize\fR \fIoctets\fR?" +Returns as a string in canonical form the body of the message corresponding to +\fItoken\fR\&. +.sp +If \fB-blocksize\fR is provided, returns a command that itself returns up to +the next \fIoctets\fR of the message each time it's called, and returns a code +of \fBbreak\fR when finished, deleting itself as well\&. If \fIoctets\fR is +the empty string, a default value is used\&. Pauses the current coroutine as +needed to wait for input\&. +.sp +\fB-decode\fR converts the message body from the character set it is encoded +in\&. +.TP +\fB::mime::datetime\fR (\fItime\fR | \fB-now\fR) \fIproperty\fR +Returns the \fIproperty\fR of \fItime\fR, which 822-style date-time value\&. +.sp +Available properties and their ranges are: .RS .TP \fBhour\fR 0 \&.\&. 23 .TP @@ -552,18 +376,137 @@ 1900 \&.\&.\&. .TP \fBzone\fR -720 \&.\&. 720 (minutes east of GMT) .RE +.TP +\fB::mime::finalize\fR \fItoken\fR ?\fB-subordinates\fR \fBall\fR | \fBdynamic\fR | \fBnone\fR? +Destroys the message corresponding to \fItoken\fR and +returns the empty string\&. +.sp +\fB-subordinates\fR specifies which messages +comprising the body should also be destroyed\&. The default value is +\fBdynamic\fR, which destroys all component messages that were created by +\fB::mime::initialize\fR\&. +.TP +\fB::mime::header\fR \fBserialize\fR \fIvalue\fR \fIparameters\fR +Serialize a header\&. +.TP +\fB::mime::header\fR \fBget\fR \fItoken\fR ?\fIkey\fR | \fB-names\fR? +Returns the header of a message as a multidict +where each value is a list containing the header value and any parameters for +that value\&. +.sp +If \fIname\fR is provided returns a list of values for that name, without +regard to case\&. +.sp +If \fB-names\fR is provided, returns a list of all header names\&. +.TP +\fB::mime::header\fR \fBset\fR \fItoken\fR \fIname value\fR ?\fIparameters\fR ?\fB-mode\fR \fBwrite\fR | \fBappend\fR | \fBdelete\fR?? +If \fBappend\fR is provided, creates a new header named \fIname\fR with the +value of \fIvalue\fR is added\&. +If \fBwrite\fR is provided, deletes any existing headers whose names match +\fIkey\fR and then creates a new header named \fIkey\fR with the value of +\fIvalue\fR\&. +If \fBdelete\fR is provided, deletes any existing header having a name that matches +\fIkey\fR\&. +\fIparameters\fR is a dictionary of parameters for the header\&. +Returns a list of strings containing the previous value associated with the +key\&. +.sp +The value for \fB-mode\fR is one of: +.RS +.TP +\fBwrite\fR +The \fIkey\fR/\fIvalue\fR is either created or overwritten (the default)\&. +.TP +\fBappend\fR +Appends a new \fIkey\fR/\fIvalue\fR\&. +.TP +\fBdelete\fR +Removes all values associated with the key\&. \fIvalue\fR is ignored\&. +.RE +.TP +\fB::mime::property\fR \fItoken\fR ?\fIname\fR | \fB-names\fR? +Returns a dictionary of message properties\&. If \fIname\fR is provided, only +the corresponding value is returned\&. If \fB-names\fR is provided, a list +of all property names is returned\&. +.sp +properties: +.RS +.TP +\fBcontent\fR +The type/subtype of the content +.TP +\fBencoding\fR +The "Content-Transfer-Encoding" +.TP +\fBparams\fR +A list of "Content-Type" parameters +.TP +\fBparts\fR +A list of tokens for messages that should comprise a multipart body\&. Only exists if +there are any such messages\&. +.TP +\fBsize\fR +The approximate size of the unencoded content\&. +.RE +.TP +\fB::mime::serialize\fR \fItoken\fR ?\fB-chan\fR \fIchannel\fR? +Return the serialization of the message corresponding to \fItoken\fR\&. If +\fB-chan\fR is provided, write the message to \fIchannel\fR and return the +empty string\&. Pauses the current coroutine as needed to wait for input to +become available\&. +.TP +\fB::mime::parseaddress\fR \fIaddresses\fR +Returns a list of describing the comma-separated 822-style \fIaddresses\fR\&. +.sp +Each dictionary contains the following keys, whose values may be the empty +string: +.RS +.TP +\fBaddress\fR +local@domain +.TP +\fBcomment\fR +822-style comment +.TP +\fBdomain\fR +the domain part (rhs) +.TP +\fBerror\fR +non-empty on a parse error +.TP +\fBgroup\fR +this address begins a group +.TP +\fBfriendly\fR +user-friendly rendering +.TP +\fBlocal\fR +the local part (lhs) +.TP +\fBmemberP\fR +this address belongs to a group +.TP +\fBphrase\fR +the phrase part +.TP +\fBproper\fR +822-style address specification +.TP +\fBroute\fR +822-style route specification (obsolete) +.RE .TP \fB::mime::mapencoding\fR \fIencoding_name\fR -This commansd maps tcl encodings onto the proper names for their MIME +Maps Tcl encodings onto the proper names for their MIME charset type\&. This is only done for encodings whose charset types were known\&. The remaining encodings return "" for now\&. .TP \fB::mime::reversemapencoding\fR \fIcharset_type\fR -This command maps MIME charset types onto tcl encoding names\&. Those +Maps MIME charset types onto tcl encoding names\&. Those that are unknown return ""\&. .PP .SH "KNOWN BUGS" .TP Tcllib Bug #447037 Index: idoc/man/files/modules/namespacex/namespacex.n ================================================================== --- idoc/man/files/modules/namespacex/namespacex.n +++ idoc/man/files/modules/namespacex/namespacex.n @@ -296,10 +296,12 @@ .sp \fB::namespacex normalize\fR \fInamespace\fR .sp \fB::namespacex info vars\fR \fInamespace\fR ?\fIpattern\fR? .sp +\fB::namespacex normalize\fR \fInamespace\fR +.sp \fB::namespacex state get\fR \fInamespace\fR .sp \fB::namespacex state set\fR \fInamespace\fR \fIdict\fR .sp \fB::namespacex state drop\fR \fInamespace\fR @@ -403,10 +405,14 @@ the specified \fInamespace\fR\&. If the \fIpattern\fR argument is specified, then only variables matching \fIpattern\fR are returned\&. Matching is determined using the same rules as for \fBstring match\fR\&. .TP +\fB::namespacex normalize\fR \fInamespace\fR +Returns the absolute name of \fInamespace\fR, which is resolved relative +to the namespace of the caller, with all unneeded colon characters removed\&. +.TP \fB::namespacex state get\fR \fInamespace\fR Returns a dictionary holding the names and values of all variables in the specified \fInamespace\fR and its child namespaces\&. .sp Note that the names are all relative to \fInamespace\fR, and Index: idoc/man/files/modules/nns/nns_client.n ================================================================== --- idoc/man/files/modules/nns/nns_client.n +++ idoc/man/files/modules/nns/nns_client.n Index: idoc/man/files/modules/nns/nns_server.n ================================================================== --- idoc/man/files/modules/nns/nns_server.n +++ idoc/man/files/modules/nns/nns_server.n Index: idoc/man/files/modules/oometa/oometa.n ================================================================== --- idoc/man/files/modules/oometa/oometa.n +++ idoc/man/files/modules/oometa/oometa.n @@ -354,11 +354,11 @@ .CS ::oo::meta::info $myclass set option color {default: green widget: colorselect} puts [::oo::meta::info $myclass get option color] -> {default: green widget: color} +> {default green widget color} puts [::oo::meta::info $myclass branchget option color] > {default green widget color} .CE .TP Index: idoc/man/files/modules/pop3d/pop3d.n ================================================================== --- idoc/man/files/modules/pop3d/pop3d.n +++ idoc/man/files/modules/pop3d/pop3d.n Index: idoc/man/files/modules/pt/pt_peg_op.n ================================================================== --- idoc/man/files/modules/pt/pt_peg_op.n +++ idoc/man/files/modules/pt/pt_peg_op.n Index: idoc/man/files/modules/smtpd/smtpd.n ================================================================== --- idoc/man/files/modules/smtpd/smtpd.n +++ idoc/man/files/modules/smtpd/smtpd.n Index: idoc/man/files/modules/stooop/switched.n ================================================================== --- idoc/man/files/modules/stooop/switched.n +++ idoc/man/files/modules/stooop/switched.n Index: idoc/man/files/modules/tepam/tepam_doc_gen.n ================================================================== --- idoc/man/files/modules/tepam/tepam_doc_gen.n +++ idoc/man/files/modules/tepam/tepam_doc_gen.n Index: idoc/man/files/modules/tepam/tepam_procedure.n ================================================================== --- idoc/man/files/modules/tepam/tepam_procedure.n +++ idoc/man/files/modules/tepam/tepam_procedure.n Index: idoc/man/files/modules/textutil/adjust.n ================================================================== --- idoc/man/files/modules/textutil/adjust.n +++ idoc/man/files/modules/textutil/adjust.n Index: idoc/man/files/modules/websocket/websocket.n ================================================================== --- idoc/man/files/modules/websocket/websocket.n +++ idoc/man/files/modules/websocket/websocket.n Index: idoc/man/index.n ================================================================== --- idoc/man/index.n +++ idoc/man/index.n @@ -11267,10 +11267,16 @@ \fBfiles/modules/page/page_util_norm_lemon\&.n\fR page_util_norm_lemon .TP \fBfiles/modules/page/page_util_norm_peg\&.n\fR page_util_norm_peg +.RE +trigonometry +.RS +.TP +\fBfiles/modules/math/trig\&.n\fR +math::trig .RE trigonometry .RS .TP \fBfiles/modules/math/trig\&.n\fR Index: idoc/man/toc.n ================================================================== --- idoc/man/toc.n +++ idoc/man/toc.n @@ -875,11 +875,11 @@ .TP \fBmd5crypt\fR \fIfiles/modules/md5crypt/md5crypt\&.n\fR: MD5-based password encryption .TP \fBmime\fR -\fIfiles/modules/mime/mime\&.n\fR: Manipulation of MIME body parts +\fIfiles/modules/mime/mime\&.n\fR: Manipulation of Internet messages .TP \fBmpexpand\fR \fIfiles/modules/doctools/mpexpand\&.n\fR: Markup processor .TP \fBmultiplexer\fR Index: idoc/www/index.html ================================================================== --- idoc/www/index.html +++ idoc/www/index.html @@ -2914,74 +2914,74 @@ proc lambda - + procedure deleg_proc · tepam · tepam::procedure - + procedure documentation tepam::doc_gen - + processman processman - + producer hook - + profile profiler - + projection mapproj - + prospero uri - + protocol asn · ldap · ldapx · nameserv::protocol · pop3d · pop3d::dbox · pop3d::udb - + proxy autoproxy - + public key cipher pki - + publisher hook - + push down automaton grammar::me_intro · grammar::peg · grammar::peg::interp · pt · pt::ast · pt::cparam::configuration::critcl · pt::cparam::configuration::tea · pt::json_language · pt::param · pt::pe · pt::pe::op · pt::peg · pt::peg::container · pt::peg::container::peg · pt::peg::export · pt::peg::export::container · pt::peg::export::json · pt::peg::export::peg · pt::peg::from::container · pt::peg::from::json · pt::peg::from::peg · pt::peg::import · pt::peg::import::container · pt::peg::import::json · pt::peg::import::peg · pt::peg::interp · pt::peg::to::container · pt::peg::to::cparam · pt::peg::to::json · pt::peg::to::param · pt::peg::to::peg · pt::peg::to::tclparam · pt::peg_language · pt::pegrammar · pt::pgen · pt::rde · pt::tclparam::configuration::nx · pt::tclparam::configuration::snit · pt::tclparam::configuration::tcloo · pt::util · pt_export_api · pt_import_api · pt_introduction · pt_parse_peg · pt_parser_api · pt_peg_op Keywords: Q - + quasi-random math::quasirandom Index: idoc/www/tcllib/files/modules/clay/clay.html ================================================================== --- idoc/www/tcllib/files/modules/clay/clay.html +++ idoc/www/tcllib/files/modules/clay/clay.html @@ -1,5 +1,6 @@ + clay - Clay Framework -
[ Tcllib Home @@ -105,20 +105,22 @@ | Categories | Modules | Applications ]

Description

The dicttool package enhances the standard dict command with several new commands. In addition, the package also defines several "creature comfort" list commands as well. Each command checks to see if a command already exists of the same name before adding itself, just in case any of these slip into the core.

+
+

Commands

ladd varname args

This command will add a new instance of each element in args to varname, but only if that element is not already present.

ldelete varname args
@@ -161,35 +178,198 @@
rmerge args

Return a dict which is the product of a recursive merge of all of the arguments. Unlike dict merge, this command descends into all of the levels of a dict. Dict keys which end in a : indicate a leaf, which will be interpreted as a literal value, and not descended into further.

-set items [dict merge {
-  option {color {default: green}}
-} {
-  option {fruit {default: mango}}
-} {
-  option {color {default: blue} fruit {widget: select values: {mango apple cherry grape}}}
-}]
-puts [dict print $items]
+ if {[dict exists $dictionary {*}$args]} {
+   return [dict get $dictionary {*}$args]
+ } else {
+   return {}
+ }
+ 
+

Example:

+
 set value [dict getnull $arglist $option]
+
+
+
proc tcl::dict::is_dict d
+

Test if value is a dict.

+

This command is added to the dict ensemble as dict is_dict

+
proc dicttool::is_branch dict path
+

Return true if the element with the value + is a dict. is given as a list to descend into sub-dicts of + the current dict. + The rules are as follows:

+
    + +
  1. If the last character of the last element of is a colon (:) + return false

  2. +
  3. If the last character of the last element of is a slash (/) + return true

  4. +
  5. If a sub-element if named .info is present return true

  6. +
+

This command is added to the dict ensemble as dicttool::is_branch

+

Example:

+
 > set mydict {sub/ {sub/ {field {A block of text}}}
+ > dicttool::is_branch $mydict sub/
+ 1
+ > dicttool::is_branch $mydict {sub/ sub/}
+ 1
+ > dicttool::is_branch $mydict {sub/ sub/ field}
+ 0
+
+
+
proc dicttool::print dict
+

Output a dictionary as an indented stream of + data suitable for output to the screen. The system uses + the rules for dicttool::is_branch to determine if + an value in a dictionary is a leaf or a branch.

+

Example:

+
 > set mydict {sub/ {sub/ {field {A block of text}}}
+ > dicttool::print $mydict
+ sub/ {
+   sub/ {
+     field {A block of text}
+   }
+ }
+
+
+
proc dicttool::_dictputb level varname dict
+

Helper function for ::dicttool::print + Formats the string representation for a dictionary element within + a human readable stream of lines, and determines if it needs to call itself + with further indentation to express a sub-branch

+
proc dicttool::sanitize dict
+

Output a dictionary removing any . entries added by dicttool::merge

+
proc dicttool::_sanitizeb path varname dict
+

Helper function for ::dicttool::sanitize + Formats the string representation for a dictionary element within + a human readable stream of lines, and determines if it needs to call itself + with further indentation to express a sub-branch

+
proc dicttool::canonical rawpath
+

Return the path as a canonical path for dicttool + with all branch keys + ending in a / and the final element ending in a / + if the final element in the path ended in a / + This command will also break arguments up if they + contain /.

+

Example:

+
 > dicttool::canonical foo bar baz bang
+ foo/ bar/ baz/ bang
+ > dicttool::canonical foo bar baz bang/
+ foo/ bar/ baz/ bang/
+ > dicttool::canonical foo bar baz bang:
+ foo/ bar/ baz/ bang
+ > dicttool::canonical foo/bar/baz bang:
+ foo/ bar/ baz/ bang
+ > dicttool::canonical foo/bar/baz/bang
+ foo/ bar/ baz/ bang
+
+
+
proc dicttool::storage rawpath
+

Return the path as a storage path for dicttool + with all branch terminators removed. + This command will also break arguments up if they + contain /.

+

Example:

+
 > dicttool::storage foo bar baz bang
+ foo bar baz bang
+ > dicttool::storage foo bar baz bang/
+ foo bar baz bang
+ > dicttool::storage foo bar baz bang:
+ foo bar baz bang
+ > dicttool::storage foo/bar/baz bang:
+ foo bar baz bang
+ > dicttool::storage foo/bar/baz/bang
+ foo bar baz bang
+
+
+
proc dicttool::dictset varname ?args?
+

Set an element with a recursive dictionary, + marking all branches on the way down to the + final element. + If the value does not exists in the nested dictionary + it is added as a leaf. If the value already exists as a branch + the value given is merged if the value is a valid dict. If the + incoming value is not a valid dict, the value overrides the value + stored, and the value is treated as a leaf from then on.

+

Example:

+
 > set r {}
+ > ::dicttool::dictset r option color default Green
+ . 1 option {. 1 color {. 1 default Green}}
+ > ::dicttool::dictset r option {Something not dictlike}
+ . 1 option {Something not dictlike}
+ # Note that if the value is not a dict, and you try to force it to be
+ # an error with be thrown on the merge
+ > ::dicttool::dictset r option color default Blue
+ missing value to go with key
+
+
+
proc dicttool::dictmerge varname ?args?
+

A recursive form of dict merge, intended for modifying variables in place.

+

Example:

+
 > set mydict {sub/ {sub/ {description {a block of text}}}}
+ > ::dicttool::dictmerge mydict {sub/ {sub/ {field {another block of text}}}}]
+ > dicttool::print $mydict
+ sub/ {
+   sub/ {
+     description {a block of text}
+     field {another block of text}
+   }
+ }
+
+
+
proc dicttool::merge ?args?
+

A recursive form of dict merge

+

A routine to recursively dig through dicts and merge + adapted from http://stevehavelka.com/tcl-dict-operation-nested-merge/

+

Example:

+
 > set mydict {sub/ {sub/ {description {a block of text}}}}
+ > set odict [dicttool::merge $mydict {sub/ {sub/ {field {another block of text}}}}]
+ > dicttool::print $odict
+ sub/ {
+   sub/ {
+     description {a block of text}
+     field {another block of text}
+   }
+ }
+
+
+
proc tcl::dict::isnull dictionary ?args?
+

Returns true if the path specified by args either does not exist, + if exists and contains an empty string or the value of NULL or null.

+

This function is added to the global dict ensemble as dict isnull

+
proc ladd varname ?element? ?element...?
+

Add elements to a list if that are not already present in the list. + As a side effect, if variable does not exists, + create it as an empty list.

+

Example:

+
 ladd contents foo bar
+ puts $contents
+ > foo bar
+ ladd contents foo bar baz bang
+ puts $contents
+ > foo bar baz bang
 
-

Prints the following result:

-
-option {
-  color {
-    default: blue
-  }
-  fruit {
-    widget: select
-    values: {mango apple cherry grape}
-  }
-}
+
+
proc ldelete varname ?element? ?element...?
+

Delete all instances of the elements given from a list contained in . + If the variable does exist this is a noop.

+

Example:

+
 set contents {foo bar baz bang foo foo foo}
+ ldelete contents foo
+ puts $contents
+ > bar baz bang
 
+
proc lrandom list
+

Return a random element from

-

Bugs, Ideas, Feedback

+ +

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category dict of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either @@ -206,8 +386,8 @@

Category

Utilities

Index: idoc/www/tcllib/files/modules/fumagic/cfront.html ================================================================== --- idoc/www/tcllib/files/modules/fumagic/cfront.html +++ idoc/www/tcllib/files/modules/fumagic/cfront.html @@ -145,13 +145,15 @@ the package fileutil::magic::cgen.

COMMANDS

::fileutil::magic::cfront::compile path...
-

This command takes the paths of one or more files and directories and -compiles all the files, and the files in all the directories into a -single recognizer for all the file types specified in these files.

+

This command takes the paths of one or more files and directories and compiles +all the files, and the files in all the directories into a single analyzer for +all the file types specified in these files. It returns a list whose first +item is a list per-file dictionaries of analyzer scripts and whose second item +is a list of analyzer commands.

All the files have to be in the format specified by magic(5).

The result of the command is a Tcl script containing the generated recognizer.

::fileutil::magic::cfront::procdef procname path...

This command behaves like ::fileutil::magic::cfront::compile Index: idoc/www/tcllib/files/modules/fumagic/rtcore.html ================================================================== --- idoc/www/tcllib/files/modules/fumagic/rtcore.html +++ idoc/www/tcllib/files/modules/fumagic/rtcore.html @@ -129,76 +129,51 @@

  • package require fileutil::magic::rt ?2.0?
  • Description

    This package provides the runtime core for file type recognition engines written in pure Tcl and is thus used by all other packages in -this module, i.e. the two frontend packages -fileutil::magic::mimetypes and -fileutil::magic::filetypes, and the two engine compiler +this module such as fileutil::magic::filetype and the two compiler packages fileutil::magic::cgen and fileutil::magic::cfront.

    COMMANDS

    ::fileutil::magic::rt::>
    -

    Shorthand for incr level.

    +

    Increment the level and perform related housekeeping

    ::fileutil::magic::rt::<
    -

    Shorthand for incr level -1.

    -
    ::fileutil::magic::rt::open filename
    -

    This command initializes the runtime and prepares the file -filename for use by the system. -This command has to be invoked first, before any other command of this -package.

    -

    The command returns the channel handle of the opened file as its -result.

    -
    ::fileutil::magic::rt::close
    -

    This command closes the last file opened via -::fileutil::magic::rt::open and shuts the runtime down. -This command has to be invoked last, after the file has been dealt -with completely. -Afterward another invokation of ::fileutil::magic::rt::open is -required to process another file.

    -

    This command returns the empty string as its result.

    -
    ::fileutil::magic::rt::file_start name
    +

    Decrement the level and perform related housekeeping

    +
    ::fileutil::magic::rt::new chan named analyze
    +

    Create a new command which returns one description of the file each time it is +called, and a code of break when there are no more descriptions. +chan is the channel containing the data to describe. The channel +configuration is then managed as needed. +named is a dictionary of named tests, as generated by +fileutil::magic::cfront::compile. +test is a command prefix for a routine composed of the list of commands +as returned by fileutil::magic::cfront::compile.

    +
    ::fileutil::magic::rt::file_start name

    This command marks the start of a magic file when debugging. It returns the empty string as its result.

    -
    ::fileutil::magic::rt::result ?msg?
    -

    This command returns the current result and stops processing.

    -

    If msg is specified its text is added to the result before it is -returned. See ::fileutil::magic::rt::emit for the allowed -special character sequences.

    -
    ::fileutil::magic::rt::resultv ?msg?
    -

    This command returns the current result. -In contrast to ::fileutil::magic::rt::result processing -continues.

    -

    If msg is specified its text is added to the result before it is -returned. See ::fileutil::magic::rt::emit for the allowed -special character sequences.

    -
    ::fileutil::magic::rt::emit msg
    +
    ::fileutil::magic::rt::emit msg

    This command adds the text msg to the result buffer. The message may contain the following special character sequences. They will be replaced with buffered values before the message is added to the result. The command returns the empty string as its result.

    @@ -208,77 +183,46 @@

    Replaced with the last buffered string value.

    %ld

    Replaced with the last buffered numeric value.

    %d

    See above.

    -
    -
    ::fileutil::magic::rt::Nv type offset ?qual?
    -

    This command fetches the numeric value with type from the -absolute location offset and returns it as its result. The -fetched value is further stored in the numeric buffer.

    -

    If qual is specified it is considered to be a mask and applied -to the fetched value before it is stored and returned. It has to have -the form of a partial Tcl bit-wise expression, i.e.

    -
    -	& number
    -
    -

    For example:

    -
    -	Nv lelong 0 &0x8080ffff
    -
    -

    For the possible types see section NUMERIC TYPES.

    -
    ::fileutil::magic::rt::N type offset comp val ?qual?
    -

    This command behaves mostly like ::fileutil::magic::rt::Nv, -except that it compares the fetched and masked value against val -as specified with comp and returns the result of that -comparison.

    -

    The argument comp has to contain one of Tcl's comparison -operators, and the comparison made will be

    -
    -	<val> <comp> <fetched-and-masked-value>
    +
    ${x:...?...}
    +

    Substitute one string if the file is executable, and +another string otherwise.

    +
    +
    ::fileutil::magic::rt::O where
    +

    Produce an offset from where, relative to the cursor one level up. +Produce an offset from where, relative to the offset one level up.

    +
    ::fileutil::magic::rt::Nv type offset compinvert comp expected
    +

    A limited form of ::fileutile::magic::rt::N that only checks for +equality and can't be told to invert the test.

    +
    ::fileutil::magic::rt::N type offset testinvert compinvert mod mand comp expected
    +

    Fetch the numeric value with type from the absolute location +offset, compare it with expected using comp as the comparision +operator, and returns the result.

    +

    The argument comp must be one of Tcl's comparison +operators.

    +
    +	<comp> <fetched-and-masked-value> <comp> <expected>
     

    The special comparison operator x signals that no comparison should be done, or, in other words, that the fetched value will always match val.

    -
    ::fileutil::magic::rt::Nvx type offset ?qual?
    -

    This command behaves like ::fileutil::magic::rt::Nv, except that -it additionally remembers the location in the file after the fetch in -the calling context, for the current level, for later use by -::fileutil::magic::rt::R.

    -
    ::fileutil::magic::rt::Nx type offset comp val ?qual?
    -

    This command behaves like ::fileutil::magic::rt::N, except that -it additionally remembers the location in the file after the fetch in -the calling context, for the current, for later use by -::fileutil::magic::rt::R.

    -
    ::fileutil::magic::rt::S offset comp val ?qual?
    -

    This command behaves like ::fileutil::magic::rt::N, except that -it fetches and compares strings, not numeric data. The fetched value -is also stored in the internal string buffer instead of the numeric -buffer.

    -
    ::fileutil::magic::rt::Sx offset comp val ?qual?
    -

    This command behaves like ::fileutil::magic::rt::S, except that -it additionally remembers the location in the file after the fetch in -the calling context, for the current level, for later use by -::fileutil::magic::rt::R.

    -
    ::fileutil::magic::rt::L newlevel
    -

    This command sets the current level in the calling context to +

    ::fileutil::magic::rt::S type offset testinvert mod mand comp val
    +

    Like ::fileutil::magic::rt::N except that it fetches and compares string +types , not numeric data.

    +
    ::fileutil::magic::rt::L newlevel
    +

    Sets the current level in the calling context to newlevel. The command returns the empty string as its result.

    -
    ::fileutil::magic::rt::I base type delta
    -

    This command handles base locations specified indirectly through the -contents of the inspected file. It returns the sum of delta and -the value of numeric type fetched from the absolute location -base.

    -

    For the possible types see section NUMERIC TYPES.

    -
    ::fileutil::magic::rt::R offset
    -

    This command handles base locations specified relative to the end of -the last field one level above.

    -

    In other words, the command computes an absolute location in the file -based on the relative offset and returns it as its result. The -base the offset is added to is the last location remembered for the -level in the calling context.

    -
    ::fileutil::magic::rt::U fileindex name
    -

    Use a named test script at the current level.

    +
    ::fileutil::magic::rt::I offset it ioi ioo iir io
    +

    Calculates an offset based on an initial offset and the provided modifiers.

    +
    ::fileutil::magic::rt::R offset
    +

    Given an initial offset, calculates an offset relative to the cursor at the +next level up. The cursor is the position in the data one character after the +data extracted from the file one level up.

    +
    ::fileutil::magic::rt::U fileindex name
    +

    Add a level and use a named test script.

    NUMERIC TYPES

    byte
    Index: idoc/www/tcllib/files/modules/math/numtheory.html ================================================================== --- idoc/www/tcllib/files/modules/math/numtheory.html +++ idoc/www/tcllib/files/modules/math/numtheory.html @@ -1,5 +1,6 @@ + math::numtheory - Tcl Math Library