Filewatcher File Search
FTP Search
  
Directory (beta)
  
Content Search (beta)
   
pkg://jultaf-0.0.4-1.i386.rpm:140767/usr/doc/jultaf-0.0.4/jultaf.html  info  downloads

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD>
<TITLE>Jumble Library for Tcl and Friends</TITLE>
</HEAD>
<BODY>
<H1><A NAME="1">Jumble Library for Tcl and Friends</A></H1>
The <EM>Jumble Library for Tcl and Friends</EM> is a collection of Tcl and
[incr Tcl] scripts and provides procedures resp. classes with various
purposes. Additionally a shared library for accessing GDBM databases from
Tcl can be build with this package. 
<P>
 This document corresponds to version 0.0.4 of the library. Up-to-date
information about Jultaf can be found via <A HREF="http://www.han.de/~racke/jultaf/">http://www.han.de/~racke/jultaf/</A>
. 
<P>
 <UL>
<LI><A HREF="#33">Important information about this package</A>
<UL>
<LI><A HREF="#54">How to Read This Manual</A>
<LI><A HREF="#92">Build Configuration</A>
</UL>
<LI><A HREF="#255">Error</A>
<LI><A HREF="#373">Command Line Processing</A>
<UL>
<LI><A HREF="#378">Option Specifications</A>
<LI><A HREF="#419">Option Listing</A>
<LI><A HREF="#461">Option Processing</A>
<LI><A HREF="#501">Examples</A>
</UL>
<LI><A HREF="#515">New Control Structures</A>
<LI><A HREF="#569">String</A>
<LI><A HREF="#736">Lists</A>
<UL>
<LI><A HREF="#751">Sequence</A>
<LI><A HREF="#911">LOLList of Lists</A>
</UL>
<LI><A HREF="#955">Array</A>
<LI><A HREF="#1031">Files</A>
<UL>
<LI><A HREF="#1097">File Name Manipulation</A>
<LI><A HREF="#1161">Finding Files</A>
</UL>
<LI><A HREF="#1286">Code Processing</A>
<LI><A HREF="#1491">Invoking subprocesses</A>
<LI><A HREF="#1529">Accessing GDBM Databases</A>
<LI><A HREF="#1766">RPM Interface</A>
<LI><A HREF="#1815">Miscellaneous Functions</A>
<LI><A HREF="#1890">Package Index</A>
<LI><A HREF="#1901">Variable Index</A>
<LI><A HREF="#1906">Function Index</A>
<LI><A HREF="#1911">Concept Index</A>
</UL>

<H2><A NAME="33">Important information about this package</A></H2>
Jultaf is <EM>alpha</EM> software. It is not tested by anyone but me and
documentation is not as good as required for a decent package. However, it
works for me. 
<P>
 Jultaf is <EM>free</EM> software. This means that everyone may use it,
redistribute it and/or modify it under the terms of the GNU General Public
License, as published by the Free Software Foundation.

<H3><A NAME="54">How to Read This Manual</A></H3>
  Items introduced in one of the last revisions are marked as new in this
manual as shown in the example below: 
<DL>
<DT><CODE>fresh</CODE> <A  NAME="NEW"><IMG ALT="*NEW*" SRC="new.gif"></A><DD>Returns a list
with new functions in this release.
</DL>
<A NAME="72"> Jultaf is a work in progress and several items will be a moving target. Their syntax may change in a not backward compatible way and are marked as </A>  <DFN>unstable</DFN>: 
<DL>
<DT><CODE>hacks</CODE> <A  NAME="EXP"><IMG ALT="*EXPERIMENTAL*" SRC="exp.gif"></A><DD>Returns a
list with bug-prone functions in this release.
</DL>

<H3><A NAME="92">Build Configuration</A></H3>
<P>

<H4><A NAME="108">Optional Features</A></H4>
 
<DL>
<DT><CODE><A  NAME="ENABLE-ITCL">--enable-itcl</A></CODE>= <CODE>yes</CODE>|<CODE>no</CODE>|<VAR>PATH
</VAR><DD>Indicates if the [incr Tcl] library files should be installed as
well as the vanilla Tcl library files. If set to <CODE>yes</CODE> or the 
<VAR>PATH</VAR> to the [incr Tcl] interpreter, this files will be installed.
The default value depends on the fact if <CODE>configure</CODE> detects 
<CODE>itclsh</CODE> in the path.<DT><CODE><A  NAME="WITHGDBM">--with-gdbm</A></CODE><DD>Enables
compiling and installing of the Jufgdbm library.<DT><CODE><A  NAME="WITHPROF">--with-prof</A>
</CODE><DD>Enables compiling and installing of the Jufprof library.<DT>
<CODE><A  NAME="WITHPQ">--with-pq</A></CODE><DD>Enables compiling and installing of the Jufpq
library.<DT><CODE><A  NAME="WITHRPM">--with-rpm</A></CODE><DD>Enables compiling and installing of
the Jufrpm library.
</DL>

<H4><A NAME="165">Installation Directories</A></H4>
This section describes where the various files of the Jultaf distribution
get installed by <CODE>make install</CODE>. 

<TABLE>
<TR><TH>Symbolic Name<TH>Default value<TH><A NAME="184">Files</A>
<TR><TD><CODE>DATADIR</CODE><TD>/usr/local/share/jultaf<TD><A NAME="195">Tcl and [incr Tcl] files</A>
<TR><TD><CODE>LIBDIR</CODE><TD>/usr/local/lib<TD><A NAME="206">library files (Jufprof and Jufgdbm) </A>
<TR><TD><CODE>INFODIR</CODE><TD><A NAME="213">/usr/local/info</A><TD> documentation<A NAME="223"> (</A>GNU Info<A NAME="231"> format)</A>
<TR><TD><CODE>DOCDIR</CODE><TD><A NAME="238">/usr/local/doc/jultaf</A><TD> documentation<A NAME="248"> (</A>HTML format)
</TABLE>


<H2><A NAME="255">Error</A></H2>
The functions provided by the <CODE>Error</CODE><A NAME="271"> package can be divided into error handling functions and error evaluation functions. </A>
<P>
 
<DL>
<DT><CODE>fault</CODE> <VAR>TYPE</VAR> <VAR>[ARG ...]</VAR><DD><A NAME="286">Generates an Tcl error. The message is composed of an template specified by TYPE and the remaining arguments: </A>
<DL>
<DT><CODE>badoption</CODE><DD><CODE><A NAME="295">bad option "%s": must be %s</A></CODE><DT><CODE>wrongargs</CODE><DD>
<CODE>wrong # args: should be "%s"</CODE>
</DL>
</DL>
 The following error handling functions concatenates the given arguments
together with the <SAMP>: </SAMP><A NAME="309"> separator string between them. The scriptname is prepended if running non-interactively. </A>
<DL>
<DT><CODE>fatal</CODE> [<VAR>ARGS</VAR>...]<DD>Prints an error message on 
<CODE>stderr</CODE><A NAME="324"> and exits the current process. </A><DT><CODE>error</CODE> [<VAR>ARGS</VAR>...]<DD>Print an
error message on <CODE>stderr</CODE><A NAME="339">.</A><DT><CODE>warning</CODE> [<VAR>ARGS
</VAR>...]<DD>Print an error message on <CODE>stderr</CODE> with the text
"warning" preprended. 
</DL>
 
<P>
<A NAME="358"> Only one error evaluation function exists by now: </A><DL>
<DT><CODE>tclmsg</CODE><DD><A NAME="365">Evaluates the Tcl variable </A><CODE>errorCode</CODE> and generates an
appropriate error message.
</DL>
 This is useful for reporting errors on file operations: <PRE>package require Error
if {[catch "open [lindex $argv 0]" fileid] != 0} {
	Juf::Error::fatal [lindex $argv 0] [Juf::Error::tclmsg]
}</PRE>

<H2><A NAME="373">Command Line Processing</A></H2>
<P>

<H3><A NAME="378">Option Specifications</A></H3>
The <A HREF="#GETOPTS"><CODE>juf_getopts</CODE></A> function and the <A HREF="#LISTOPTS"><CODE>juf_getopts_listspecs</CODE></A> function expect a list of <DFN><A  NAME="OPTSPECS">option specifications</A>
</DFN> as one of their arguments. 
<P>
 Each option specification consists of an option processing description, an
option description and an argument description. Only the processing
description is mandatory. The other two elements of a option specification
are optional and evaluated only by the <CODE>juf_getopts_listspecs</CODE>
function.

<H4><A NAME="402">Option Processing Description</A></H4>
Each option can be specified through usage of different names, e.g. <CODE>
-h</CODE> and <CODE>--help</CODE><A NAME="414">. The processing description starts with these names, concatenated by the  </A><CODE>|</CODE>-sign.

<H3><A NAME="419">Option Listing</A></H3>
An option listing can be produced with the <CODE>juf_getopts_listspecs
</CODE><A NAME="431"> function: </A>
<DL>
<DT><CODE><A  NAME="LISTOPTS">juf_getopts_listspecs</A></CODE> <VAR>OPTSPECS</VAR> <VAR>OUTID</VAR> 
<DD>Writes a option listing to the file bound to the file identifier <VAR>
OUTID</VAR>. Expects as <VAR>OPTSPECS</VAR> a list of <A HREF="#OPTSPECS">option specifications</A>. 
</DL>

<H3><A NAME="461">Option Processing</A></H3>
<DL>
<DT><CODE><A  NAME="GETOPTS">juf_getopts</A></CODE> <VAR>OPTSPECS</VAR> <VAR>OPTARR</VAR> <VAR>
NEWARGV</VAR> <VAR>OLDARGV</VAR><DD>Processes the command line arguments in 
<VAR>OLDARGV</VAR>. Any options (preceded with <SAMP>-</SAMP> or <SAMP>--
</SAMP>) are evaluated according to the <A HREF="#OPTSPECS">option specifications</A> <VAR>OPTSPECS</VAR>. This function
stores the remaining arguments in the array <VAR>OPTARR</VAR>.
</DL>

<H3><A NAME="501">Examples</A></H3>
 I recommend the following set of option specifications as base set (make
sure to replace <CODE>make</CODE> with the actual script name): <PRE>{{help|h {Print this message and exit.}} 
 {version|v {Print the version number of make and exit}}}</PRE>

<H2><A NAME="515">New Control Structures</A></H2>
 <DFN>Control structures</DFN> are commands that direct the flow of control
like the Tcl builtins <CODE>if</CODE>, <CODE>while</CODE> and <CODE>switch
</CODE><A NAME="533">. </A>
<DL>
<DT><CODE>juf_branch</CODE> <VAR>VALUE</VAR> [<VAR>PATTERN</VAR> <VAR>
SCRIPT</VAR>] ... 2<DD><A NAME="550">Creates and evaluates </A><CODE>switch</CODE> statement. Causes error if <VAR>
VALUE</VAR> matches with none of the <VAR>PATTERN</VAR> arguments. To
override this behaviour you may add <CODE>default {}</CODE> to the
arguments.
</DL>
 Example for this command: <PRE>% proc version {subcmd number} {
    set parts [split $number .]
    juf_branch $subcmd major {lindex $parts 0} minor {lindex $parts 1} \
            minuscule {lindex $parts 2}
}
% version minor 1.2.3
2
% version patch 1.2.3
bad option "patch": must be major, minor, or minuscule</PRE>

<H2><A NAME="569">String</A></H2>
The functions provided by the <CODE>String</CODE><A NAME="583"> package perform several operations on array variables: </A>
<DL>
<DT><CODE>juf_split</CODE> [<VAR>OPTIONS</VAR>] <VAR>STRING</VAR> [<VAR>EXP
</VAR> <VAR>LIMIT</VAR>]<DD>Returns a list created by splitting <VAR>STRING
</VAR> at each match of the regular expression <VAR>EXP</VAR>. If <VAR>EXP
</VAR> is omitted or an empty string is given, it defaults to whitespace. If 
<VAR>LIMIT</VAR> is given, it stops the matching process, so that the size
of the resulting list is equal or lesser than <VAR>LIMIT</VAR>. 
<P>
<A NAME="619"> A regular expression matching the </A>null string will split <VAR>STRING</VAR> into separate characters at each
point it matches that way: <PRE>% juf_split "hello world" " *"
h e l l o w o r l d</PRE> If the initial arguments to <CODE>
juf_split</CODE> start with <SAMP>-</SAMP><A NAME="639">, they are treated as options. The following options are supported: </A>
<DL>
<DT><CODE>-showempty</CODE><DD>Adds an empty element to the list for each
match of the regular expression: <PRE>% juf_split -showempty {bla&amp;r;rab&amp;{\;} 
{} {} bla {} arg {} rab {}</PRE><DT><CODE>--</CODE><DD>Marks the
end of the options. The argument following this one will be treated as 
<VAR>STRING</VAR> even if it starts with a <SAMP>-</SAMP><A NAME="665">.</A>
</DL>
<DT><CODE>juf_compose</CODE> <VAR>STRING</VAR> <VAR>NUMBER</VAR><DD>
Composes a string of <VAR>NUMBER</VAR> times of <VAR>STRING</VAR><A NAME="685">.</A><DT><CODE>
juf_strcasecmp</CODE> <VAR>STRING1</VAR> <VAR><A NAME="696">STRING2</A></VAR> <DD>Performs a case
insensitive string comparison. Returns -1, 0, or 1, depending on whether 
<VAR>STRING1</VAR> is considered less than, equal to, or greater than <VAR>
STRING2</VAR><A NAME="712">. </A><DT><CODE>juf_string_count</CODE> <VAR>STRING</VAR> [<VAR>
ARRNAME</VAR>]<DD>Returns the number of different characters in <VAR>STRING
</VAR>. If <VAR>ARRNAME</VAR> is given, an array <VAR>ARRNAME</VAR> will be
created with characters as keys and character counts as values. <PRE>% juf_string_count example count
6
% array get count
l 1 p 1 x 1 m 1 a 1 e 2</PRE>
</DL>

<H2><A NAME="736">Lists</A></H2>
Jultaf provides two packages working on lists, <CODE>Sequence</CODE> for all
lists and <CODE>LOL</CODE> for lists inside of lists.

<H3><A NAME="751">Sequence</A></H3>
The functions provided by the <CODE>Sequence</CODE> package perform several
operations on lists: 
<DL>
<DT><CODE><A NAME="766">Juf::Sequence::</A>shift</CODE> <VAR>NAME</VAR> [<VAR>COUNT</VAR><A NAME="777">] </A> <DD>Removes <VAR>
COUNT</VAR> element from the list stored in the variable <VAR>NAME</VAR>
and returns the last element removed. <VAR>COUNT</VAR> defaults to 1.<DT>
<CODE><A NAME="802">Juf::Sequence::</A>pop</CODE> <VAR>NAME</VAR> [<VAR>COUNT</VAR><A NAME="813">] </A> <DD>Removes <VAR>COUNT
</VAR> element from the end of the list stored in the variable <VAR>NAME
</VAR> and returns the last element removed. <VAR>COUNT</VAR> defaults to 1.
<DT><CODE><A NAME="838">Juf::Sequence::</A>append</CODE> [<VAR>OPTION</VAR> ...] <VAR>NAME</VAR> [<VAR>VALUE
</VAR><A NAME="852"> ...] </A> <DD><A NAME="862">Works like the Tcl builtin  </A><CODE>lappend</CODE><A NAME="870">, but considers these options: </A>
<DL>
<DT><CODE>-nonempty</CODE><DD>Append only non-empty values.<DT><CODE>--
</CODE><DD>Marks the end of the options. The argument following this one
will be treated as <VAR>NAME</VAR> even if it starts with a <SAMP>-</SAMP>.
</DL>
<DT><CODE><A NAME="890">Juf::Sequence::</A>assign</CODE> <VAR>LIST</VAR> [<VAR>NAME</VAR> ...]<DD>Sets value
of the variables specified by the <VAR>NAME</VAR> arguments to that of the
existing elements of <VAR>LIST</VAR>. Returns remaining list elements. If
the number of variables exceeds the list length, the remaining variables
will be removed.
</DL>

<H3><A NAME="911">List of Lists</A></H3>
<A NAME="923"> Each hierarchy level is a list with keys as odd elements and inferior lists as even elements. The empty string is a special key. The accompanying element is list of values instead of a inferior list. </A><DL>
<DT><CODE>insert</CODE> <IMG ALT="*NEW*" SRC="new.gif"> <IMG
ALT="*EXPERIMENTAL*" SRC="exp.gif"> <VAR>NAME</VAR> <VAR>LIST</VAR> <VAR>
VALUE</VAR><DD>Inserts <VAR>VALUE</VAR> into list of lists stored within
variable <VAR>NAME</VAR> as specified by the keys <VAR>LIST</VAR>. <PRE>% package require LOL
% set grplist ""
% Juf::LOL::insert grplist "Development Languages Tcl" Jultaf
Development {Languages {Tcl {{} Jultaf}}}
</PRE>
</DL>

<H2><A NAME="955">Array</A></H2>
The functions provided by the <CODE>Array</CODE><A NAME="969"> package perform several operations on array variables: </A>
<DL>
<DT><CODE>values</CODE> [<VAR>SWITCH</VAR> ...] [<VAR>NAME</VAR><A NAME="981"> ...]</A><DD>
Returns a list containing the values of all of the elements in the array(s)
specified by the <VAR>NAME</VAR><A NAME="990"> arguments. If invoked with the </A><CODE>-unique</CODE> switch, a specific
value appears only once in the list. <PRE><A NAME="1002">% array set test {whiskey drink beer drink fish food}
% Juf::Array::values test
drink food drink
% Juf::Array::values -unique test
drink food</A></PRE> <DT><CODE>sort</CODE> 
<VAR><A NAME="1010">NAME</A></VAR><DD> Returns list of element names of array <VAR>NAME</VAR>,
sorted according to the element values. <PRE>% array set test {whiskey drink beer drink fish food}
% Juf::Array::sort test
whiskey beer fish</PRE>
</DL>

<H2><A NAME="1031">Files</A></H2>
<DL>
<DT><CODE>juf_file_slurp</CODE> <VAR>FILE</VAR> <VAR><A NAME="1042">NAME</A></VAR> <DD><A NAME="1050">Reads complete FILE into variable NAME. Returns 1 in case of success, 0 otherwise.</A><DT><CODE>
juf_file_mkdirs</CODE> [<VAR>DIR</VAR><A NAME="1058"> ...] </A><DD><A NAME="1066">Creates all directories given as arguments. Any missing parent directories are created too. Considers an existing argument directory not as an error.</A><DT><CODE>juf_file_iscwd</CODE> 
<VAR>FILENAME</VAR><DD>Checks if <VAR>FILENAME</VAR><A NAME="1078"> corresponds to the </A>current working
directory. Returns 1 if successful, 0 otherwise.
</DL>

<H3><A NAME="1097">File Name Manipulation</A></H3>
<DL>
<DT>  <CODE><A  NAME="EXPAND">juf_file_expand</A></CODE> <VAR>NAME</VAR> [<VAR>DIR</VAR><A NAME="1119">] </A><IMG
ALT="*NEW*" SRC="new.gif"> <IMG ALT="*EXPERIMENTAL*" SRC="exp.gif"><DD> <A NAME="1129"> Converts file name NAME to the corresponding absolute filename, </A> 
performs tilde substitution and returns the result. Please note that <SAMP>
..</SAMP> and <SAMP>.</SAMP> will not expanded (yet). If <VAR>NAME</VAR> is
a relative name, the function assumes that <VAR>DIR</VAR> is the directory
where the file corresponding to <VAR>NAME</VAR> resides in. In the case that
no value for <VAR>DIR</VAR> is passed, the current working directory is
used.
</DL>

<H3><A NAME="1161">Finding Files</A></H3>
 <A NAME="1170"> This section describes the procedure </A><CODE>find</CODE>, which searches for files matching certain criteria. 
<CODE>find</CODE> is available only if Jultaf has been configured with 
<CODE><A HREF="#ENABLE-ITCL">--enable-itcl</A></CODE>. 
<P>
 <CODE>find</CODE><A NAME="1188"> expects as arguments any number of "directory trees" and  options with or without values. The procedure searches all files in the given directory trees and returns all files that matches the criteria specified by the options. A </A><DFN>directory tree</DFN> is a directory and the files it
contains, all of its subdirectories and the files they contain, etc. It can
also be a single non-directory file. 
<P>
 Valid options are: 
<DL>
<DT><CODE>-name</CODE> <VAR>PATTERN</VAR><DD>Qualifies files that match 
<VAR>PATTERN</VAR> in a <CODE>string match</CODE>-like fashion. Only the
last component of the file name is considered for the match. <DT><CODE>
-type</CODE> <VAR>CHAR</VAR><DD>Qualifies files that are of type <VAR>CHAR
</VAR>: 
<DL>
<DT><CODE>b</CODE><DD>block (buffered) special<DT><CODE>c</CODE><DD>
character (buffered) special<DT><CODE>d</CODE><DD>directory<DT><CODE>f
</CODE><DD>regular file<DT><CODE><A NAME="1246">l</A></CODE><DD>  symbolic link<DT><CODE><A NAME="1258">p</A>
</CODE><DD>   pipe (FIFO)<DT><CODE><A NAME="1273">s</A></CODE><DD>socket
</DL>
</DL>

<H2><A NAME="1286">Code Processing</A></H2>
<DL>
<DT><CODE>juf_safe_eval</CODE> [<VAR>OPTIONS</VAR>] <VAR><A NAME="1297">SCRIPT</A></VAR><DD>   
Evaluates <VAR>SCRIPT</VAR> as Tcl script in a temporary safe interpreter
and returns the result. 
<P>
<A NAME="1321"> Valid options are: </A><DL>
<DT><CODE>-aliases <VAR>NAME</VAR></CODE><DD><A NAME="1330">Creates an </A>alias for each key in array 
<VAR>NAME</VAR><A NAME="1340"> within the safe interpreter. </A><DT><CODE>-exit <VAR><A NAME="1348">COMMAND</A></VAR></CODE><DD>exit handler<VAR>
COMMAND</VAR> will be called with the interpreter as argument after
processing <VAR>SCRIPT</VAR><A NAME="1360">.</A><DT><CODE>-interp <VAR>NAME</VAR></CODE><DD>
Stores interpreter into variable <VAR>NAME</VAR>. Useful with the <CODE>
-unknown</CODE><A NAME="1377"> option.</A><DT><CODE>-nosafe</CODE><DD><A NAME="1385">Use an ordinary slave interpreter.</A><DT><CODE>-renames <VAR>NAME
</VAR></CODE><DD>Renames commands stored as keys in array <VAR>NAME</VAR><A NAME="1399"> to the corresponding values within the safe interpreter. </A>
<DT><CODE>-stats <VAR>NAME</VAR></CODE><DD>Fills array <VAR>NAME</VAR><A NAME="1413"> with statistics: </A>
<DL>
<DT>cmdcount<DD><A NAME="1421">number of commands executed within the safe interpreter.</A>
</DL>
<DT><CODE>-unknown <VAR>NAME</VAR></CODE><DD>Function <VAR>NAME</VAR><A NAME="1435"> will be called if the safe interpreter stumbles over an unknown command. </A><DT>
<CODE>-variables <VAR>NAME</VAR></CODE><DD>Creates a variable for each key
in array <VAR>NAME</VAR> within the safe interpreter. The initial value of
the variable is the corresponding array element. <DT><CODE>--</CODE><DD>
Marks the end of the options. The argument following this one will be
treated as <VAR>NAME</VAR> even if it starts with a <SAMP>-</SAMP><A NAME="1460">.</A>
</DL>
<DT><CODE>juf_safe_source</CODE> [<VAR>OPTIONS</VAR>] <VAR>FILE</VAR> [
<VAR>NAME</VAR><A NAME="1475">]</A><DD>  Evaluate <VAR>FILE</VAR> as Tcl script in a temporary
safe interpreter. Accepts the same options as <CODE>juf_safe_eval</CODE>.
</DL>

<H2><A NAME="1491">Invoking subprocesses</A></H2>
<A NAME="1498">The </A><CODE>shell</CODE> module<A NAME="1508"> consists only of one function: </A>
<DL>
<DT><CODE>juf_shell_run</CODE> <VAR>args</VAR><DD><A NAME="1518">Passes its arguments to </A><CODE>exec</CODE> and
returns 1 if successful, 0 otherwise. 
</DL>

<H2><A NAME="1529">Accessing GDBM Databases</A></H2>
   GNU dbm databases can be manipulated with the <CODE>juf_gdbm</CODE>
command. Note that this command is available only if Jultaf is configured
with the <A HREF="#WITHGDBM">--with-gdbm</A><A NAME="1550"> option. </A>
<DL>
<DT><CODE>juf_gdbm open</CODE> <VAR>NAME</VAR> <VAR>FLAGS</VAR><DD>Opens
database file <VAR>NAME</VAR> and returns database identifier. The access
mode is specified by <VAR>FLAGS</VAR>: 
<DL>
<DT><SAMP>r</SAMP><DD>Database is opened for reading. Any call to <CODE>
juf_gdbm</CODE> with the options <CODE>delete</CODE> or <CODE>store</CODE>
will fail.<DT><SAMP>rw</SAMP><DD>Database is opened for reading and writing.
<DT><SAMP>rwc</SAMP><DD>Same as <CODE>rw</CODE>, if the database does not
exist, a new one will be created.<DT><SAMP>rwn</SAMP><DD>Same as <CODE>rw
</CODE><A NAME="1607">, a new database will be created in any case.</A>
</DL>
<DT><CODE>juf_gdbm close</CODE> <VAR>DBID</VAR><DD>Closes database specified
by <VAR>DBID</VAR><A NAME="1622">.</A><DT><CODE>juf_gdbm store</CODE> <VAR>DBID</VAR> <VAR>KEY
</VAR> <VAR>VALUE</VAR><DD>Stores <VAR>KEY</VAR> with the associated <VAR>
VALUE</VAR> in database specified by <VAR>DBID</VAR><A NAME="1649">.</A><DT><CODE>juf_gdbm
insert</CODE> <VAR>DBID</VAR> <VAR>KEY</VAR> <VAR>VALUE</VAR><DD>Inserts 
<VAR>KEY</VAR> with the associated <VAR>VALUE</VAR> in database specified by 
<VAR>DBID</VAR>. Generates an error if <VAR>KEY</VAR><A NAME="1679"> exists already. </A><DT><CODE>juf_gdbm
fetch</CODE> <VAR>DBID</VAR> <VAR>KEY</VAR><DD>Returns associated value for 
<VAR>KEY</VAR> in database specified by <VAR>DBID</VAR>. If <VAR>KEY</VAR><A NAME="1703"> doesn't exist, a empty string is returned.</A>
<DT><CODE>juf_gdbm delete</CODE> <VAR>DBID</VAR> <VAR>KEY</VAR><DD>Removes 
<VAR>KEY</VAR> from database specified by <VAR>DBID</VAR><A NAME="1724">.</A><DT><CODE>juf_gdbm
exists</CODE> <VAR>DBID</VAR> <VAR>KEY</VAR><DD>Returns 1, if <VAR>KEY
</VAR> exists in database specified by <VAR>DBID</VAR><A NAME="1745">, 0 otherwise.</A><DT><CODE>juf_gdbm
list</CODE> <VAR>DBID</VAR><DD>Returns a list containing all keys in
database specified by <VAR>DBID</VAR>.
</DL>

<H2><A NAME="1766">RPM Interface</A></H2>
<DL>
<DT><CODE>query</CODE> <VAR>PACKAGE</VAR> <VAR>TAG</VAR><DD>Queries <VAR>
PACKAGE</VAR> for the value of <VAR>TAG</VAR>. If a file <VAR>PACKAGE</VAR>
doesn't exist, the RPM database will be searched for <VAR>PACKAGE</VAR>.
Supported tags are: 
<DL>
<DT><CODE>name</CODE><DD>name of package<DT><CODE>group</CODE><DD>slash
separated list of group names
</DL>
 Queries looks like: <PRE>% package require RPM
% Juf::RPM::query rpm name
rpm
% Juf::RPM::query file group
Utilities/File</PRE>
</DL>

<H2><A NAME="1815">Miscellaneous Functions</A></H2>
<DL>
<DT><CODE>Juf::deprecate</CODE> <VAR>OLD</VAR> <VAR>NEW</VAR><DD>Deprecates
function <VAR>OLD</VAR> in favor of function <VAR>NEW</VAR>. Maps <VAR>OLD
</VAR> to <VAR>NEW</VAR> and prints error message at the first call of 
<VAR>OLD</VAR>. <PRE><A NAME="1845">% package require Jufbase
% 0.0.4
Juf::deprecate juf_compose Juf::String::compose
% juf_compose foo 5
juf_compose: deprecated function
foofoofoofoofoo</A></PRE><DT><CODE>juf_misc_scriptname</CODE><DD><A NAME="1851">Returns name of the current </A>script<A NAME="1859"> with leading directories and extension(s) removed.</A>
<DT><CODE>juf_misc_shell</CODE> [<VAR>PROMPT</VAR>]<DD>Displays the prompt
given in <VAR>PROMPT</VAR> which defaults to "% " and evaluates the user
input in the current interpreter until the user types <CODE>exit</CODE> or
the demanded command invokes the <CODE>exit</CODE><A NAME="1878"> command.  </A>  This command is very
useful for testing libraries and/or Tcl applications. The following script
can be adapted to your needs: <PRE>#!/usr/bin/tclsh
lappend auto_path "/usr/share/jultaf"
juf_misc_shell "jultaflib% "</PRE>
</DL>

<H2><A NAME="1890">Package Index</A></H2>
<UL>
<LI><A HREF="#955">Array</A>
</LI>
<LI><A HREF="#255">Error</A>
</LI>
<LI><A HREF="#911">LOL</A>
</LI>
<LI><A HREF="#751">Sequence</A>
</LI>
<LI><A HREF="#569">String</A>
</LI>
</UL>

<H2><A NAME="1901">Variable Index</A></H2>
<UL>
<LI><A HREF="#286">badoption</A>
</LI>
<LI><A HREF="#365">errorCode</A>
</LI>
<LI><A HREF="#295">wrongargs</A>
</LI>
</UL>

<H2><A NAME="1906">Function Index</A></H2>
<UL>
<LI><A HREF="#838">append</A>
</LI>
<LI><A HREF="#890">assign</A>
</LI>
<LI><A HREF="#1815">deprecate</A>
</LI>
<LI><A HREF="#324">error</A>
</LI>
<LI><A HREF="#1518">exec</A>
</LI>
<LI><A HREF="#309">fatal</A>
</LI>
<LI><A HREF="#271">fault</A>
</LI>
<LI><A HREF="#1170">find</A>
</LI>
<LI><A HREF="#923">insert</A>
</LI>
<LI><A HREF="#533">juf_branch</A>
</LI>
<LI><A HREF="#665">juf_compose</A>
</LI>
<LI><A HREF="#EXPAND">juf_file_expand</A>
</LI>
<LI><A HREF="#1066">juf_file_iscwd</A>
</LI>
<LI><A HREF="#1050">juf_file_mkdirs</A>
</LI>
<LI><A HREF="#1031">juf_file_slurp</A>
</LI>
<LI>juf_gdbm
<UL>
<LI><A HREF="#1607">close</A>
</LI>
<LI><A HREF="#1703">delete</A>
</LI>
<LI><A HREF="#1724">exists</A>
</LI>
<LI><A HREF="#1679">fetch</A>
</LI>
<LI><A HREF="#1649">insert</A>
</LI>
<LI><A HREF="#1745">list</A>
</LI>
<LI><A HREF="#1550">open</A>
</LI>
<LI><A HREF="#1622">store</A>
</LI>
</UL>
</LI>
<LI><A HREF="#461">juf_getopts</A>
</LI>
<LI><A HREF="#431">juf_getopts_listspecs</A>
</LI>
<LI><A HREF="#1845">juf_misc_scriptname</A>
</LI>
<LI><A HREF="#1859">juf_misc_shell</A>
</LI>
<LI><A HREF="#1286">juf_safe_eval</A>
</LI>
<LI><A HREF="#1460">juf_safe_source</A>
</LI>
<LI><A HREF="#1508">juf_shell_run</A>
</LI>
<LI><A HREF="#583">juf_split</A>
</LI>
<LI><A HREF="#685">juf_strcasecmp</A>
</LI>
<LI><A HREF="#712">juf_string_count</A>
</LI>
<LI><A HREF="#862">lappend</A>
</LI>
<LI><A HREF="#802">pop</A>
</LI>
<LI><A HREF="#1766">query</A>
</LI>
<LI><A HREF="#766">shift</A>
</LI>
<LI><A HREF="#1002">sort</A>
</LI>
<LI><A HREF="#550">switch</A>
</LI>
<LI><A HREF="#358">tclmsg</A>
</LI>
<LI><A HREF="#969">values</A>
<UL>
<LI><A HREF="#990">-unique</A>
</LI>
</UL>
</LI>
<LI><A HREF="#339">warning</A>
</LI>
</UL>

<H2><A NAME="1911">Concept Index</A></H2>
<UL>
<LI><A HREF="#ENABLE-ITCL">--enable-itcl</A>
</LI>
<LI><A HREF="#WITHGDBM">--with-gdbm</A>
</LI>
<LI><A HREF="#WITHPQ">--with-pq</A>
</LI>
<LI><A HREF="#WITHPROF">--with-prof</A>
</LI>
<LI><A HREF="#WITHRPM">--with-rpm</A>
</LI>
<LI><A HREF="#1321">-aliases</A>
</LI>
<LI><A HREF="#1340">-exit</A>
</LI>
<LI><A HREF="#1360">-interp</A>
</LI>
<LI><A HREF="#870">-nonempty</A>
</LI>
<LI><A HREF="#1377">-nosafe</A>
</LI>
<LI><A HREF="#1385">-renames</A>
</LI>
<LI><A HREF="#639">-showempty</A>
</LI>
<LI><A HREF="#1399">-stats</A>
</LI>
<LI><A HREF="#1421">-unknown</A>
</LI>
<LI><A HREF="#1435">-variables</A>
</LI>
<LI>absolute
<UL>
<LI><A HREF="#1119">file names</A>
</LI>
</UL>
</LI>
<LI><A HREF="#1330">alias</A>
</LI>
<LI><A HREF="#852">appending list elements</A>
</LI>
<LI>arrays
<UL>
<LI><A HREF="#981">list of values</A>
</LI>
<LI>sorting
<UL>
<LI><A HREF="#1010">by value</A>
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><A HREF="#1413">cmdcount</A>
</LI>
<LI><A HREF="#515">control structures</A>
</LI>
<LI><A HREF="#1078">current working directory</A>
</LI>
<LI>databases
<UL>
<LI><A HREF="#1529">GDBM</A>
</LI>
</UL>
</LI>
<LI><A HREF="#184">DATADIR</A>
</LI>
<LI>directories
<UL>
<LI><A HREF="#1058">creating</A>
</LI>
</UL>
</LI>
<LI><A HREF="#1188">directory tree</A>
</LI>
<LI><A HREF="#231">DOCDIR</A>
</LI>
<LI>documentation
<UL>
<LI><A HREF="#213">GNU Info files</A>
</LI>
<LI><A HREF="#238">HTML</A>
</LI>
</UL>
</LI>
<LI><A HREF="#1348">exit handler</A>
</LI>
<LI><A HREF="#1097">expanding file names</A>
</LI>
<LI>features
<UL>
<LI><A HREF="#54">new</A>
</LI>
<LI><A HREF="#108">optional</A>
</LI>
<LI><A HREF="#72">unstable</A>
</LI>
</UL>
</LI>
<LI><A HREF="#1258">FIFO</A>
</LI>
<LI><A HREF="#1090">file names</A>
<UL>
<LI><A HREF="#1119">absolute</A>
</LI>
<LI><A HREF="#1097">expanding</A>
</LI>
</UL>
</LI>
<LI>files
<UL>
<LI><A HREF="#1042">reading</A>
</LI>
<LI><A HREF="#1161">searching</A>
</LI>
</UL>
</LI>
<LI><A HREF="#1529">GDBM</A>
</LI>
<LI>GNU
<UL>
<LI><A HREF="#1529">dbm</A>
</LI>
</UL>
</LI>
<LI><A HREF="#223">GNU Info</A>
</LI>
<LI><A HREF="#248">HTML</A>
</LI>
<LI><A HREF="#238">HTML documentation</A>
</LI>
<LI><A HREF="#213">Info</A>
</LI>
<LI><A HREF="#206">INFODIR</A>
</LI>
<LI>interpreter
<UL>
<LI><A HREF="#1297">safe</A>
</LI>
<LI><A HREF="#1297">temporary</A>
</LI>
</UL>
</LI>
<LI><A HREF="#195">LIBDIR</A>
</LI>
<LI>link
<UL>
<LI><A HREF="#1246">symbolic</A>
</LI>
</UL>
</LI>
<LI><A HREF="#911">list of lists</A>
</LI>
<LI>lists
<UL>
<LI><A HREF="#852">appending elements</A>
</LI>
<LI>removing elements
<UL>
<LI><A HREF="#813">Juf::Sequence::pop</A>
</LI>
<LI><A HREF="#777">Juf::Sequence::shift</A>
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><A HREF="#1258">named pipe</A>
</LI>
<LI><A HREF="#54">new items</A>
</LI>
<LI><A HREF="#619">null string</A>
</LI>
<LI>option specifications
<UL>
<LI><A HREF="#501">base set</A>
</LI>
</UL>
</LI>
<LI>pipe
<UL>
<LI><A HREF="#1258">named</A>
</LI>
</UL>
</LI>
<LI>removing list elements
<UL>
<LI><A HREF="#813">Juf::Sequence::pop</A>
</LI>
<LI><A HREF="#777">Juf::Sequence::shift</A>
</LI>
</UL>
</LI>
<LI><A HREF="#1297">safe interpreter</A>
</LI>
<LI><A HREF="#1851">script name</A>
</LI>
<LI>scripts
<UL>
<LI><A HREF="#1475">evaluating</A>
</LI>
</UL>
</LI>
<LI><A HREF="#1161">searching files</A>
</LI>
<LI><A HREF="#1498"><CODE>shell</CODE> module</A>
</LI>
<LI><A HREF="#1273">socket</A>
</LI>
<LI>source
<UL>
<LI><A HREF="#1475">Tcl scripts</A>
</LI>
</UL>
</LI>
<LI>strings
<UL>
<LI>comparing
<UL>
<LI><A HREF="#696">case insensitive</A>
</LI>
</UL>
</LI>
</UL>
</LI>
<LI>substitution
<UL>
<LI><A HREF="#1129">tilde</A>
</LI>
</UL>
</LI>
<LI><A HREF="#1246">symbolic link</A>
</LI>
<LI><A HREF="#1297">temporary interpreter</A>
</LI>
<LI>testing
<UL>
<LI><A HREF="#1878">libraries</A>
</LI>
<LI><A HREF="#1878">Tcl applications</A>
</LI>
</UL>
</LI>
<LI><A HREF="#1129">tilde substitution</A>
</LI>
<LI><A HREF="#72">unstable items</A>
</LI>
<LI><A HREF="#414">|</A>
</LI>
</UL>

<HR><ADDRESS>
Written by Stefan Hornburg <A HREF="mailto:racke@gundel.han.de">&lt;racke@gundel.han.de&gt;</A> (Last modified 3 September 1998)<BR>Translated from <A href="jultaf.sgml">jultaf.sgml</A> by <A	HREF="http://www.han.de/~racke/InfoPrism/">Info Prism's sgml2html</A> v0.0.2</ADDRESS><HR>

</BODY>
</HTML>
Results 1 - 1
Help - FTP Sites List - Software Dir.
Searching half a billion files worldwide
© 1997-2008 IT MARUHN