man page(1) manual page
Table of Contents


qddb_util - Miscellaneous utility functions.


qddb_util isdate <date string>
qddb_util formatdate <format string> <date string> qddb_util datestyle ?us|european?
qddb_util isregexp <regexp string>
qddb_util flock <file desc> LOCK_SH|LOCK_EX|LOCK_NB|LOCK_UN
qddb_util catrelation <schema desc> ?offset length?


isdate accepts a date string and determines whether Qddb can parse it. If it is a valid date string, qddb_util isdate returns 1; 0 is returned otherwise.

formatdate accepts a format string (see strftime(3)) and a date string and returns the formatted string. If Qddb cannot parse the date string, an error is returned. Note: the format string "%s" returns the number of seconds since the epoch, and the format string "days1900" returns the number of days since January 1, 1900.

datestyle with no argument returns the current date style. With an argument of "us" or "european", the date style is set appropriately (us is "%m/%d/%y" and european is "%d/%m/%y").

isregexp accepts a string and determintes whether the string is a valid V8-style regular expression. If it is a valid regular expression, qddb_util isreg_exp returns 1; 0 is returned otherwise.

flock locks or unlocks a file associated with the given file descriptor. The file descriptor must be the result of a previous Tcl "open" command. The options are a set of tokens separated by `|'. If LOCK_SH is given, a shared (read) lock is attempted. If LOCK_EX is given, an exclusive (write) lock is attempted. The presence of LOCK_NB in the options list indicates that the operation should not block. LOCK_UN unlocks the file if the lock exists. For example: set fd [open /tmp/ho.txt w]
if {![qddb_util flock $fd LOCK_EX|LOCK_NB]} { puts "Warning: cannot set lock on `/tmp/ho.txt'" }

catrelation returns a keylist descriptor that refers to a keylist containing exactly one item for each tuple in the database. If the offset and length are specified, the keylist refers to those tuples numbered from offset through offset + length - 1.


qddb_instance(n), qddb_keylist(n), qddb_rows(n), qddb_schema(n), qddb_search(n), qddb_table(n), qddb_tuple(n), qddb_view(n)


A Guide to QDDB
Eric H. Herrin II and Raphael A. Finkel

Qddb User's Guide

An ASCII Database for Fast Queries of Relatively Stable Data Eric H. Herrin II and Raphael A. Finkel Computing Systems, Volume 4 Number 2
University of California Press, Berkeley CA

Schema and Tuple Trees: An Intuitive Structure for Representing Relational Data
Eric H. Herrin, II and Raphael A. Finkel Computing Systems, Volume 9, Number 2
MIT Press, Cambridge MA

TCL and the TK Toolkit
John K. Ousterhout
Addison-Wesley, 1994
ISBN 0-201-63337-X



None known.

Table of Contents