Overview | Index by: file name | procedure name | procedure call | annotation

lib.tcl Annotations

Created from source/lib.tcl
A library of useful procedures for the Master and Sesssion interpreters.

Procedure Summary
? { bool true {false {}} }
          Equivalent the the C language's ? construct.
ansi { sid args }
          Return the input text with extra formating based on ANSI escape codes.
bgsend { tid script args }
          A version of thread::send with asynchronous execution, that waits until command is evaluated (without blocking), propagates errors back, and returns the result of the evaluation.
bgsend_timeout { counter tid }
          A procedure executed when a bgsend job
Global { args }
          This procedure makes it easy to access module shared memory parameters among threads by mapping a local variable to a shared memory variable, and optionally keeping them synchronized as the local variable changes.
Global_update_write { name args }
          Update the value of shared memory variable, when the corresponding local
lempty { listValue }
          Test if a string is
lremove { listName item }
          Remove an item from a list.
Module { args }
          This procedure makes it easy to access global shared memory parameters by mapping a local variable to a shared memory variable, and keeping them
Module_update_write { name args }
          Update the value of shared memory variable, when the corresponding local
Session { args }
          This procedure makes it easy to access shared memory session parameters, by mapping a local variable to a shared memory variable, and keeping them synchronized.
Session_update_write { name args }
          Update the value of shared memory variable, when the corresponding local

Procedure Detail

?

proc ? { bool true {false {}} }
Equivalent the the C language's ? construct. If bool is true, then $true is returned, otherwise $false is returned.
Parameters:
bool - An expression that must be evaluated to either true or false.
true - Any string or list.
false - Any string or list.
Returns:
Either $true or $false.
Defined in:
lib.tcl, line 33

ansi

proc ansi { sid args }
Return the input text with extra formating based on ANSI escape codes. If ANSI escape codes are disabled for a session, then only the -underline parameter is supported (using special marking). The rest are ignored. @todo Support background color and the other ANSI codes.
Parameters:
sid - Session ID.
args - -bold -underline -crossed -italic -blinkslow -blinkrapid -franktur -color --
Returns:
The input text formatted.
Defined in:
lib.tcl, line 69

bgsend

proc bgsend { tid script args }
A version of thread::send with asynchronous execution, that waits until command is evaluated (without blocking), propagates errors back, and returns the result of the evaluation. In addition it supports the folling option(s): -timeout : Wait up to ms for the script to return. If it doesn't return by that time, generate an error back to the caller. Warning: Although the procedure 'bgsend' returns, the script might still be executed when it gets its turn in the event loop at some unknown time in the future. Result in this case will be lost. Errors will be captured by 'bgerror'.
Parameters:
tid - Thread Id to evaluate script into.
script - Tcl script to evaluate.
args - Optional parameters.
Returns:
The return value of the evaluation. @error
Defined in:
lib.tcl, line 305

bgsend_timeout

proc bgsend_timeout { counter tid }
A procedure executed when a bgsend job timeouts.
Parameters:
counter - The unique number associated with this bgsend job.
tid - Thread Id of thread script is sent to.
Defined in:
lib.tcl, line 283

Global

proc Global { args }
This procedure makes it easy to access module shared memory parameters among threads by mapping a local variable to a shared memory variable, and optionally keeping them synchronized as the local variable changes. However, if the session variable changes the local will not be updated. Review the code where this proc is used to investigate whether this could happen and whether it poses a problem. A read trace would solve this, but adds significant extra overhead.
Parameters:
args - List of shared memory variable names to bind local variables to. @error
Defined in:
lib.tcl, line 163

Global_update_write

proc Global_update_write { name args }
Update the value of shared memory variable, when the corresponding local changes.
Parameters:
name - The name of the local/shared variable.
args - Rest of standard variable trace arguments.
Defined in:
lib.tcl, line 149

lempty

proc lempty { listValue }
Test if a string is empty.
Parameters:
listValue - A list name
Returns:
true if empty, otherwise false
Defined in:
lib.tcl, line 57

lremove

proc lremove { listName item }
Remove an item from a list. Item specified by value.
Parameters:
listName - A list name
item - The name/value of the item to remove
Defined in:
lib.tcl, line 45

Module

proc Module { args }
This procedure makes it easy to access global shared memory parameters by mapping a local variable to a shared memory variable, and keeping them synchronized.However, if the session variable changes the local will not be updated. Review the code where this proc is used to investigate whether this could happen and whether it poses a problem. A read trace would solve this, but adds significant extra overhead.
Parameters:
args - [-rw|-ro] var1 [var2 ...]
Defined in:
lib.tcl, line 240

Module_update_write

proc Module_update_write { name args }
Update the value of shared memory variable, when the corresponding local changes.
Parameters:
name - The name of the local/shared variable.
args - Rest of standard variable trace arguments.
Defined in:
lib.tcl, line 227

Session

proc Session { args }
This procedure makes it easy to access shared memory session parameters, by mapping a local variable to a shared memory variable, and keeping them synchronized. However, if the session variable changes the local will not be updated. Review the code where this proc is used to investigate whether this could happen and whether it poses a problem. A read trace would solve this, but adds significant extra overhead.
Parameters:
args - [-rw|-ro] var1 [var2 ...]
Defined in:
lib.tcl, line 200

Session_update_write

proc Session_update_write { name args }
Update the value of shared memory variable, when the corresponding local changes.
Parameters:
name - The name of the local/shared variable.
args - Rest of standard variable trace arguments.
Defined in:
lib.tcl, line 187

Overview | Index by: file name | procedure name | procedure call | annotation
File generated 2010-03-13 at 22:28.