Content-type: text/html; charset=UTF-8 Man page of qddb_util

qddb_util

Section: Herrin Software Development, Inc. (n)
Updated: 20 Oct 2000
Index Return to Main Contents
 

NAME

qddb_util - Miscellaneous utility functions.  

SYNOPSIS

qddb_util isdate <date string>
qddb_util istime <time string>
qddb_util isregexp <regexp string> ?v8|posix|pcre?
qddb_util postscript ?option value ...? string
qddb_util formatdate <format string> <date string>
qddb_util formattime <format string> <time string>
qddb_util datestyle ?us|european?
qddb_util flock <file desc> LOCK_SH|LOCK_EX|LOCK_NB|LOCK_UN 
qddb_util catrelation <schema desc> ?offset length?
qddb_util pr ?options? string 


 

DESCRIPTION

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.

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

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 isregexp returns 1; 0 is returned otherwise. If one of the options V8, POSIX, or PCRE are provided, the string will be checked against that style of regular expression.

postscript accepts an ASCII string and produces
POSTSCRIPT output. The following options are valid:
   -lines            lines per page
   -cpi              characters per inch
   -pagelength       page length
   -baseline         XX(i|m|c|p) (inch|mm|cm|point)
   -verticalspacing  XX(i|m|c|p) (inch|mm|cm|point)
   -leftmargin       XX(i|m|c|p) (inch|mm|cm|point)
   -orient portrait|landscape
   -papertype letter|legal|a4

Example: qddb_util postscript -leftmargin 1i "Hello world"

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.

formattime accepts a format string plus an input time string
and returns the resulting time string. If Qddb cannot parse the input string, an error is returned. Valid format strings are currently "%H", "%M", "%S", "%H:%M", "%M:%S", and "%H:%M:%S".

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").

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.

pr accepts a strings and produces paginated output.
   -dateformat <date format>
   -headers
   -footers
   -formfeed
   -linesperpage <integer>

 

SEE ALSO

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

 

REFERENCES

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
 

DIAGNOSTICS

 

BUGS

None known.


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
REFERENCES
DIAGNOSTICS
BUGS

This document was created by man2html, using the manual pages.
Time: 18:55:30 GMT, October 31, 2018