The PinK Documentation Page

PinK (PinK is not Kuip ) is an interface
between
Tcl/Tk,
BLT,
ADAMO and
DAD.
There is a windowless version of PinK available called Floyd.
What's new in
Version 0.27.
There is now a mailing list
(
pink-list@dxhra1.desy.de)
available for PinK. All major announcements will be made on that list.
There is also an
archive
available.
To subscribe send a mail containing the line
subscribe pink-list [your-address] to
Majordomo@dxhra1.desy.de.
General chapters:
Reference chapters:
See Also and Miscellaneous:
Important:
This document is still under developement as well as the described
software is, please send your comments (complaints about any typos,
missing links, bad english, etc.) immediately to:
pink@hermes.desy.de
The PinK Developpers Team

PinK was designed, implemented and documented as a part of the
HERMES Slowcontrol, Monitoring
and Offline system by:
- Klaus Ackerstaff
- Email: ack@hermes.desy.de
- Marc-André Funk
- Email: maf@hermes.desy.de
How to retrieve and install PinK
Which platforms are supported?
Currently the following platforms are supported by the configuration script,
but not all of them have not yet been tested:
- IRIX 4 and 5
- OSF1
- ULTRIX
- HP-UX
- SunOS
- Solaris
- Linux
Where to get the archive?
The latest version of the PinK archive can be downloaded directly
from here.
But you may prefer to download the PinK
documentation for local installation. This archive also contains
the source code as well as the HV example that
you should use as an introduction in PinK and Dad programming.
What do you need?
The installation procedure of PinK is currently fitted into the HERMES
software scheme. This means, that you need a certain environment to
succeed in compiling PinK. The HERMES software is arranged in an own
directory tree, most of the programs expect the path of this directory in
an environment variable called $HERMES_ROOT. If this variable is
not set, the PinK installation script will try to find the hermes
software in
/hermes. However for installation as well as for later running
you're free to set $HERMES_ROOT to /usr/local.
In the directory $HERMES_ROOT/include you should install the
cfortran package and also a
corrected version of the ADAMO header file
adamo.h.
Also you must have installed DAD. How this is done you can find
in the related
DAD documentation page (Make sure to install an ADAMO version that
works with Dad as pointed out there!).
The following standard software packages are needed to make PinK. The
location may be explicitly defined by setting the mentioned environment
variable. If this variable is not set, the path is searched for the
package and the standard library directories are used.
- CERNLIB ($CERN_LIB)
- /cern:/cern/pro:/usr/cern:/user/cern/pro:/usr/local/cern:
/usr/local/cern/pro
- ADAMO 3.3 ($ADAMO_ROOT)
- /adamo:../adamo:/cern/adamo:$HERMES_ROOT/adamo:/usr/local/adamo:
/adamo/3.3:../adamo/3.3:/cern/adamo/3.3:$HERMES_ROOT/adamo/3.3:
$HERMES_ROOT/../adamo/3.3:/usr/local/adamo/3.3
- tcl 7.3 ($TCL_LIB)
- $HERMES_ROOT/lib:/usr/local/tcl/lib
- Tk 3.6 plus
patch level 1 ($TK_LIB)
- $HERMES_ROOT/lib:/usr/local/tk/lib
- BLT 1.7($BLT_LIB)
- $HERMES_ROOT/lib:/usr/local/blt/lib
The include files will be searched in the standard directories and
./include:$HERMES_ROOT/include
If the TCL/TK headers are not in there, you may set the
environment variables TCL_INC/TK_INC.
If you want to make use of the HBOOK analysis function of the pink browser,
you'll need to install the following:
- Hister
- Manfred Ferstl's HBOOK interface.
Archives of the required tcl/Tk versions 
When the HERMES software was designed and implemented,
tcl 7.3, Tk 3.6 and BLT 1.7 were up to date. Since HERMES is
a running experiment taking and analyzing physics data, we
decided to freeze those library versions.
Since it's not easy to find this versions on the
servers nowadays (you most likely will find them on
ftp.smli.com:/pub/tcl,
we supply them here:
The following patch should be applied to BLT:
diff -c bltGrAxis.c.old bltGrAxis.c
*** bltGrAxis.c.old Fri Apr 22 17:57:06 1994
--- bltGrAxis.c Sat Nov 16 09:32:03 1996
***************
*** 1713,1724 ****
sgmts++, labels++;
}
value += axisPtr->step;
}
done:
assert(sgmts <= arraySize);
- assert(labels <= axisPtr->numLabels);
if (axisPtr->segArr != NULL) {
free((char *)axisPtr->segArr);
--- 1713,1725 ----
sgmts++, labels++;
}
value += axisPtr->step;
+ if( labels >= axisPtr->numLabels )
+ break;
}
done:
assert(sgmts <= arraySize);
if (axisPtr->segArr != NULL) {
free((char *)axisPtr->segArr);
How to make it...
After you've build up your HERMES environment and installed DAD and all the
other packages, you've good chances to manage PinK also.
First make a directory $HERMES_ROOT/pink, change your working
directory to this one and extract the archive by typing
>gunzip pink.tar.gz
>tar xvf pink.tar
After this you can try to configure the package and finally make it:
>configure
>make
If everything worked fine, you may want to have a look in this
example.
If it does not work...
To write a configuartion script that fits all possible setups is probably
not possible. So if it fails here are some hints for experienced users
to solve the problems.
If you try to install PinK on a platform not mentioned above you're
invited to extend the configuration script. The following paragraph will
give you some hints for doing that.
If you try to install PinK on a supported platform and the configuration
fails, you're not totally lost. In that case you should try to modify the
configuration script for your environment.
The important file for both cases is called configure. In the
upper part of this scripts you'll find sections like the following:
Linux-*)
echo this seems to be a Linus machine. Congrats.
FORLIBS="-lf2c -lf77 -lc"
CC=cc
CFLAGS="-pipe -g -Wall"
ACFLAGS="-pipe -Df2cFortran -g -O -W -Wuninitialized \
-Wparentheses -Wmissing-prototypes -Wimplicit -Wcomment \
-Wformat -Wchar-subscripts "
LINKFLAGS=""
F77FLAGS="-cpp"
RANLIB="ranlib"
INCLUDES="$PWD/include /usr/local/include /usr/include"
EXTRAXLIBS=""
;;
The first line is a key for your setup. It's composed out of the following
fields:
systype-release-hostname
Copy the section for your system type to the beginning of the case block and
add your computer's name. If you're running one of those numerous LINUX PCs
called gandalf, the key would look like:
Linux-*-gandalf)
You can now try to make some changes in that configuration block. (An
explanation of the configuration variables will be added as soon as
I find some time...)
Good luck!
The true story about PinK
The evolution of PinK
The first ancestor of PinK was designed and coded by
Marc-André Funk during the
4th Hermes
Analysis Workshop taking place 22.-26. August '94 at DESY.
This study was called adtk and included mainly the TCL frame
for ADAMO GAF objects and some fundamental methods.
Unfortunately MAF could not continue with this project since he had to
prepare his diploma examination in early '95 (and for some other
reasons).
During the HERMES
Analysis/Software workshop in the beginning of September in
Corvallis/Oregon Klaus Ackerstaff looked into the existing code and started to
implement first DAD features. The strong need for a working
prototype version to be used for the HERMES slow control system drove
further developements. The first working version of the shell was
coded along with the first slow control example which controls and
monitors the HERMES target section. During that time the main focus
was to implement as many features of ADAMO and DAD as needed to get
the various applications running. Since DAD was also developed during
that time, a daily change of the code was quite normal. Together with
Wolfgang Wander especially the DAD interface constantly improved and
several applications have been developed in parallel.
Beginning of '95 the search for a name started and on one of the inofficial
HERMES "offsite" meetings the name PinK was born meaning
PinK is not Kuip because it partially
replaces the Kuip interface to the HERMES software.
In March '95 Wolfgang Wander and Klaus Ackerstaff have been invited to
present DAD and PinK at the Programming Techniques Group at CERN. In several
sessions it bacame clear that a complete DAD and ADAMO interface has
to be included into PinK in a clean object oriented way.
The very positive resonance of the PT group made clear that further
development of the two packages is worthwhile but also the "spare
time" work of Klaus Ackerstaff would not be sufficient to achieve the
final goals. Meanwhile a rapidly increasing number of PinK
applications had been developed for HERMES and the need for a revision
of the existing code was urgently needed. The
documentation of this first
PinK version is still available and may give you a guess how things
(not only the logo) changed in the meanwhile.
After all MAF finally joined the HERMES software group in April '95 and his
first project was to revise and restructure the PinK code in an
(more) object oriented manner. This new PinK now has a huge
number of commands and methods and a complete reference documentation.
PinK has been presented at the CHEP95 Conference in Rio de
Janeiro. After W. Wander gave a talk on DAD, K. Ackerstaff presented
PinK and some of the applications at HERMES (MAF again missed the
opportunity to come to Barzil). A lot of the trends in
Computing in High Energy Physics which emerged at this conference are
realized in these two packages. The response to the talks was good,
people from Fermilab, ANL and CERN are interested in the software and
have partially installed it. An online demonstration of the HERMES
monitoring system based on DAD and PinK was given in addition
to the scheduled talks.
The slides from the talk at CHEP95 are available on the
PinK publication and image page
Version history
Version 0.27
- Fixed bug in table method setformat
- Fixed bug in table browser (Columns of an array could not be configured)
Version 0.27![]()
- Minor bug fixes in the browser.
- New startup procedure: pink and floyd will now
look for pinkrc and floydrc in the pinklib
directory, user scripts are started from there (this allows central
startup files).
- Compressed DAD files can be read (new option -z for
dadOpenFile,
dadHost and
dadDoConnect)
- New dad function dadComprLevel
- Bug fixed in dadParse
- Expressions can now be defined and displayed in addition to table
columns
- Fixed bug in table select method
Version 0.26
- New functions dadParse and
createFH.
- Fixed minor bugs in pinklib
- Various changes to pb:
- Paste works now for all editable text entries
- The table viewer was improved:
Works now also on BW-displays,
got a real menu,
column output format now configurable,
columns can be hidden,
a DAD row selector might be defined,
table contents can be saved in ASCII format.
- The GAF/DAD file controlers were improved:
A selector for records to be read can be specified,
pb can loop (slowly) over all records of an input file.
- An analysis tool is available to create ASCII Ntuple output as
well as HBOOK objects (together with Manfred Ferstl's
hister package)
Version 0.25
- New dad command dadOpenSHM.
- New dad methods MWrite and
MRead.
- New flags for various dad commands:
- dadHost no longer adds the -g
flag in special cases.
- The Browser can now handle dad multi files in a primitiv manner.
- The Disconnect method on dad objects now frees internal memory even if
dadDisconnect fails (minor bug).
- The archives of tcl 7.3, Tk 3.6 and BLT 1.7 are now available
on the PinK installation page.
Version 0.24
- Added new table methods fetcol
and repcol.
(inscol is coded but
seems to be buggy in the current ADAMO distribution.)
- Minor bug fixes in the (yet undocumented) pinklib.
Version 0.23
- Fixed a severe bug in floydl causing floyd scripts to crash.
- Error messages from after
functions will be printed now by floyd.
- Removed the signal handling for SIGCHLD again - see
TCL book pg. 319 for handling of background processes.
- Added the command detachProcs
to force the redemption of zombies.
- Added the wcbsize table method.
- Use the dad time conversion functions in
strftime and
getUtime.
- getUtime now prints a warning
to replace it by
strftime/gettime.
Version 0.22
- Again some minor changes in the configuration script were made.
- The browser can now read DAD Files and Pipes, the command line
interface changed.
- Added the new method Dataflow
for DAD objects.
- Changed command line interface for the
dadDoConnect command
for DAD objects.
- "tabobj setfield
field NULL" is now possible for fields of the
type REL.
- Some internal changes in the getfield
table method.
- Added two new table methods for Relationship handling:
relations and
getrelation.
Version 0.21
- Again some minor changes in the configuration script were made.
- The command getobj
is now available.
- An (unsupported) alpha version of the browser pb is
now part of the distribution.
- A bug was fixed in src/interface/getfieldvalue.c preventing
"tabobj setfield
field NULL"
from being executed correctly for fields of the type REAL.
"tabobj getfield"
now returns ANY for REAL fields carrying the value
RANY.
(Thanks to Mike Beddo (beddo@p2hp2.lanl.gov) for this reports.)
- cprint and csave are no longer supported in PinKLib.
- Added the new function getprintername in pinklib called by tprint if
necessary.
Version 0.20
- The first column of a table to be created has to have the name
ID and the type SNUM.
crteab now checks for that.
Version 0.19
- The ADAMO SETCHK call is now available as the PinK
command setchk.
The dafault ADAMO debugging level is now NONE.
This speeds up PinK scripts up to 2500% !
Tip: During development and debugging you should
set the debugging level to ALL.
- The startup procedure is different now:
dadInit is now a standalone
command and not longer executed automatically at startup.
Tip: To use old scripts relying on that behaviour
simply insert dadInit in your
~/.pinkrc and ~/.floydrc startup scripts.
- There is now an Alphabetical Index of all
PinK commands.
- The documentation is now available as
tar-file for local installation.
- Again some changes in the installation procedure had to be made.
- Some minor changes in the HV example were made.
Version 0.18
- Some minor changes in the installation procedure were made.
- floyd now prints results and error messages
immediately (unbuffered) in interactive mode.
- The handling of PSTRING arguments (see cfortran.h)
was corrected. This avoids possible strange behavior of the
following commands and methods:
cresel, creind, topdfl, getobj, grabobj, fetdfl, fettab,
TABLE(various), GAF(askkey,getkeytable), DFL(ask,name).
Version 0.17
- The windowless floyd and floydy shells are ready
to be used (Thanks to the special guest programmer Wolfgang Wander).
Version 0.16
- The PinKlib was revised and some new features were added.
- ~/.pinkrc is executed in any case
(not only for interactive PinKs).
- strftime now should work on all systems.
- The exprselect method for selectors was added.
- The dad Message method will report unknown tables as
"ID TabID".
- A bug in user defined formatting of string fields was found and solved
(table getfield method).
- Empty strings can now be supplied for the servername,
type and port argument of the dadHost
procedure to save the current settings.
- As documented dadHost now expects the ADAMO name for the
dataflow (not longer the PinK name).
(pre)Version 0.15
- There are no revision remarks available for this period.
Publications and Pictures concerning PinK
The following PinK Publications are available:
And here are some nice Pictures concerning PinK:
How to report PinK bugs
You may help us - the PinK developers - and them - the PinK users - a lot,
if you report inconsistencies or even bugs of PinK to
pink@hermes.desy.de.
Since there are different possible classes of bugs, the following list
should give you some hints, how to report a bug in a way, that we have as much
information as needed to fix the problem.
Command or method syntax
It could happen, that the actual command or method syntax of the PinK
executable does not fit the documented one
or that the implementation of a command or method is really buggy
and reports a syntax error even if you call it with the right number and
type of arguments.
In those cases please report simply the name of the command or method and
a short discription of the problem.
Command or method semantics
If you should - after the consultation of the available documentation -
come to the conclusion, that a command or method does not behave like it's
supposed to do, this might also be a bug.
In those cases report a description of your problem including your
understanding of the command semantics and your supposition of what's going
wrong. A copy of your script may also be usefull to find out
misunderstandings.
Crashes
If PinK should ever crash and produce a core dump, it is necessary for us to
obtain both, the script you were executing and the core file itself. For the
analysis of the latter it is necessary that the PinK executable was compiled
and linked using the debug option.
If you're using PinK not on the hermes machine, please use a debugger of
your choice to produce a stack backtrace and a listing of the local variables.
Here is an example session how to do this using gdb:
maf@hermes:/export/home/maf 101>gdb /hermes/new/bin/pinky
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.13 (mips-sgi-irix5), Copyright 1994 Free Software Foundation, Inc...
(gdb) core ~kai/slow_control/tcl/pinkydump
Core was generated by `pinky'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/local/lib/libtcl.so...done.
Reading symbols from /usr/local/lib/libtk.so...done.
Reading symbols from /cern/pro/lib/libpawlib.so...done.
Reading symbols from /cern/pro/lib/libmathlib.so...done.
Reading symbols from /usr/local/lib/libX11.so.6.0...done.
Reading symbols from /usr/lib/libm.so...done.
Reading symbols from /lib/libc.so.1...done.
#0 0x49a0d4 in so_write (elem=0xffffffff, cmd=3, len=0, buf=0x0,
memstat=mem_keep) at server.c:598
server.c:598: No such file or directory.
(gdb) where
#0 0x49a0d4 in so_write (elem=0xffffffff, cmd=3, len=0, buf=0x0,
memstat=mem_keep) at server.c:598
#1 0x4854d0 in co_Close (elem=0x7fff493c) at ccommand.c:600
#2 0x47fba4 in dadDisconnect (Id=22, ok=0x7fff4960) at dadlib.c:216
#3 0x47fee4 in dadExit () at dadlib.c:270
#4 0x450384 in pink_dadexit (interp=0x10125018) at dadexit.c:57
#5 0x428f20 in pink_exit (dummy=0x0, interp=0x10125018, argc=1,
argv=0x7fff4a90) at exit.c:71
#6 0x5ffa7608 in Tcl_Eval ()
#7 0x5ffb3cc8 in Tcl_RecordAndEval ()
#8 0x41b050 in StdinProc (clientData=0x0, mask=1) at tkMain.c:387
#9 0x5d85b8 in Tk_DoOneEvent () at tkEvent.c:1358
#10 0x5d89c0 in Tk_MainLoop () at tkEvent.c:1535
#11 0x41ad90 in main (argc=1, argv=0x7fff5ebc) at tkMain.c:298
(gdb) info locals
cmdptr = (int *) 0x3
cmdlen = 0
Bugs of the Browser
Even if the browser pb is not officially supported, the same rules as
for crashes apply to bug reports concerning this tool. Please include the
following information in your report:
- Which data did you browse (File, Server, etc.)?
- Which command line flags did you use to start pb?
- (How) can the bug be reproduced (sequence of button pushes etc.)?
- If tcl/Tk reports a stack trace include it in you message.
The stack trace can usually be requested in a separte dialog box and
looks like this example:
can't read "pritabinfo(dcBurstInfo,Column,iHits[1],Expr)": no such element in array
while executing
"set expr $pritabinfo($tabname,Column,$fname,Expr)..."
(procedure "_pritab_getvalue" line 9)
invoked from within
"_pritab_getvalue $name $fname"
invoked from within
"set value [_pritab_getvalue $name $fname]..."
("foreach" body line 3)
invoked from within
"foreach fname $pritabinfo($name,Columns) {
if $pritabinfo($name,Column,$fname,Hidden) continue
set value [_pritab_getvalue $name $fname] ..."
("for" body line 19)
invoked from within
"for {set i 1; set y 0} {$i <= $rows} {incr i} {
$adname fetch ID $i
#----------------------------------------------------------------------#
# Ch ..."
(procedure "tab_update" line 44)
invoked from within
"tab_update $name 1"
invoked from within
"return [tab_update $name 1]..."
(procedure "tab_print" line 122)
invoked from within
"tab_print [lindex "dcBurstInfo dcScalInfo dcSyncInfo dscSCALERS" [.adbrowser.help.selector2.f.entries curselection]]"
(command bound to event)
The PinK executables
The PinK executables are simple programms consisting of the Tcl command
language, the Tk toolkit, the ADAMO and DAD library, and a short main
program that reads commands from standard input or from a file. They create
a main window and then process PinK/Tcl commands.
Since version 0.17 there is also a windowless version (not including the Tk
toolkit) available. Click here for the
documentation of the Floyd executables.
If the PinK executables are
invoked with no -f option then they read commands
interactively from standard input. They will continue
processing commands until all windows have been deleted or
until EOF (End Of File) is reached.
If the -file option is provided to Tk, then the PinK executables
read commands from the file named in the -file option. These
commands will normally create an interactive interface
consisting of one or more widgets. When the end of the
command file is reached, the exxecutables will continue to respond to X
events until all windows have been deleted.
If there exists a file .pinkrc in the home directory of the
user, it will be evaluated as a PinK script just before reading
the first command from standard input or from the script.
The PinK executables come in two flavors: pink and pinky.
While pink uses the full featured ADAMO tap library
including the complete ZEBRA code, pinky uses only the
smalltap library without the ZEBRA drivers which makes the
executable much smaller.
A little backdraw of pinky is, that due to the lack of the ZEBRA
drivers there are no GAF objects available; however -
this makes pinky ideal as an interpreter for DAD client scripts.
Command line syntax
pink and pinky have the same command line syntax as
wish, allowing the following options:
- -display display
- Defines the display (and screen) on which to display the
main window.
- -file fileName
- Read commands from fileName rather than standard input.
The last element in fileName will be used as the title for the
application and name of its interpreter for send commands
(unless overridden by the -name option).
- -geometry geometry
- Initial geometry to use for window.
geometry is of the form
[widthxheight][+/-xoffset+/-yoffset],
where all parameters are numbers measured in pixels.
The width and height parts of the geometry
specification sepecify the size of the initial window, while
the xoffset and yoffset parts are used to specify
the distance of the window from the left (+xoffset)
or right (-xoffset) and top
(+yoffset) and bottom (-yoffset)
edges of the screen.
Offsets must be given as pairs; in other words, in order to
specify either xoffset or yoffset both must be
present. The window can be placed in the four corners of the screen
using the following specifications:
- +0+0 upper left hand corner.
- -0+0 upper right hand corner.
- -0-0 lower right hand corner.
- +0-0 lower left hand corner.
- -help
- Print a summary of the command-line options and exit.
- -name name
- Use name as the title to be displayed in the window, and as
the name of the interpreter for send commands.
- -sync
- Execute all X server commands synchronously, so that errors are
reported immediately. This will result in much slower execution,
but it is useful for debugging.
The PinK library
On startup the PinK executables try to find an additional Tcl autoload
library in one of the following directories:
./pinklib, $PINK_LIB, $HERMES_LIB/pinklib and
$HERMES_ROOT/lib/pinklib.
The directories are checked in this order. The name of first existing
directory will be reported and prepended to the list in auto_path.
The Startup Files
After searching for the oink library, the PinK executables try to exectute
the file pinkrc (for pink and pinky) resp.
floydrc (for floyd and floydy) in this directory.
If the file is not found, the files ~/.pinkrc and ~/.floydrc
are checked.
The *rc-files coming with the distribution try to execute the files
$HERMES_ROOT/lib/*rc and ~/.*rc in that order.
PinK scripts
If you create a PinK script in a file whose first line is
#!/hermes/pro/bin/pink -f
or
#!/hermes/pro/bin/pinky -f
then you can invoke the script file directly from your shell if you
mark it as executable. This assumes that PinK has been installed in the
default location in /hermes/pro/bin;
if it's installed somewhere else then you'll have to modify the above line
to match.
How to report PinK bugs
You may help us - the PinK developers - and them - the PinK users - a lot,
if you report inconsistencies or even bugs of PinK to
pink@hermes.desy.de.
Since there are different possible classes of bugs, the following list
should give you some hints, how to report a bug in a way, that we have as much
information as needed to fix the problem.
Command or method syntax
It could happen, that the actual command or method syntax of the PinK
executable does not fit the documented one
or that the implementation of a command or method is really buggy
and reports a syntax error even if you call it with the right number and
type of arguments.
In those cases please report simply the name of the command or method and
a short discription of the problem.
Command or method semantics
If you should - after the consultation of the available documentation -
come to the conclusion, that a command or method does not behave like it's
supposed to do, this might also be a bug.
In those cases report a description of your problem including your
understanding of the command semantics and your supposition of what's going
wrong. A copy of your script may also be usefull to find out
misunderstandings.
Crashes
If PinK should ever crash and produce a core dump, it is necessary for us to
obtain both, the script you were executing and the core file itself. For the
analysis of the latter it is necessary that the PinK executable was compiled
and linked using the debug option.
If you're using PinK not on the hermes machine, please use a debugger of
your choice to produce a stack backtrace and a listing of the local variables.
Here is an example session how to do this using gdb:
maf@hermes:/export/home/maf 101>gdb /hermes/new/bin/pinky
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.13 (mips-sgi-irix5), Copyright 1994 Free Software Foundation, Inc...
(gdb) core ~kai/slow_control/tcl/pinkydump
Core was generated by `pinky'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/local/lib/libtcl.so...done.
Reading symbols from /usr/local/lib/libtk.so...done.
Reading symbols from /cern/pro/lib/libpawlib.so...done.
Reading symbols from /cern/pro/lib/libmathlib.so...done.
Reading symbols from /usr/local/lib/libX11.so.6.0...done.
Reading symbols from /usr/lib/libm.so...done.
Reading symbols from /lib/libc.so.1...done.
#0 0x49a0d4 in so_write (elem=0xffffffff, cmd=3, len=0, buf=0x0,
memstat=mem_keep) at server.c:598
server.c:598: No such file or directory.
(gdb) where
#0 0x49a0d4 in so_write (elem=0xffffffff, cmd=3, len=0, buf=0x0,
memstat=mem_keep) at server.c:598
#1 0x4854d0 in co_Close (elem=0x7fff493c) at ccommand.c:600
#2 0x47fba4 in dadDisconnect (Id=22, ok=0x7fff4960) at dadlib.c:216
#3 0x47fee4 in dadExit () at dadlib.c:270
#4 0x450384 in pink_dadexit (interp=0x10125018) at dadexit.c:57
#5 0x428f20 in pink_exit (dummy=0x0, interp=0x10125018, argc=1,
argv=0x7fff4a90) at exit.c:71
#6 0x5ffa7608 in Tcl_Eval ()
#7 0x5ffb3cc8 in Tcl_RecordAndEval ()
#8 0x41b050 in StdinProc (clientData=0x0, mask=1) at tkMain.c:387
#9 0x5d85b8 in Tk_DoOneEvent () at tkEvent.c:1358
#10 0x5d89c0 in Tk_MainLoop () at tkEvent.c:1535
#11 0x41ad90 in main (argc=1, argv=0x7fff5ebc) at tkMain.c:298
(gdb) info locals
cmdptr = (int *) 0x3
cmdlen = 0
Bugs of the Browser
Even if the browser pb is not officially supported, the same rules as
for crashes apply to bug reports concerning this tool. Please include the
following information in your report:
- Which data did you browse (File, Server, etc.)?
- Which command line flags did you use to start pb?
- (How) can the bug be reproduced (sequence of button pushes etc.)?
- If tcl/Tk reports a stack trace include it in you message.
The stack trace can usually be requested in a separte dialog box and
looks like this example:
can't read "pritabinfo(dcBurstInfo,Column,iHits[1],Expr)": no such element in array
while executing
"set expr $pritabinfo($tabname,Column,$fname,Expr)..."
(procedure "_pritab_getvalue" line 9)
invoked from within
"_pritab_getvalue $name $fname"
invoked from within
"set value [_pritab_getvalue $name $fname]..."
("foreach" body line 3)
invoked from within
"foreach fname $pritabinfo($name,Columns) {
if $pritabinfo($name,Column,$fname,Hidden) continue
set value [_pritab_getvalue $name $fname] ..."
("for" body line 19)
invoked from within
"for {set i 1; set y 0} {$i <= $rows} {incr i} {
$adname fetch ID $i
#----------------------------------------------------------------------#
# Ch ..."
(procedure "tab_update" line 44)
invoked from within
"tab_update $name 1"
invoked from within
"return [tab_update $name 1]..."
(procedure "tab_print" line 122)
invoked from within
"tab_print [lindex "dcBurstInfo dcScalInfo dcSyncInfo dscSCALERS" [.adbrowser.help.selector2.f.entries curselection]]"
(command bound to event)

The PinK Basics
PinK is a TCL/TK extension providing an interface to the
ADAMO and
DAD
packages. ADAMO implements the Entity Relationship Database
Model and DAD extends it towards a distributed multiprocess database
with fast and flexible IO. PinK is designed to serve as an easy to use
interface incorporating both the DAD- and ADAMO features. The tk tollkit
and other graphical extensions (like
BLT)
provide graphics widgets enabeling the PinK programmer to make GUI's
to the database in an easy way.
The implementation of the ADAMO- and DAD-features is object oriented
and hence a very intuitive approach to the database. Nevertheless to
be able to understand PinK, basic knowledge of the ADAMO and DAD
concepts is a prerequisit. PinK tries to stay as close as possible to
ADAMO and DAD, making it easy to design applications for users being
familiar with these conceps.
There are two basic objects to comunicate with a database in PinK:
- GAF
- The Generic Adamo File which is a file
using different access modes and drivers and can beaccessed
directly from the PinK shell, and
- DAD-Connection
- A connection to the database via a DAD-server or DAD-pipe.
In PinK these objects each have a set of methods to access,
manipulate and insert information stored in the database. The
substructure of the database is organized in dataflows and tables
which are objects themselfs having methods being independent of
whether the dataflow or table comes from a GAF or a
DAD-connection. Selectors and Indices are subojects to for customizing the
acces to the information in a table.
In general PinK is independent of the structure of a database and it's
data definition. Opening a database via the above mentioned objects
the entire structure of the data can be transferred to the PinK
application thus being independent of a specific implementation of a
datamodel.
Another way to use PinK is to indepenindently biuld a database defining
it's own structure entirely inside PinK.
The GAF object in PinK
A GAF is a Generic Adamo File storing data
in one or more records where each contains a set of dataflows and tables sharing the same data definition but
being different instances. In high energy physics for example a record
could be an event holding raw data in tables belonging to one dataflow
and reconstruction data in tables and dataflows belonging to a second
dataflow. A GAF would contain the events from one run in this
example.
A GAF can for example be either a random access, a sequential binary or a
sequential ASCII file which can be accessed using the appropriate
IO-driver (ZEBRA drivers RZ, FZ or IE). It usually contains a so
called Key Table holding information
specific to the records contained in the GAF, e.g. the run number, the
event number and the trigger type in the above mentioned example. A
record could also hold a data sample with a certain validity period in
which case this period for the specific record is an entry of the Key Table.

The Floyd executables
There is a windowless variation of the
PinK executables called Floyd.
This are simple programms consisting of the Tcl command
language, the ADAMO and DAD library, and a short main
program that reads commands from standard input or from a file.
If invoked with no arguments then Floyd runs interactively,
reading PinK/Tcl commands from standard input and printing
command results and error messages to standard output. It
runs until the exit command is invoked or until it reaches
end-of-file on its standard input.
If there exists a file .floydrc in the home directory of the
user, it will be evaluated as a PinK script just before reading
the first command from standard input or from the script.
The Floyd executables come in two flavors: floyd and
floydy.
While floyd uses the full featured ADAMO tap library
including the complete ZEBRA code, floydy uses only the
smalltap library without the ZEBRA drivers which makes the
executable much smaller.
A little backdraw of floydy is, that due to the lack of the ZEBRA
drivers there are no GAF objects available; however -
this makes floydy ideal as an interpreter for DAD client scripts.
Command line syntax
floyd and fludyy have the same command line syntax as
tclsh:
floyd [fileName [arg ...]]
If Floyd is invoked with arguments then the first argument
is the name of a script file and any additional arguments
are made available to the script as variables (see below).
Instead of reading commands from standard input Floyd will
read PinK commands from the named file and exit when it reaches the
end of the file.
The following variables are available in the Floyd script:
- argc
- Contains a count of the number of arguments (0 if none), not
including the name of the script file.
- argv
- Contains a list whose elements are the arguments, in order, or an
empty string if there are no arg arguments.
- argv0
- Contains fileName if it was specified. Otherwise, contains
the name by which Floyd was invoked.
- tcl_interactive
- Contains 1 if Floyd is running interactively
(no fileName was specified and standard input is a terminal-like
device), 0 otherwise.
The PinK library
On startup the Floyd executables try to find an additional Tcl autoload
library in one of the following directories:
./pinklib, $PINK_LIB, $HERMES_LIB/pinklib and
$HERMES_ROOT/lib/pinklib.
The directories are checked in this order. The name of first existing
directory will be reported and prepended to the list in auto_path.
Floyd Scripts and the Idle Function
There are two features of the PinK executables that are introduced by
the Tk library one wants not easily top give up in the windowless version.
This two commands are the after
command and the CreateFH
method on Dad objects. Hence this two features are implemented in Floyd
making it necessary to set Floyd in an idle mode where it reacts
on timer and connection events. This idle mode is entered using the
floydl function.
Special Floyd commands
This is a list of commands that are only available in Floyd
or were reimplemented to substitute the Tk commands.
Special Floyd commands:
Command: after
Execute a command after a time delay.
after delay_ms [arg ...]
- A delay of delay_ms milliseconds is generated.
- If there are further arguments given, a command string is formed
out of them (using the concat command) and executed after the
delay. If further arguments are omitted, after sleeps
for delay_ms milliseconds and the script will not process any
events during this time.
See also:
Command: floydl
Enter the idle mode. In this mode Flyd will process all
after and CreateFH events until there are no
more open connections and no after command requests - in
that case floydl returns.
floydl
See also:

The ADAMO GAF objects in PinK
This is a list of PinK commands and methods to handle ADAMO GAF objects.
For an introduction to ADAMO see the
Users guide,
for a description of the Fortran interface have a look into the
Reference Manual.
PinK commands related to ADAMO GAFs:
PinK currently supports the following methods on ADAMO GAF objects:
Command: cregaf
Creates an ADAMO GAF and an associated PinK GAF object.
You may open an existing GAF with the opengaf
command.
cregaf objectname keytable options
- The name of the PinK object to be created is given by objectname.
- keytable is the PinK name of a table to be used as template for
the GAFs keytable structure.
- The string options is directly passed to the TAB function, it
consists of comma separted fields of the form keyword=value
where keyword is one of the following:
- NAME is a character string giving the file name.
- DRIVER may be FZ for sequential access (Default),
RZ for direct access, IE for the import/export
format.
- FILFOR defines the file format.
- INDE (=R, W or RW) controls the
transfer of indices. If index is not specified, the default
is not to write indices out but to read them back if they are
present, i.e. INDE=R. The keyword INDE without
any value implies INDE=RW.
- SELE (=R, W or RW) controls the
transfer of selectors in the same way as indices.
- (NO)WARN (Dis)allow warning messages when the meta tables
are read back and do not agree with tables in memory.
(WARN is the default).
- (NO)SAVEMT Pass empty tables to the GAF driver for output.
This can be useful for the OR and BS drivers. (NOSAVEMT is
the default).
- LUN logical unit number
- MEDIUM (= TAPE, DISK, MEMO or
CHAN) specify tape, disk (default), memory or channel.
- RECSIZ gives the recordsize measured in words,
- FILSIZ defines the filesize counting in words,
- RECFOR specifies the record format.
For further information see the
ADAMO reference manual.
See also:
-
ADAMO reference manual entry (cregaf),
- close,
drop,
listgaf,
opengaf,
DRIVER,
FILFOR,
FILSIZ,
INDE,
LUN,
MEDIUM,
NAME,
RECFOR,
RECSIZ,
RWMODE,
SELE,
WARN.
Command: listgaf
Lists all open GAFs to stdout. Therefore this function only usefull
for debugging purposses.
listgaf
See also:
Command: opengaf
Open an existing ADAMO GAF and create an associated PinK GAF object.
You may create a new GAF with the cregaf
command.
opengaf objectname options
- The name of the PinK object to be created is given by objectname.
- The string options is directly passed to the TAB function, it
consists of comma separted fields of the form keyword=value
where keyword is one of the following:
- NAME is a character string giving the file name.
- DRIVER may be FZ for sequential access (Default),
RZ for direct access, IE for the import/export
format.
- FILFOR defines the file format.
- RWMODE (=R or RW) defines the
access mode. Default is RWMODE=R (readonly mode).
- INDE (=R, W or RW) controls the
transfer of indices. If index is not specified, the default
is not to write indices out but to read them back if they are
present, i.e. INDE=R. The keyword INDE without
any value implies INDE=RW.
- SELE (=R, W or RW) controls the
transfer of selectors in the same way as indices.
- (NO)WARN (Dis)allow warning messages when the meta tables
are read back and do not agree with tables in memory.
(WARN is the default).
- (NO)SAVEMT Pass empty tables to the GAF driver for output.
This can be useful for the OR and BS drivers. (NOSAVEMT is
the default).
- LUN logical unit number
- MEDIUM (= TAPE, DISK, MEMO or
CHAN) specify tape, disk (default), memory or channel.
- RECSIZ gives the recordsize measured in words,
- FILSIZ defines the filesize counting in words,
- RECFOR specifies the record format.
For further information see the
ADAMO reference manual.
See also:
-
ADAMO reference manual entry (opegaf),
- close,
cregaf,
drop,
listgaf,
DRIVER,
FILFOR,
FILSIZ,
INDE,
LUN,
MEDIUM,
NAME,
RECFOR,
RECSIZ,
RWMODE,
SELE,
WARN.
GAF method: askkey
Get a description of the key used for a GAF. You may then create a
keytable using the cretab command.
<gafobj> "askkey"
- <gafobj> is the name of a PinK GAF object,
- askkey is the name of the applied method.
- Return value: a list of column descriptors, each one of the form:
name type
where
- name is the name of the column and
- type is the type of the column.
See also:
GAF method: close
Close an open GAF and destroy the attached PinK object.
<gafobj> "close"
- <gafobj> is the name of a PinK GAF object,
- close is the name of the applied method.
See also:
GAF method: delete
Deletes the record specified in the window common block of a keytable
from a GAF.
<gafobj> "delete" keytab
- <gafobj> is the name of a PinK GAF object,
- delete is the name of the applied method.
- The PinK table name keytab specifies the window common block
that is used to identify the GAF record to be deleted.
See also:
GAF method: DRIVER
Get the driver used for a GAF object.
<gafobj> "DRIVER"
- <gafobj> is the name of a PinK GAF object,
- DRIVER is the name of the applied method.
- Return value: Name of the driver.
See also:
-
ADAMO reference manual entry (askgaf),
- cregaf,
opengaf,
FILFOR,
FILSIZ,
INDE,
LUN,
MEDIUM,
NAME,
RECFOR,
RECSIZ,
RWMODE,
SELE,
WARN.
GAF method: drop
Drop an open GAF, i.e. remove it from disk and destroy the attached PinK
object.
<gafobj> "drop"
- <gafobj> is the name of a PinK GAF object,
- drop is the name of the applied method.
See also:
GAF method: fetch
Fetch a table or dataflow out of a GAF database record specified in the
window common block of a keytable.
<gafobj> "fetch" keytab tdf
- <gafobj> is the name of a PinK GAF object,
- fetch is the name of the applied method.
- The PinK table name keytab specifies the window common block
that is used to identify the GAF record to be refered.
- tdf specifies the PinK name of a table or dataflow object
to be read out of the GAF record.
See also:
GAF method: FILFOR
Get the file format used for a GAF object.
<gafobj> "FILFOR"
- <gafobj> is the name of a PinK GAF object,
- FILFOR is the name of the applied method.
- Return value: File format of the GAF.
See also:
-
ADAMO reference manual entry (askgaf),
- cregaf,
opengaf,
DRIVER,
FILSIZ,
INDE,
LUN,
MEDIUM,
NAME,
RECFOR,
RECSIZ,
RWMODE,
SELE,
WARN.
GAF method: FILSIZ
Get the file size of a GAF in words.
<gafobj> "FILSIZ"
- <gafobj> is the name of a PinK GAF object,
- FILSIZ is the name of the applied method.
- Return value: File size of this GAF in words.
See also:
-
ADAMO reference manual entry (askgaf),
- cregaf,
opengaf,
DRIVER,
FILFOR,
INDE,
LUN,
MEDIUM,
NAME,
RECFOR,
RECSIZ,
RWMODE,
SELE,
WARN.
GAF method: INDE
Get index IO mode used for a GAF object.
<gafobj> "INDE"
- <gafobj> is the name of a PinK GAF object,
- INDE is the name of the applied method.
- Return value: Index IO mode, i.e. "R",
"W" or "RW".
See also:
-
ADAMO reference manual entry (askgaf),
- cregaf,
opengaf,
DRIVER,
FILFOR,
FILSIZ,
LUN,
MEDIUM,
NAME,
RECFOR,
RECSIZ,
RWMODE,
SELE,
WARN.
GAF method: insert
Inserts the record specified in the window common block of a keytable
into a GAF.
<gafobj> "insert" keytab
- <gafobj> is the name of a PinK GAF object,
- insert is the name of the applied method.
- The PinK table name keytab specifies the window common block
that is used to identify the GAF record to be inserted.
See also:
GAF method: LUN
Get the number of the logical unit used for a GAF object.
<gafobj> "LUN"
- <gafobj> is the name of a PinK GAF object,
- LUN is the name of the applied method.
- Return value: Number of the logical unit.
See also:
-
ADAMO reference manual entry (askgaf),
- cregaf,
opengaf,
DRIVER,
FILFOR,
FILSIZ,
INDE,
MEDIUM,
NAME,
RECFOR,
RECSIZ,
RWMODE,
SELE,
WARN.
GAF method: MEDIUM
Get the medium the file of a GAF object is stored on.
<gafobj> "MEDIUM"
- <gafobj> is the name of a PinK GAF object,
- MEDIUM is the name of the applied method.
- Return value: Name of the medium used for storing the data of this GAF
object:
- "DISK" specifies disk storage,
- "TAPE" specifies a tape,
- "MEMO" memory is used or
- "CHAN" a channel.
See also:
-
ADAMO reference manual entry (askgaf),
- cregaf,
opengaf,
DRIVER,
FILFOR,
FILSIZ,
INDE,
LUN,
NAME,
RECFOR,
RECSIZ,
RWMODE,
SELE,
WARN.
GAF method: meta
Read the meta information of a table or a dataflow from a GAF. The missing
ADAMO objects will be created, you can then build PinK objects using the
grabobj command.
<gafobj> "meta" adamotdf
- <gafobj> is the name of a PinK GAF object,
- fetch is the name of the applied method.
- adamotdf specifies the ADAMO name of a table or dataflow
object for which the meta information should be read.
See also:
GAF method: NAME
Get the name of the file used to store the data of a GAF object.
<gafobj> "NAME"
- <gafobj> is the name of a PinK GAF object,
- NAME is the name of the applied method.
- Return value: Name of the data file.
See also:
-
ADAMO reference manual entry (askgaf),
- cregaf,
opengaf,
DRIVER,
FILFOR,
FILSIZ,
INDE,
LUN,
MEDIUM,
RECFOR,
RECSIZ,
RWMODE,
SELE,
WARN.
GAF method: next
Write the key of the next record of a GAF database into the window common
block of a keytable. After the opening of a GAF next will give
you the key of the first record.
Note: The GAF has to be in read only mode to use this method.
<gafobj> "next" keytab
- <gafobj> is the name of a PinK GAF object,
- next is the name of the applied method.
- The PinK table name keytab specifies the window common block
that will be filled with the key of the next GAF record.
See also:
GAF method: print
Print information about a GAF to stdout. Therefore this function
only usefull for debugging purposses.
<gafobj> "print"
- <gafobj> is the name of a PinK GAF object,
- print is the name of the applied method.
See also:
GAF method: RECFOR
Get the record format of a GAF object.
<gafobj> "RECFOR"
- <gafobj> is the name of a PinK GAF object,
- RECFOR is the name of the applied method.
- Return value: Record format.
See also:
-
ADAMO reference manual entry (askgaf),
- cregaf,
opengaf,
DRIVER,
FILFOR,
FILSIZ,
INDE,
LUN,
MEDIUM,
NAME,
RECSIZ,
RWMODE,
SELE,
WARN.
GAF method: RECSIZ
Get the record size in words used for a GAF object.
<gafobj> "RECSIZ"
- <gafobj> is the name of a PinK GAF object,
- RECSIZ is the name of the applied method.
- Return value: Size of one record in words.
See also:
-
ADAMO reference manual entry (askgaf),
- cregaf,
opengaf,
DRIVER,
FILFOR,
FILSIZ,
INDE,
LUN,
MEDIUM,
NAME,
RECFOR,
RWMODE,
SELE,
WARN.
GAF method: replace
Replaces the record specified in the window common block of a keytable
in a GAF database.
<gafobj> "replace" keytab
- <gafobj> is the name of a PinK GAF object,
- replace is the name of the applied method.
- The PinK table name keytab specifies the window common block
that is used to identify the GAF record to be replaced in the datafile.
See also:
GAF method: rewind
Rewind a GAF database. To get the key of the first record you may use
the next method afterwards.
Note: The GAF has to be in read only mode to use this method.
<gafobj> "rewind"
- <gafobj> is the name of a PinK GAF object,
- rewind is the name of the applied method.
See also:
GAF method: RWMODE
Get general IO mode for a GAF object.
<gafobj> "RWMODE"
- <gafobj> is the name of a PinK GAF object,
- RWMODE is the name of the applied method.
- Return value: Access mode, i.e. "R" or
"RW".
See also:
-
ADAMO reference manual entry (askgaf),
- cregaf,
opengaf,
DRIVER,
FILFOR,
FILSIZ,
INDE,
LUN,
MEDIUM,
NAME,
RECFOR,
RECSIZ,
SELE,
WARN.
GAF method: SELE
Get selector IO mode for a GAF object.
<gafobj> "SELE"
- <gafobj> is the name of a PinK GAF object,
- SELE is the name of the applied method.
- Return value: Selector IO mode, i.e. "R",
"W" or "RW".
See also:
-
ADAMO reference manual entry (askgaf),
- cregaf,
opengaf,
DRIVER,
FILFOR,
FILSIZ,
INDE,
LUN,
MEDIUM,
NAME,
RECFOR,
RECSIZ,
RWMODE,
WARN.
GAF method: set
Set the transfer option of a table or all tables contained in a dataflow
with respect to a GAF. With this option you can define whether indices,
selectors and projectors are transfered with a table or not.
<gafobj> "set" tdf option
- <gafobj> is the name of a PinK GAF object,
- fetch is the name of the applied method.
- tdf specifies the PinK name of a table or dataflow object
for which the option should be set.
- option specifies the transfer option. See the
ADAMO reference manual for further information.
See also:
GAF method: snapshot
Writes all record keys of a GAF matching a filter condition into
a keytable. The table is not cleared, i.e. the information is added.
You may use the table object method clear
to empty the keytable before the use of snapshot.
Note: This method for drivers supportin direct access
operations.
<gafobj> "snapshot" keytab [filter]
- <gafobj> is the name of a PinK GAF object,
- snapshot is the name of the applied method.
- The table specified by the TCl object name keytab will be
filled with the record keys that are matching the filter condition
given by the last argument.
- filter defines a filter condition, i.e. only record keys
fulfilling this condition will be written into keytab.
An empty string matches all records, this is also the default value.
For example filter conditions see the
ADAMO reference manual.
See also:
GAF method: WARN
Get status of the WARN flag for a GAF object.
This flag enables/disables warning messages when the meta tables
are read back and do not agree with tables in memory.
<gafobj> "WARN"
- <gafobj> is the name of a PinK GAF object,
- WARN is the name of the applied method.
- Return value: Status of the flag, "YES" or
"NO".
See also:
-
ADAMO reference manual entry (askgaf),
- cregaf,
opengaf,
DRIVER,
FILFOR,
FILSIZ,
INDE,
LUN,
MEDIUM,
NAME,
RECFOR,
RECSIZ,
RWMODE,
SELE.

The DAD objects in PinK
This is a list of PinK commands and methods to handle DAD objects.
For an introduction to DAD and a description of it's C and Fortran
interface, see
the DAD
manual.
PinK commands related to DAD functions:
PinK currently supports the following methods on DAD objects:
Command: dadConnect
Opens a DAD connection as specified in the connection database.
This database is build up using dadInit
and/or dadHost,
dadConnect dad_name dataflow
- The string name defines the name for the PinK object you
want to create
- The second argument dataflow gives the ADAMO name of the
dataflow you want to access.
See also:
Command: dadDoConnect
Opens a DAD connection.
dadDoConnect name servername type port
[dataflow [keytable] [-urbwgkmz]
- The string name defines the name for the PinK object you
want to create.
- The servername either contains the name of the host
where the server is expected to be running or the name of a local
UNIX socket filename. If a pipe or file is the specified connection
this name refers to the unix file name.
- The type is either:
- 'INET' for a internet socket connection,
- 'UNIX' for a local unix socket connection,
- 'RFIL' for reading from a dad file,
- 'WFIL' for writing to a dad file,
- 'RPIP' for reading from a dad pipe,
- 'WPIP' for writing to a dad pipe.
- The port contains the port number of the external
host where the server is listening for clients or 0 in the case
of a local connection.
- The argument dataflow gives the ADAMO name of the
dataflow you want to access. This argument can be ommitted if for
'RFIL' and 'RPIP' connections.
- The keytable may contain the PinK name of the keytable if
the -k flag is specified. The keytable has to be created
before calling dadDoConnect.
- The flags specify the operation mode for the database
access. You may use
- -r for reading information from the connection,
- -w for writing information to the connection,
- -u for the updating scheme,
- -b for booking new information on a server,
- -g if the Adamo tables should be generated while
connecting (you'll need this in most cases
together with the flag -r),
- -k for access to the keytable,
- -m open connection in multi mode,
- -z switch on compression.
See also:
Command: dadErrtoStr
Translates a Dad error code into a human readable form.
dadErrtoStr errorcode
- The errorcode is a code out of the Dad library.
- Returns a string describing the Dad error.
See also:
Command: FtoTime
Translates a fortran style date/time pair into the time_t
format used on UNIX.
FtoTime YYMMDD hhmmss
- The first argument YYMMDD specifies the date.
- The second argument hhmmss specifies the time.
- Returns an integer representing the same time in seconds since
start of 1970 (time_t).
See also:
Command: dadGetNackErrno
Get current error code of Dad's nack library.
dadGetNackErrno
- Returns an interger describing a Dad server error.
See also:
Command: dadGetNackErrString
Get string desribing the last server error..
dadGetNackErrString
- Returns a string describing a Dad server error.
See also:
Command: dadinit
Reads in the connection definitions stored in dadinit.cnf.
dadInit
See also:
Command: dadHost
Defines a host to connect to. Overwrites entries defined in
dadinit.cnf read in with dadInit.
.
dadHost servername type port dataflow [-urbwgkmz]
- The string servername either contains the name of the host
where the server is expected to be running or the name of a local
UNIX socket filename. If a pipe or file is the specified connection
this name refers to the unix file name.
- The type is either:
- 'INET' for a internet socket connection,
- 'UNIX' for a local unix socket connection,
- 'RFIL' for reading from a dad file,
- 'WFIL' for writing to a dad file,
- 'RPIP' for reading from a dad pipe,
- 'WPIP' for writing to a dad pipe.
- The port contains the port number of the external
host where the server is listening for clients or 0 in the case
of a local connection.
- The next argument dataflow gives the ADAMO name of the
dataflow you want to access.
- The flags specify the operation mode for the database
access. You may use
- -r for reading information from the server,
- -w for writing information to the server,
- -u for the updating scheme,
- -b for booking new information on the server,
- -g if the Adamo tables should be generated while
connecting to the server,
- -k for access to the keytable,
- -m open connection in multi mode,
- -z switch on compression.
Since Version 0.16 empty strings may be supplied for
the servername, type and port argument
to save the current settings.
See also:
Command: dadOpenDB
Opens a DAD server connection.
dadOpenDB name servername port dataflow [-urbwgk]
- The string name defines the name for the PinK object you
want to create.
- The servername either contains the name of the host
where the server is expected to be running or the name of a local
UNIX socket filename.
- The port contains the port number of the external
host where the server is listening for clients or 0 in the case
of a local connection.
- The next argument dataflow gives the ADAMO name of the
dataflow you want to access.
- The keytable may contain the name of the keytable if
the -k flag is specified.
- The flags specify the operation mode for the database
access. You may use
- -r for reading information from the server,
- -w for writing information to the server,
- -u for the updating scheme,
- -b for booking new information on the server,
- -g if the Adamo tables should be generated while
connecting to the server,
- -k for access to the keytable.
See also:
Command: dadOpenFile
Opens a DAD file.
dadOpenFile name filename dataflow [keytable] [-rwbgkcmz]
- The string name defines the name for the PinK object you
want to create.
- The filename refers to the unix file name.
- The next argument dataflow gives the ADAMO name of the
dataflow you want to access. If you open the file in multi
mode, supply an empty string as dataflow name.
- The keytable may contain the name of the keytable if
the -k flag is specified.
- The flags specify the operation mode for the database
access. You may use
- -r for reading information from the server,
- -w for writing information to the server,
- -b for booking new information on the server,
- -g if the Adamo tables should be generated while
connecting to the server,
- -k for access to the keytable,
- -c create and check checksums,
- -m open connection in multi mode.
- -z switch on compression.
See also:
Command: dadOpenPipe
Opens a DAD pipe connection.
dadOpenPipe name pipename split dataflow [keytable] [-rwgkn]
- The string name defines the name for the PinK object you
want to create.
- The pipename can point to a named pipe on the
local filesystem which shall be opened for reading/writing.
You can also use dadOpenPipe to start child processes
connected via unnamed pipes. See the
Dad manual entry for details.
- If split is a number greater than 1 (i.e. the user wants to
split the pipe), the pipename must contain a substring '%d'
where the Dad library will insert the number of the current split
branch.
- The next argument dataflow gives the ADAMO name of the
dataflow you want to access. If you open the connection in multi
mode, supply an empty string as dataflow name.
- The keytable may contain the name of the keytable if
the -k flag is specified.
- The flags specify the operation mode for the database
access. You may use
- -r for reading information from the server,
- -w for writing information to the server,
- -g if the Adamo tables should be generated while
connecting to the server,
- -k for access to the keytable,
- -m open connection in multi mode,
- -n if a writing operation would block the method
dadWrite will return an aEwouldblock error and
skip the record.
See also:
Command: dadOpenSHM
Opens a DAD shared memory connection.
dadOpenSHM name memname dataflow [keytable] [-rwgkm]
- The string name defines the name for the PinK object you
want to create.
- The memname is the name of a dad shared memory
file node.
- The next argument dataflow gives the ADAMO name of the
dataflow you want to access. If you open the connection in multi
mode, supply an empty string as dataflow name.
- The keytable may contain the name of the keytable if
the -k flag is specified.
- The flags specify the operation mode for the database
access. You may use
- -r for reading information from the server,
- -w for writing information to the server,
- -g if the Adamo tables should be generated while
connecting to the server,
- -k for access to the keytable,
- -m open connection in multi mode.
See also:
Command: dadParse
Evaluates a DAD
parser expression.
Note that the indexing of array elements is ADAMO-like in this case
(this is not the default behaviour of the DAD parser which
is to use C-style indexing, i.e. all indices start with 0).
dadParse expression [table]
- The expression is a DAD parser expression to be
evaluated.
- table is the PinK object name of the default table for
field name interpretation. If this argument is omitted, no default
table is defined.
- Return value: The result of the evaluation or a DAD parser error
message.
See also:
Command: dadSetAuthFun
Sets a procedure to be called for user authentication.
dadSetAuthFun [authproc]
- Return value: Name of authentication procedure that was used before.
See also:
Command: dadSetPipeHandle
Set the pipe to be read from, if a process was started via
dadOpenPipe.
dadSetPipeHandle pipename
- The name pipename is passed to the process via the
command line option --dadinputpipe.
See also:
Command: FtoTime
Translates a fortran style date/time pair into the time_t
format used on UNIX.
FtoTime YYMMDD hhmmss
- The first argument YYMMDD specifies the date.
- The second argument hhmmss specifies the time.
- Returns an integer representing the same time in seconds since
start of 1970 (time_t).
See also:
Dad method: Accept
Load current database record from server.
<dadobj> "Accept"
- <dadobj> is the name of a PinK Dad object,
- Accept is the name of the applied method.
See also:
Dad method: AcceptClr
Clear condition list for a connection.
<dadobj> "AcceptClr"
- <dadobj> is the name of a PinK Dad object,
- AcceptClr is the name of the applied method.
See also:
Dad method: AcceptDo
Load current database record from server considering conditions
established using the AcceptIf or
AcceptOr methods.
<dadobj> "AcceptDo"
- <dadobj> is the name of a PinK Dad object,
- AcceptDo is the name of the applied method.
See also:
Dad method: AcceptIf
Add a condition into the list for a connection. This condition will be
ANDed with prevoius ones. You may insert a logical OR using
AcceptOr.
<dadobj> "AcceptIf" table condition
- <dadobj> is the name of a PinK Dad object,
- AcceptIf is the name of the applied method.
- table is the object name of a table the condition has to
check or:
- "KEYTAB" to specify the single row of the
keytable of this record,
- "NOTAB" to specify no table to loop over.
- condition is a condition formulated using Dad's
expression parser syntax.
See also:
Dad method: AcceptOr
Insert an OR into the condition list for a connection.
<dadobj> "AcceptOr"
- <dadobj> is the name of a PinK Dad object,
- AcceptOr is the name of the applied method.
See also:
Dad method: AcceptSelect
Set a selector on the keytable of a connection, i.e. if the Dad methods
Rewind, Last,
Prev and Next
will consider the condition list for this connection.
<dadobj> "AcceptSelect" flag
- <dadobj> is the name of a PinK Dad object,
- AcceptSelect is the name of the applied method.
- flag is a boolean value. If it's True, the condition
list will be considered on cursor movements, if it's False
it will be ignored.
See also:
Dad method: AcceptTest
Tests if the condition list for the connection is true or false for the
current record.
<dadobj> "AcceptTest"
- <dadobj> is the name of a PinK Dad object,
- AcceptTest is the name of the applied method.
- Return value:
- True if the condition list is fulfilled,
- False if not.
See also:
Dad method: Book
Activates booking for the complete dataflow served by a connection.
First clears the booking condition list.
<dadobj> "Book"
- <dadobj> is the name of a PinK Dad object,
- Book is the name of the applied method.
See also:
Dad method: BookClr
Deactivates booking and clears the booking condition list for a connection.
<dadobj> "BookClr"
- <dadobj> is the name of a PinK Dad object,
- BookClr is the name of the applied method.
See also:
Dad method: BookDo
Activates booking for the complete dataflow served by a connection
considering the current status. Only records fulfilling the booking
condition list will be sent.
<dadobj> "BookDo"
- <dadobj> is the name of a PinK Dad object,
- BookDo is the name of the applied method.
See also:
Dad method: BookDoNow
Activates booking for the complete dataflow served by a connection.
Only new records fulfilling the booking condition list will be sent.
<dadobj> "BookDoNow"
- <dadobj> is the name of a PinK Dad object,
- BookDoNow is the name of the applied method.
See also:
Dad method: BookIf
Appends a condition to the booking condition list. All those conditions
are ORed.
<dadobj> "BookIf" table condition
- <dadobj> is the name of a PinK Dad object,
- BookIf is the name of the applied method,
- table is the object name of a table the condition has to
check or:
- "KEYTAB" to specify the single row of the
keytable of this record,
- "NOTAB" to specify no table to loop over.
- condition is a condition formulated using Dad's
expression parser syntax.
See also:
Dad method: CreateFH
Binds a PinK procedure to a connection to be called whenever a message
is pending.
<dadobj> "CreateFH" [procedure]
- <dadobj> is the name of a PinK Dad object,
- CreateFH is the name of the applied method,
- the PinK procedure procedure will be called with
the PinK object name of the Dad connection if a message is
pending on the connection:
<procedure> dadobj
If this argument is omitted the call back mechanism for the
given connection is stopped.
- Return value: Name of procedure that was used before.
See also:
Dad method: Disconnect
Close a connection of any type (there are no methods corresponding to
dadCloseFile or
dadClosePipe).
<dadobj> "Disconnect"
- <dadobj> is the name of a PinK Dad object,
- Disonnect is the name of the applied method.
See also:
Dad method: FillRecordKey
Transfers the window common block of an PinK table object to the internal
one used by Dad. The key is the used with the next
Write operation.
<dadobj> "FillRecordKey" table
- <dadobj> is the name of a PinK Dad object,
- FillRecordKey is the name of the applied method,
- table is the name of a PinK table object to
be read from.
See also:
Dad method: Flush
Remove all pending messages from the queue of a booked connection.
<dadobj> "Flush"
- <dadobj> is the name of a PinK Dad object,
- Flush is the name of the applied method.
See also:
Dad method: GetDataflow
Get the ADAMO name of the dataflow served by a dad object.
<dadobj> "GetDataflow"
- <dadobj> is the name of a PinK Dad object,
- GetDataflow is the name of the applied method.
- Return value: The ADAMO name of the served Dataflow.
See also:
Dad method: GetKeyTable
Get the ADAMO name of the keytable used by a Dad connection used with the
keytable flag (-k).
You may get the name of an associated PinK object with
getobj or create a new one using
grabobj.
<dadobj> "GetKeyTable"
- <dadobj> is the name of a PinK Dad object,
- GetKeyTable is the name of the applied method.
- Return value: ADAMO name of the keytable.
See also:
Dad method: GetRecordId
Get the ID of the current record of a connection. Keep in mind that this
ID's do not correspond to the timeordering of the records.
<dadobj> "GetRecordId"
- <dadobj> is the name of a PinK Dad object,
- GetRecordId is the name of the applied method.
- Return value: The ID of the current record (integer value).
See also:
Dad method: GetRecordKey
Transfers the internal keytable window common block used by Dad to the
one owned by an PinK table objecct. The internal Dad keytable is set on
Accept, AcceptDo
and Read calls.
<dadobj> "GetRecordKey" table
- <dadobj> is the name of a PinK Dad object,
- GetRecordKey is the name of the applied method,
- table is the name of a PinK table object of which the
window common block should be filled.
See also:
Dad method: GetTabIf
Loads a complete table or a defined subset of its rows from the server.
<dadobj> "GetTabIf" table [expression]
- <dadobj> is the name of a PinK Dad object,
- GetTabIf is the name of the applied method.
- table is the name of a PinK table object to be read
- The expression is a condition formulated in Dad's
expression parser syntax. Only rows fulfilling this condition will
be loaded. If this argument is omitted, all rows will be loaded.
See also:
Dad method: Handle
Get the file descriptor handle of a connection.
<dadobj> "Handle"
- <dadobj> is the name of a PinK Dad object,
- Handle is the name of the applied method.
- Return value: The file descriptor for this connection (integer value).
See also:
Dad method: Last
Go to the last record of a database. The accept condition list may
be considered in dependence of the
AcceptSelect flag.
<dadobj> "Last"
- <dadobj> is the name of a PinK Dad object,
- Last is the name of the applied method.
See also:
Dad method: Message
Waits for booking messages from the server.
If there are incoming messages within the specified timeout period these
are automaticly applied to the adamo tables.
<dadobj> "Message" wtime [*table [*rowid]]
- <dadobj> is the name of a PinK Dad object,
- Message is the name of the applied method,
- After wtime seconds a timeout error will occure.
- The variable table will be set to the ADAMO name of the
changed table.
- The variable wtime will be set to the number of rows,
the table contained before the update.
See also:
Dad method: Multimode
Sets or clears a selector on the keytable of the server for further record
movement (Last, Next,
Prev and Rewind).
All clients in multimode on a certain dataflow will operate synchronously
concerning the mentioned record moving operations.
<dadobj> "Multimode" flag
- <dadobj> is the name of a PinK Dad object,
- Multimode is the name of the applied method.
- flag is a boolean value. If it's True, the multimode
will be enabled, if it's False it will be disabled.
See also:
Dad method: MRead
Read the next record from input opend in multi mode. The difference
to read is, that the record type might
change within the input source. This way the ADAMO
NEXT/FETCH
scheme can be simulated by writing the key and data in
subsequent records.
<dadobj> "MRead" [readflag]
- <dadobj> is the name of a PinK Dad object,
- MRead is the name of the applied method,
- if readflag is given and not true, the contents of the
next record is not read.
- Return value: The name (type) of the record read.
See also:
Dad method: MWrite
Write an output record in multi mode. The difference
to write is, that the record type might
be differnt for each record written. This way the ADAMO
NEXT/FETCH
scheme can be simulated by writing the key and data in
subsequent records.
<dadobj> "MWrite" table/dataflow
- <dadobj> is the name of a PinK Dad object,
- MWrite is the name of the applied method,
- table/dataflow is the PinK name of the table or dataflow
to be written in the next record.
See also:
Dad method: New
Generates a new empty record on the server and appends it to the end of
the keytable.
<dadobj> "New"
- <dadobj> is the name of a PinK Dad object,
- New is the name of the applied method.
See also:
Dad method: Next
Go to the following record of a database. The accept condition list may
be considered in dependence of the
AcceptSelect flag.
<dadobj> "Next"
- <dadobj> is the name of a PinK Dad object,
- Next is the name of the applied method.
See also:
Dad method: NextUpdate
Get the time when the current records validity period ends. You may then
use the Update method.
<dadobj> "NextUpdate"
- <dadobj> is the name of a PinK Dad object,
- NextUpdate is the name of the applied method.
- Return value:
- End time of the validity period of the current record
(time_t value) or
- "TILLEVER" if there is now upper limit.
See also:
Dad method: Param
Get some parameters of this connection.
<dadobj> "Param"
- <dadobj> is the name of a PinK Dad object,
- Param is the name of the applied method.
- Return value: A list of the form
servername type port dataflow flags
where
- The servername either contains the hostname,
the name of a local UNIX socket a UNIX file or pipe name.
- The type filed may contain:
- 'INET' for a internet socket connection,
- 'UNIX' for a local unix socket connection,
- 'RFIL' for reading from a dad file,
- 'WFIL' for writing to a dad file,
- 'RPIP' for reading from a dad pipe,
- 'WPIP' for writing to a dad pipe.
- The port contains the port number of the external
host where the server was listening for clients or 0 in the case
of a local connection.
- The dataflow element contains the ADAMO name of the
dataflow which is served by this connection.
- The flags field reports the operation mode for the
database access. It may contain the following flags:
- -r connection can read information from the server,
- -w connection write information to the server,
- -u connection uses the updating scheme,
- -b connection uses the booking scheme,
- -g the ADAMO tables were generated while
connecting to the server,
- -k the keytable may be accessed,
- -n the method dadWrite will not block but return an
aEwouldblock error and skip the record.
See also:
Dad method: Prev
Go to the previous record of a database. The accept condition list may
be considered in dependence of the
AcceptSelect flag.
<dadobj> "Prev"
- <dadobj> is the name of a PinK Dad object,
- Prev is the name of the applied method.
See also:
Dad method: PrevUpdate
Get the time when the current records validity period begins.
<dadobj> "PrevUpdate"
- <dadobj> is the name of a PinK Dad object,
- PrevUpdate is the name of the applied method.
- Return value:
- Start time of the validity period of the current record
(time_t value) or
- "SINCEEVER" if there is now lower limit.
See also:
Dad method: Read
Load the next database record from the database. For server
connections this is equivaltent to a Next
method followed up by the Accept method.
The accept condition list may be considered in dependence of the
AcceptSelect flag.
<dadobj> "Read"
- <dadobj> is the name of a PinK Dad object,
- Read is the name of the applied method.
See also:
Dad method: RepUpdate
Replaces time dependend information on the server. To use the
RepUpdate method the referred table has to contain update
information in two columns named iTimeStart and
iTimeEnd.
<dadobj> "RepUpdate" table [selector]
- <dadobj> is the name of a PinK Dad object,
- RepUpdate is the name of the applied method,
- table is the name of a PinK table object to be updated,
- selector is the name of a PinK selector object to be used
on this table. The whole table will be updated as default.
See also:
Dad method: Rewind
Go back to the first record of a database. The accept condition list may
be considered in dependence of the
AcceptSelect flag.
<dadobj> "Rewind"
- <dadobj> is the name of a PinK Dad object,
- Rewind is the name of the applied method.
See also:
Dad method: Semophore
Requests/releases a semaphore from the server. Semaphores are currently
only used to prevent write accesses to the server while the semaphore
holder is updating some database contents.
<dadobj> "Semaphore" valtime [flags]
- <dadobj> is the name of a PinK Dad object,
- Semaphore is the name of the applied method,
- the semaphore will stay valid for valtime seconds.
A value of 0 releases the semaphore. After the validity period has
passed without the client releasing the semaphore again, any other
client's call to dadSemaphore with the same type will succeed and the
clients write permission will vanish.
- The only yet valid flags argument is -w defining
the semaphore to be of the "exclusive write access" type.
This allows only this client to modify the attached database.
The -w flag is also the default.
See also:
Dad method: SetRecordId
Set the ID of the next record to be read with
Accept. Keep in mind that the (physical)
ordering by ID's does not correspond to the timeordering of the records.
<dadobj> "SetRecordId" id
- <dadobj> is the name of a PinK Dad object,
- SetRecordId is the name of the applied method.
- The integer value id specifies a record.
See also:
Dad method: Shutdown
Shutdown the server of this connection and close the connection.
<dadobj> "Shutdown"
- <dadobj> is the name of a PinK Dad object,
- Shutdown is the name of the applied method.
See also:
Dad method: TimeDaf
Set the cursor to the database record which is valid for a given time. The
database has to be opened in update mode for this operation. The record may
then be read using the Accept method.
<dadobj> "TimeDaf" reqtime
- <dadobj> is the name of a PinK Dad object,
- TimeDaf is the name of the applied method.
- The cursor will be moved to the record valid for the requested
time reqtime (time_t format).
See also:
Command: TimetoF
Translates a UNIX time_t time into a date/time pair
used with Fortran.
TimetoF time
- time is an integer representing the time in seconds since
start of 1970 (time_t convention).
- Returns a string consiting of two field in the format
YYMMDD hhmmss
where YYMMDDspecifies the date and
hhmmss specifies the time.
See also:
Dad method: Update
Get the database record which is valid for a given time. The
database has to be opened in update mode for this operation.
<dadobj> "Update" reqtime [newrowflag]
- <dadobj> is the name of a PinK Dad object,
- Update is the name of the applied method.
- The record valid for the requested time reqtime
(time_t format) will be loaded.
- The boolean flag newrowflag should be True on the first
call and if one expects the number of rows in the client tables to be
changed. If it's set to False, only the rows that are currently
in the client tables are updated.
See also:
Dad method: Write
The method Write writes the whole dataflow to the database
and replaces the database representation of the current record. This call
should be embraced by calls to Semaphore if
you're altering data on a server to which more than one clients may be
connected.
<dadobj> "Write"
- <dadobj> is the name of a PinK Dad object,
- Write is the name of the applied method.
See also:
Dad method: WriteTab
The method WriteTab writes a table or parts of it to the database
and replaces the database representation. This call should be embraced by
calls to Semaphore if you're altering data on
a server to which more than one clients may be connected.
<dadobj> "WriteTab" table [selector [flags]]
- <dadobj> is the name of a PinK Dad object,
- WriteTab is the name of the applied method.
- table is the PinK name of the tabe object to be written and
- the PinK object selector specifies the rows to be written back.
You may specify "ALL" to select all rows, which is
also the default.
- The argument flags can consist of the following flags:
- -c clear the database table first,
- -a append data to the database table,
- -r replace the database table.
See also:
Dad method: WUpdate
Writes the rows of a table contained in a selector to the database.
If the referred table contains update information in the two columns
named iTimeStart and iTimeEnd, only the iTimeStart
value will be used, the iTimeEnd fields will be set to
TILLEVER giving the rows an infinite period of validity.
In contrast to the RepUpdate method the table
does not need to contain the update information columns for the usage of
WUpdate - if there is none the rows are simply appended to the
servers tables.
<dadobj> "WUpdate" table [selector]
- <dadobj> is the name of a PinK Dad object,
- WUpdate is the name of the applied method,
- table is the name of a PinK table object to be updated,
- selector is the name of a PinK selector object to be used
on this table. The whole table will be updated as default.
See also:

The ADAMO table objects in PinK
This is a list of PinK commands and methods to handle ADAMO table objects.
For an introduction to ADAMO see the
Users guide,
for a description of the Fortran interface, see
Reference Manual.
PinK commands related to ADAMO tables:
PinK currently supports the following methods on ADAMO table objects:
Command: cretab
Creates an ADAMO table and an associated PinK table object.
cretab objectname tablename collist [inirow [maxrow]]
- The name of the PinK obecjt is given by objectname, while
- tablename specifies the ADAMO name of the table.
- The PinK list collist consists of column descriptors
of the following form:
name type [format]
where
- name is the name of the column,
- type is the type of the column and
- format defines the output format for the field
values of this column. If the format is omitted, the
ADAMO default format will be used.
- The inirow paramter specifies how many rows should be
allocated for the table on creation. It defaults to
"e;NULL"e; meaning that ADAMO can choose a proper value
on its own.
- The final optinal argument maxrow restricts the table to
have at most so many rows. It defaults to "e;NULL"e; saying
that thete is (nearly) no upper limit.
See also:
Table method: clear
Clear the table.
<tabobj> "clear"
- <tabobj> is the name of a PinK table object,
- clear is the name of the applied method.
See also:
Table method: clearnext
Clears the counter containing the row ID that will be obtained
on the next insert operation setting the ID field to
"NEXT".
<tabobj> "clearnext"
- <tabobj> is the name of a PinK table object,
- clearnext is the name of the applied method.
See also:
Table method: columns
Gets a list of column descriptors for this table.
<tabobj> "columns"
- <tabobj> is the name of a PinK table object,
- columns is the name of the applied method.
- Return value: a list of column descriptors, each one of the form:
name type format
where
- name is the name of the column,
- type is the type of the column and
- format defines the output format for the field
values of this column.
See also:
Table method: delent
Deletes an entity from the table. This is equivalent to
delrow.
<tabobj> "delent" [rowid]
- <tabobj> is the name of a PinK table object,
- delent is the name of the applied method.
- rowid is the index of the row to be deleted. This will be
written into the window common block first. If there is no index given,
the value from the window common block is used.
See also:
Table method: delmany
Deletes a subset of rows from a table.
<tabobj> "delmany" access [cursor1 [cursor2]]
- <tabobj> is the name of a PinK table object,
- delmany is the name of the applied method.
- The subset of rows to be deleted is given by the access
parameter which is either a PinK selector or index name. It may also be
set to ""ID"" defining the table row ID as index.
- cursor1 gives the start of the range in access
actually to be deleted and defaults to "MINC"
while
- cursor2 defines the end of this range
and defaults to "MAXC".
See also:
Table method: delrow
Deletes a row from the table. This is equivalent to
delent.
<tabobj> "delrow" [rowid]
- <tabobj> is the name of a PinK table object,
- delrow is the name of the applied method.
- rowid is the index of the row to be deleted. This will be
written into the window common block first. If there is no index given,
the value from the window common block is used.
See also:
Table method: describe
Prints a description of this table to stdout. Therefore it's only
usefull for debugging purposses.
<tabobj> "describe"
- <tabobj> is the name of a PinK table object,
- describe is the name of the applied method.
See also:
Table method: drop
Destroys a table and removes it's PinK object. All depending indices and
selectors will disappear also.
Important Note: It is not allowed to drop a table that is used
by an open Dad connection.
<tabobj> "drop"
- <tabobj> is the name of a PinK table object,
- drop is the name of the applied method.
See also:
Table method: fetch
Copy a row from a table into its window common block. The row is specified
by it's ID in a selector or index.
<tabobj> "fetch" access cursor
- <tabobj> is the name of a PinK table object,
- fetch is the name of the applied method.
- The access parameter defines either a PinK selector or index
name. It may also be "ID" defining the table
row ID as index.
- cursor gives the index in access of the row
to be copied to the window common block.
See also:
Table method: fetcol
Get a column out of a table.
The data is formated as with getfield.
Note that only one dimensional arrays are supported by PinK.
<tabobj> "fetcol" colname [access [cursor1 [cursor2 [format]]]]
- <tabobj> is the name of a PinK table object,
- fetcol is the name of the applied method.
- colname is the name of the column to be extracted.
- access is the pink name of an access to this table.
It's ID by default.
- cursor1 is the index of the first element to be replaced in
access. It's MINC by default.
- cursor2 is the index of the last element to be replaced in
access. It's MAXC by default.
- format is a user defined format.
See also:
Table method: getfield
Get the contents of a field of the table's window common block.
<tabobj> "getfield" field [format]
- <tabobj> is the name of a PinK table object,
- getfield is the name of the applied method.
- The field parameter specifies the field which should
be read out. This name may contain an one dimensional index.
- format specifies the format of the returnvalue of
getfield. If this parameter is omitted, the PinK default
format is used. If "DEFAULT" is submitted,
the default ADAMO format defined with
setformat is used. In any other case,
the format is interpreted as a C format string, that should contain
exactly one format element that corresponds with the type of
field.
Important Note: The maximum result length is
limited to 256 characters. If you exceed this length or if more than
one format element or one of the wrong type is given, PinK may
get corrupted and show some strange behaviour.
- Return value: The value of the requested field.
See also:
Table method: getrelation
Get the target table and index of a relation initiated by the contents
of the table's window common block.
<tabobj> "getrelation" relation
- <tabobj> is the name of a PinK table object,
- getrelation is the name of the applied method.
- The relation parameter specifies the relation which should
be followed.
See also:
Table method: getrow
Copy a table row into the window common block.
<tabobj> "getrow" [rowid]
- <tabobj> is the name of a PinK table object,
- getrow is the name of the applied method.
- rowid is the index of the row to be copied. This will be
written into the window common block first. If there is no index given,
the current value from the window common block is used.
See also:
Table method: id
Gets the ADAMO ID of a PinK table object.
<tabobj> "id"
- <tabobj> is the name of a PinK table object,
- id is the name of the applied method.
- Return value: The ADAMO ID of this table object (integer value).
See also:
Table method: indices
Get a list of all PinK index objects defined for a table.
<tabobj> "indices"
- <tabobj> is the name of a PinK table object,
- indices is the name of the applied method.
- Return value: List of all index names for this table.
See also:
Table method: inirow
Gets the value of the inirow parameter used on definition of a
table which defines the number of initially allocated rows.
<tabobj> "inirow"
- <tabobj> is the name of a PinK table object,
- inirow is the name of the applied method.
- Return value: the number of initially allocated rows for
this table or "NULL" if no value was
specified.
See also:
Table method: inscol
Insert a column into a table. If the table is empty the first
inscol operation has to fill the ID column and
will define the table length. If the table is
not empty the inserted column elements have to match the table size.
The data is parsed as in setfield.
Note that only one dimensional arrays are supported by PinK.
Note:This function is not yet enabled since
the TAP function
inscol seems to be buggy in the current ADAMO version.
<tabobj> "inscol" colname vallist
- <tabobj> is the name of a PinK table object,
- inscol is the name of the applied method.
- colname is the name of the column to be replaced.
- vallist is a list of values to be inserted in the table.
See also:
Table method: insent
Writes an entity from the window common block into the table. This
is not equivalent to insrow
since relationships will not be transfered.
<tabobj> "insent" [rowid]
- <tabobj> is the name of a PinK table object,
- insent is the name of the applied method.
- rowid is the index of the entity to be written. This value
will be written into the window common block first. If there is no
index given, the current value from the window common block is used.
See also:
Table method: insrow
Writes the entire window common block into a row of the table.
<tabobj> "insrow" [rowid]
- <tabobj> is the name of a PinK table object,
- insrow is the name of the applied method.
- rowid is the index of the row to be written. This value
will be written into the window common block first. If there is no
index given, the current value from the window common block is used.
See also:
Table method: iselement
Test if a row is contained in a table.
<tabobj> "iselement" [rowid]
- <tabobj> is the name of a PinK table object,
- iselement is the name of the applied method.
- rowid is the index of the row to be tested. This value
will be written into the window common block first. If there is no
index given, the current value from the window common block is used.
- Return value: boolean value,
- True if the row is already in the table,
- False if not.
See also:
Table method: list
Prints a short description of this table to stdout. Therefore it's
only usefull for debugging purposses.
<tabobj> "list"
- <tabobj> is the name of a PinK table object,
- list is the name of the applied method.
See also:
Table method: lock
Lock this table, i.e. modifications are no longer allowed.
<tabobj> "lock"
- <tabobj> is the name of a PinK table object,
- lock is the name of the applied method.
See also:
Table method: maxrow
Get the maximum allowed number of rows in a table.
<tabobj> "maxrow"
- <tabobj> is the name of a PinK table object,
- maxrow is the name of the applied method.
- Return value: the number of maximum allowed rows for
this table or "NULL" if no limit was
specified.
See also:
Table method: name
Gets the ADAMO name of a PinK table object.
<tabobj> "name"
- <tabobj> is the name of a PinK table object,
- name is the name of the applied method.
- Return value: The ADAMO name of this table object.
See also:
Table method: nullwin
Sets all fields of a window common block to null except for the ID.
<tabobj> "nullwin" [rowid]
- <tabobj> is the name of a PinK table object,
- nullwin is the name of the applied method.
- rowid is an ID that will be stored in the window common
block. If no ID is given, the field won't be changed.
See also:
Table method: numcol
Gets the number of columns building up a table.
<tabobj> "numcol"
- <tabobj> is the name of a PinK table object,
- numcol is the name of the applied method.
- Return value: number of columns stored in this table.
See also:
Table method: print
Prints the contents of a table to stdout. Therefore it's only
usefull for debugging purposses.
<tabobj> "print" [access [cursor1 [cursor2 [projector]]]]
- <tabobj> is the name of a PinK table object,
- print is the name of the applied method.
- The subset of rows to be printed is given by the access
parameter which is either a PinK selector or index name. It may be
set to "ID" defining the table row ID as index,
which is the default.
- cursor1 gives the start of the range in access
actually to be printed and defaults to "MINC"
while
- cursor2 defines the end of this range
and defaults to "MAXC".
- projector gives the PinK name of a projector used for printing
and defaults to "ALL".
Note: projectors are not yet built into PinK.
See also:
Table method: printrow
Prints one row of a table to stdout. Therefore it's only
usefull for debugging purposses.
<tabobj> "printrow" access cursor
- <tabobj> is the name of a PinK table object,
- print is the name of the applied method.
- The row to be printed is indirectly addressed by the access
parameter which is either a PinK selector or index name. It may be
set to "ID" defining the table row ID as index.
- cursor specifies the index in access
actually to be printed.
See also:
Table method: realtions
Gets a list of relations starting from this table.
<tabobj> "relations"
- <tabobj> is the name of a PinK table object,
- relations is the name of the applied method.
- Return value: a list of relations descriptors, each one of the form:
Name MinCard1 Targetlist
where
- Name is the name of the relation (column),
- MinCard1 is the minimum left cardinality (0 or 1)
- Targetlist is a list of possible targets of the form:
Table MinCard2 MaxCard2
where
- Table is the ADAMO name of a possible target table,
- MinCard2 is the minimum right cardinality,
- MaxCard2 is the maximum right cardinality.
Note:
- For generalized relationships there is more than one
target descriptor.
- MaxCard2 can be NULL if there is no limit
(noted as * in the DDL).
See also:
Table method: repcol
Replace a column in a table.
Note that only one dimensional arrays are supported by PinK.
The data is parsed as in setfield.
<tabobj> "repcol" colname vallist [access [cursor1 [cursor2]]]
- <tabobj> is the name of a PinK table object,
- repcol is the name of the applied method.
- colname is the name of the column to be replaced.
- vallist is a list of values to be inserted in the table.
- access is the pink name of an access to this table.
It's ID by default.
- cursor1 is the index of the first element to be replaced in
access. It's MINC by default.
- cursor2 is the index of the last element to be replaced in
access. It's MAXC by default.
See also:
Table method: repent
Replaces an entity in a table with the one stored in the window common block.
This is not equivalent to reprow
since relationships will not be transfered.
<tabobj> "repent" [rowid]
- <tabobj> is the name of a PinK table object,
- repent is the name of the applied method.
- rowid is the index of the entity to be replaced. This value
will be written into the window common block first. If there is no
index given, the current value from the window common block is used.
See also:
Table method: reprow
Replaces an row in a table with the one stored in the window common block.
<tabobj> "reprow" [rowid]
- <tabobj> is the name of a PinK table object,
- reprow is the name of the applied method.
- rowid is the index of the rowi to be replaced. This value
will be written into the window common block first. If there is no
index given, the current value from the window common block is used.
See also:
Table method: rows
Gets the number rows currtently contained in a table.
<tabobj> "rows"
- <tabobj> is the name of a PinK table object,
- rows is the name of the applied method.
- Return value: number of rows stored in this table.
See also:
Table method: select
Get the range of an index for which the table rows match the current
window common block. The field may be set to "ANY"
for jokers.
<tabobj> "select" [index]
- <tabobj> is the name of a PinK table object,
- select is the name of the applied method.
- index is the PinK name of an index object and may be
set to "ID" defining the table row ID as index,
which is the default.
- Return value: two integers cursor1 and cursor2
giving the match range. If cursor2 is less then
cursor1 no match was found.
See also:
Table method: selectors
Get a list of all PinK selector objects defined for a table.
<tabobj> "selectors"
- <tabobj> is the name of a PinK table object,
- selectors is the name of the applied method.
- Return value: List of all selector names for this table.
See also:
Table method: setfield
Modify the contents of a field of the table's window common block.
<tabobj> "setfield" field value
- <tabobj> is the name of a PinK table object,
- setfield is the name of the applied method.
- The field parameter specifies the field which should
be modified. This name may contain an one dimensional index.
- value specifies the new value of the field. In dependence
of the field type, the following keywords are recognized:
- Type INTE:
"NULL", "ANY".
- Type REAL:
"NULL", "ANY".
- Type SNUM:
"NULL", "NEXT".
- Type IMPL:
"NULL", "NEXT".
See also:
Table method: setformat
Sets the default format of a table column.
<tabobj> "setformat" column format
- <tabobj> is the name of a PinK table object,
- tabsetformat is the name of the applied method.
- The column parameter specifies the name of the column
for which the default format should be changed.
- format specifies the new default format.
See also:
Table method: setpropt
Set the printing options for a table to be used by
print and
printrow.
<tabobj> "setpropt" options
- <tabobj> is the name of a PinK table object,
- setpropt is the name of the applied method.
- options specifies the printing options. See the
ADAMO reference manual for further information.
See also:
Table method: unlock
Unlock a table, i.e. allow modifications.
<tabobj> "unlock"
- <tabobj> is the name of a PinK table object,
- unlock is the name of the applied method.
See also:
Table method: wcbsize
Gets the size of the ADAMO Window Common Block (WCB) of a PinK table
object.
This size is equivalent to the memory one row of this table consumes.
<tabobj> "wcbsize"
- <tabobj> is the name of a PinK table object,
- wcbsize is the name of the applied method.
- Return value: Size of a table row in bytes.
Table method: what
Report the type of this object.
<tabobj> "what"
- <tabobj> is the name of a PinK table object,
- what is the name of the applied method.
See also:

The ADAMO dataflow objects in PinK
This is a list of PinK commands and methods to handle ADAMO dataflow objects.
For an introduction to ADAMO see the
Users guide,
for a description of the Fortran interface, see
Reference Manual.
PinK commands related to ADAMO dataflows:
PinK currently supports the following methods on ADAMO dataflow objects:
Command: credfl
Creates an ADAMO dataflow and an associated PinK dataflow object.
credfl objectname [dflname]
- The name of the PinK object is given by objectname, while
- dflname specifies the ADAMO name of the dataflow to be
created. If this argument is omitted, the ADAMO name defaults to the
PinK name, that then must honor the
ADAMO naming rules.
See also:
Command: topdfl
Gets the contents of the root ADAMO dataflow, i.e. a ADAMO name list of all
tables and dataflows. You may get the name of an associated PinK object with
getobj or create a new one using
grabobj.
topdfl
- Return value: A list of two lists containing the ADAMO names of
all ADAMO tables (first list) and dataflows (second list).
See also:
Dataflow method: add
Add a dataflow to a dataflow. In contrast to
insert the dataflow is not
expanded into tables but inserted as one object.
<dflobj> "add" dataflow
- <dflobj> is the name of a PinK dataflow object,
- add is the name of the applied method.
- dataflow specifies the PinK name of a dataflow object
to be added into this dataflow.
See also:
Dataflow method: ask
Get the ADAMO member names of a dataflow.
<dflobj> "ask"
- <dflobj> is the name of a PinK dataflow object,
- ask is the name of the applied method.
- Return value: A list of two lists containing the ADAMO names of
all ADAMO tables (first list) and dataflows (second list) contained in
this dataflow.
See also:
Dataflow method: clear
Clear a dataflow, i.e. remove all tables and dataflows from it.
<dflobj> "clear"
- <dflobj> is the name of a PinK dataflow object,
- clear is the name of the applied method.
See also:
Dataflow method: delete
Delete a table or dataflow from a dataflow. In contrast to
remove dataflows are first expanded into tables
which then are removed.
<dflobj> "delete" tdf
- <dflobj> is the name of a PinK dataflow object,
- delete is the name of the applied method.
- tdf specifies the PinK name of a table or dataflow object
to be removed from this dataflow.
See also:
Dataflow method: drop
Drop a dataflow and destroy the attached PinK object.
<dflobj> "drop"
- <dflobj> is the name of a PinK dataflow object,
- drop is the name of the applied method.
See also:
Dataflow method: id
Gets the ADAMO ID of a PinK dataflow object.
<dflobj> "id"
- <dflobj> is the name of a PinK dataflow object,
- id is the name of the applied method.
- Return value: The ADAMO ID of this PinK object (integer value).
See also:
Dataflow method: insert
Insert a table or dataflow into a dataflow. In contrast to
add dataflows are first expanded into tables
which then are inserted.
<dflobj> "insert" tdf
- <dflobj> is the name of a PinK dataflow object,
- insert is the name of the applied method.
- tdf specifies the PinK name of a table or dataflow object
to be inserted into this dataflow.
See also:
Dataflow method: name
Gets the ADAMO name of a PinK dataflow object.
<dflobj> "name"
- <dflobj> is the name of a PinK dataflow object,
- name is the name of the applied method.
- Return value: The ADAMO name of this PinK object.
See also:
Dataflow method: print
Prints the ADAMO member names of a dataflow to stdout.
Therefore it's only usefull for debugging purposses. You may use the
ask method to get the members as a TCL list.
<dflobj> "print"
- <dflobj> is the name of a PinK dataflow object,
- print is the name of the applied method.
See also:
Dataflow method: remove
Remove a dataflow from a dataflow. In contrast to
delete dataflows are not
expanded into tables but removed as one object.
<dflobj> "remove" dataflow
- <dflobj> is the name of a PinK dataflow object,
- remove is the name of the applied method.
- dataflow specifies the PinK name of a dataflow object
to be removed from this dataflow.
See also:
Dataflow method: what
Report the type of this object.
<dflobj> "what"
- <dflobj> is the name of a PinK dataflow object,
- what is the name of the applied method.
See also:

The ADAMO index objects in PinK
This is a list of PinK commands and methods to handle ADAMO index objects.
For an introduction to ADAMO see the
Users guide,
for a description of the Fortran interface, see
Reference Manual.
PinK commands related to ADAMO indices:
PinK currently supports the following methods on ADAMO index objects:
Command: creind
Creates an ADAMO index for a table and an associated PinK object. You may
also use getind to create an ascending index
over one column.
creind table indname collist [objectname]
- The PinK object name table specifies the name of the
table for which the index should be created and
- indname specifies the ADAMO name of index to be created.
- collist is a list of column specifiers of the following
format:
name [order]
where name is the name of a column of table and
order specifies its ordering:
- "+" or "ASC"
defines an ascending order and is used as default while
- "-" or "DESC"
defines an descending order.
- The name of the created PinK index object is given by
objectname, which defaults to table.indname.
See also:
Command: getind
Creates a PinK object for an ADAMO index of a table. If the ADAMO index does
not exist and its name corresponds to a column name, a new one is build up
over this column in ascending order. You may use
creind to create more complex indices.
getind table indname [objectname]
- The PinK object name table specifies the name of the
table for which the index should be grabbed/created and
- indname specifies the ADAMO name of the
index to be grabbed/created.
- The name of the created PinK index object is given by
objectname, which defaults to table.indname.
See also:
Index method: close
Closes an index, i.e. it will be not updated on table replacement operations
(e.g. reprow, repent,
...). This may save some execution time. However, the index will be updated
automatically when it's used the next time (so there is no open
method for index objects).
<indobj> "close"
- <indobj> is the name of a PinK index object,
- close is the name of the applied method.
See also:
Index method: drop
Drop an index and destroy the attached PinK object.
<indobj> "drop"
- <indobj> is the name of a PinK index object,
- drop is the name of the applied method.
See also:
Index method: print
Print the contents of an index (i.e. an ordered list of table row IDs)
to stdout. Therefore it's only usefull for debugging purposses.
<indobj> "print"
- <indobj> is the name of a PinK index object,
- print is the name of the applied method.
See also:
Index method: table
Get the name of the table an index is defined on.
<indobj> "table"
- <indobj> is the name of a PinK index object,
- table is the name of the applied method.
- Return value: the PinK name of the table this index is attached to.
See also:
Index method: what
Report the type of this object.
<indobj> "what"
- <indobj> is the name of a PinK index object,
- what is the name of the applied method.
See also:

The ADAMO selector objects in PinK
This is a list of PinK commands and methods to handle ADAMO selector
objects.
For an introduction to ADAMO see the
Users guide,
for a description of the Fortran interface, see
Reference Manual.
PinK commands related to ADAMO selectors:
PinK currently supports the following methods on ADAMO index objects:
Command: cresel
Creates an ADAMO selector for a table and an associated PinK object.
cresel table selname [objectname]
- The PinK object name table specifies the name of the
table for which the selector should be created and
- selname specifies the ADAMO name of selector to be created.
- The name of the created PinK selector object is given by
objectname, which defaults to table.selname.
See also:
Command: getsel
Creates a PinK object for an existing ADAMO selector of a table.
You may use cresel to create a new
selector.
getsel table selname [objectname]
- The PinK object name table specifies the name of the
table for which the selector should be grabbed and
- selname specifies the ADAMO name of the selector.
- The name of the created PinK object is given by
objectname, which defaults to table.selname.
See also:
Selector method: clear
Delete all elements in a selector.
<selobj> "clear"
- <selobj> is the name of a PinK selector object,
- clear is the name of the applied method.
See also:
Selector method: copy
Copy the contents of an index or selector in a selector.
<selobj> "copy" access cursor1 cursor2 [orflag]
- <selobj> is the name of a PinK selector object,
- copy is the name of the applied method.
- The source of the copy action is given by the access
parameter which is either a PinK selector or index name.
- cursor1 gives the start of the range in access
actually to be copied and defaults to "MINC"
while
- cursor2 defines the end of this range
and defaults to "MAXC".
- If the boolean parameter orflag is true, the destination
selector is not cleared before the operation.
See also:
Selector method: delete
Delete the row identified by the ID in the window common block of the
attached table from a selector.
<selobj> "delete" [rowid]
- <selobj> is the name of a PinK selector object,
- or is the name of the applied method.
- rowid is a directly given row index to be deleted. This value
will be written into the window common block first. If there is no
rowid given, the current value from the window common block is
used.
See also:
Selector method: drop
Drop a selector and destroy the attached PinK object.
<selobj> "drop"
- <selobj> is the name of a PinK selector object,
- drop is the name of the applied method.
See also:
Selector method: elements
Get the number of table rows contained in a selector.
<selobj> "elements"
- <selobj> is the name of a PinK selector object,
- elements is the name of the applied method.
- Return value: the number of table rows in this selector (integer value).
See also:
Selector method: insert
Insert a new the row identified by the ID in the window common block of the
attached table into a selector.
<selobj> "insert" [rowid]
- <selobj> is the name of a PinK selector object,
- insert is the name of the applied method.
- rowid is a directly given row index to be inserted. This value
will be written into the window common block first. If there is no
rowid given, the current value from the window common block is
used.
See also:
Selector method: iselement
Test, if a row is element of a selector.
<selobj> "iselement" [rowid]
- <selobj> is the name of a PinK selector object,
- iselement is the name of the applied method.
- rowid is a directly given row index to be tested. This value
will be written into the window common block first. If there is no
rowid given, the current value from the window common block is
used.
- Return value: boolean value,
- True if the row is member of the selector,
- False if not.
See also:
Selector method: lock
Lock a selector, i.e. no further write operations
(the methods clear,
copy, delete,
insert, operate,
or and select)
are allowed. You may unlock the selector again using the
unlock method.
<selobj> "lock"
- <selobj> is the name of a PinK selector object,
- lock is the name of the applied method.
See also:
Selector method: operate
Connect the contents two a indices or selectors into one selector.
<selobj> "operate" access1 operator access2 [orflag]
- <selobj> is the name of a PinK selector object,
- operate is the name of the applied method.
- The first source of the operation is given by the access1
parameter which is either a PinK selector or index name.
- operation gives the type of the operation to be performed.
This parameter may be:
- "AND" - The resulting selector will only
contain elements which are members of both
access1 and access2.
The ordring of access1 is retained.
- "OR" - The resulting selector will
contain elements which are contained in
access1 or access2. First
access1 is inserted and then all element of
access2 that are not already present.
- "DIF" - The resulting selector will
contain all elements of access1 which are
not contained in access2. The ordring of
access1 is retained.
- access2 defines the second source of the operation and
is just like access1 either a PinK selector or index name.
- If the boolean parameter orflag is true, the destination
selector is not cleared before the operation.
See also:
Selector method: or
Insert the row identified by the ID in the window common block of the
attached table in a selector if it's not already present.
<selobj> "or" [rowid]
- <selobj> is the name of a PinK selector object,
- or is the name of the applied method.
- rowid is a directly given row index to be inserted. This value
will be written into the window common block first. If there is no
rowid given, the current value from the window common block is
used.
See also:
Selector method: print
Print the contents of a selector (i.e. an ordered subset of table row IDs)
to stdout. Therefore it's only usefull for debugging purposses.
<selobj> "print"
- <selobj> is the name of a PinK selector object,
- print is the name of the applied method.
See also:
Selector method: select
Insert in a selector all table row IDs for which the value of
a specified field is element of a certain interval.
<selobj> "select" column lower upper [operation]
- <selobj> is the name of a PinK selector object,
- select is the name of the applied method.
- The name column defines the filed that will be tested
against the ragnge of values.
- lower is the lower border of the interval and
- upper is the upper one.
- The operation parameter gives the type of the operation to be
performed. This parameter may be:
- "REP" (default) - The contents of the selector
is replaced by the selected ones.
- "AND" - The resulting selector will only
contain those elements that are selected and that were
already in the selector.
- "OR" - The selected elements will be added to
the elements already in the selector.
- "DIF" - The selected elements that are already
in the selector are removed.
See also:
Selector method: table
Get the name of the table a selector is defined on.
<selobj> "table"
- <selobj> is the name of a PinK selector object,
- table is the name of the applied method.
- Return value: the PinK name of the table this selector is attached to.
See also:
Selector method: unlock
Unlock a selector, i.e. allow again write operations
(the methods clear,
copy, delete,
insert, operate,
or and select).
<selobj> "unlock"
- <selobj> is the name of a PinK selector object,
- unlock is the name of the applied method.
See also:
Selector method: what
Report the type of this object.
<selobj> "what"
- <selobj> is the name of a PinK selector object,
- what is the name of the applied method.
See also:

The miscellaneous commands of PinK
This is a list of PinK commands which are not directly related to a specific
object type. However, many of this functions are very usefull.
General miscellaneous commands:
Miscellaneous ADAMO commands:
Miscellaneous commands to handle times:
Command: getver
Get Version of PinK, ADAMO and the GAF lib.
getver [*tapver [*gafver]]
Parameters: : tapver - Version of Tap
gafver - Version of GAF
- If the variable name tapver is given, this variable will be
set to the TAP version as it is deliverd by the TAP routine
getver.
- If the variable name gafver is given, this variable will be
set to the GAF version which was linked in this executable.
This value is obtained by calling the TAP routine
getver
- Return value: The revision of the PinK library (string value). The
format must not considered to be fix.
See also:
Command: detachProcs
Force redemption of zombies started by this process.
Note that this operation is performed automatically whenever a new
process is created by the exec or open
commands.
detachProcs
Command: createFH
Create a filehandler for a file opened with open.
createFH fileId [mask procedure]
- The fileId is what you receive from open when opening a file
or a pipe.
- The mask defines, when the filehandler should be
invoked. It is a string build up out of the following letters:
- r fileId is readable
- w the fileId is writable
- e an exception happened on fileId (e.g. the pipe broke).
- The PinK procedure will be called when
the condition defined by mask becomes true. The procedure
will receive two arguments, the fileId and a mask (coded with the
letters as defined above) giving the current condition:
<procedure> fileId mask
If this argument is omitted the call back mechanism for the
given fileId is stopped.
- Return value: The previous setting of a filehandler for this fileID
See also:
Command: getobj
Gets the name of the PinK object associated to an ADAMO table or dataflow.
You may also use grabobj to create a new
PinK object.
getobj adamohandle [method]
- The name of the ADAMO table or dataflow is given by
adamohandle.
- The parameter method may be "NAME" (default)
or "ID", specifying if adamohandle is
interpreted as ADAMO name or ID.
- Return value: The name of the associated PinK object or
"" (empty string) if there is none.
See also:
Command: grabobj
Creates a PinK object for an existing ADAMO table or dataflow. You may
also use getobj to get an existing PinK object
for an ADAMO table or dataflow.
grabobj adamohandle [objname [method]]
- The name of the ADAMO table or dataflow is given by
adamohandle, while
- objname specifies the name of the PinK object to
be created. objname defaults to adamohandle.
- The parameter method may be "NAME" (default)
or "ID", specifying if adamohandle is
interpreted as ADAMO name or ID.
See also:
Command: setchk
Sets the debug level of the ADAMO library.
setchk [level]
- The ADAMO debug level is set to level.
Valid levels are:
- ALL enables extensive checking of input parameters and
their consistency with the internal data structure,
- TABLES check existence of tables,
- WINDOWS check validity of window common (TAIL),
- RSETS check that rset defined,
- ACCESS check that access methods are valid,
- RUNTIM run time checks, e.g. "does the row exist?",
- NONE disables this checking.
If this argument is omitted the ADAMO debugging level is not changed.
- Return value: the previous debugging level.
See also:
Command: gettime
Get the current time in UNIX time_t convention.
gettime
- Return value: The UNIX time in time_t conventione
(integer value).
See also:
Command: getUtime
Get and/or convert the UNIX time.
Note: This command has a very strange calling convention and is
only in for compatibility reasons. It ma disappear some day... Please use
the commands
strftime and
gettime instead.
getUtime [[UNIX_time|"now"] format]
- UNIX_time gives the time to be converted in time_t
convention. If "e;now"e; is supplied, the current
time is used.
- The final optional argument format gives the output format
in strftime()-like syntax. It defaults to
"e;%H:%M:%S"e; if the first argument is given.
If no argument is given, the current time in time_t convention
is returned.
See also:
Command: strftime
Convert the time from UNIX time_t convention into a more
human readable format using the C library call strftime().
strftime UNIX_time [format]
- UNIX_time gives the time to be converted in time_t
convention (seconds since start of 1970).
- The optional argument format defines the output format
in strftime()-like syntax. It defaults to
"e;%c"e;. A format string consists of zero or more
directives and ordinary characters. All ordinary characters are copied
unchanged into the array. Each directive is replaced by appropriate
characters as described in the following list:
- %a Locale's abbreviated weekday name.
- %A Locale's full weekday name.
- %b Locale's abbreviated month name.
- %B Locale's full month name.
- %c Locale's date and time representation.
- %d Day of month as a decimal number (01-31).
- %D Date (%m/%d/%y).
- %h Locale's abbreviated month name.
- %H Hour as a decimal number (00-23).
- %I Hour as a decimal number (01-12).
- %j Day of year (001-366).
- %m Number of month (01-12).
- %M Minute number (00-59).
- %n Newline character.
- %p Locale's equivalent to AM or PM.
- %r Time in AM/PM notation.
- %S Second number (00-59).
- %t Tab character.
- %T Time (%H/%M/%S).
- %U Week number (00-53), Sunday as first day of week.
- %w Weekday number (0[Sunday]-6).
- %W Week number (00-53), Monday as first day of week.
- %x Locale's date representation.
- %X Locale's time representation.
- %y Year without century (00-99).
- %Y Year with century.
- %Z Timezone name, no characters if no timezone.
- Return value: The readble time string.
Note:The length of the result is limitted to 127 characters.
See also:

The PinK Library
The PinK library is a collection of usefull PinK procedures. These
procedures are PinK scripts kept in a library directory in various
files. Using the tcl/tk auto_mkindex command a file called
tclIndex is created which is automatically loaded during startup of
PinK. Any procedure can then be called from the PinK shell which in
case no procedure with the same name is defined locally sources the
corresponding procedure from the library. To maintain a common user
interface for PinK applications it is strongly recommended to use
these procedures instaed of defining your own.
The following list if procedures is constantly being improved and
completed (as far as possible backward compatible).
PinK procedure: cprint
Print a canvas in color mode changing the background color to be
white, using your default printer or if specified another printer
(like lpr [-Pprinter]).
cprint canvas [printer]
- canvas is a canvas in your PinK application you want to print.
- printer is a printer name (suitable for the UNIX
lpr -P command).
Have a look at the source code!
PinK procedure: csave
Save a canvas as a postscript file in color mode changing the background color to be
white. The user will be prompted for a filename using the procedure getfilename.
csave canvas [file]
- canvas is a canvas in your PinK application you want to save.
- file is a file name to save the canvas to.
Have a look at the source code!
PinK procedure: getfilename
Ask the user for a file name in a toplevel window providing an entry
as the possibility to accept and cancel.
getfilename [title]
- title is an optional title for the toplevel window.
- return value is the file name or an empty string in case
the user cancelled.
Have a look at the source code!
PinK procedure: ConfigureGraph
This procedure was taken from the BLT distribution and customized for
PinK. It uses the tcl/tk send command to communicate with
your script. All configuration otions of the blt_graph widget
can be manioulated interactively in real time. To be able to use it
you have to use xauth-style authorization for your
X-terminal. Another PinK shell is executed communicating to the
interpreter of your application.
ConfigureGraph interpreter graph
- interpreter is the name of the interpreter to which the
send command has to submit its commands. You can get this
name using the tk-command winfo name . where the
. stands for your toplevel widget (e.g.
ConfigureGraph [winfo name .] yourgraph ).
- return value is the file name or an empty string in case
the user cancelled.
Have a look at the source code!
PinK procedure: msgs
Displays a message in a toplevel window.
msgs text [width]
- text is the text to be displayed, use \t \n
etc to format your text .
- width is the optional width in pixels for the toplevel
window (defaults to 300).
Have a look at the source code!
PinK procedure: tgraph_ini
Initializes a timegraph based on the blt_graph widget. A time
graph has as its default x-axis the time and diplays values beinig
updated in time. The user can configure the graph like a usual BLT
graph. To get the right labels onto the time axis use the library
procedure xtime.
tgraph_ini graph ntimes nlines
- graph is a BLT graph you want to initialize as a timegraph.
- ntimes is the number of updates you want to be
displayed before the graph starts to scroll.
- nlines is the number of lines you want to be displayed
in one graph.
Have a look at the source code!
PinK procedure: tgraph
Appends a new point to the line in your timegraph and draws it.
tgraph graph line_number x y
- graph is a BLT graph initialized as a timegraph using
tgraph_ini.
- line_number is the number of the line you want to update.
- x y are the coordinates to be appended to the lines
coordinate list. X should be given in UNIX time.
Have a look at the source code!
PinK procedure: tgraph_reset
Resets all lines in a timegraph, the updating can start from scratch
after this call.
tgraph_reset graph
- graph is a BLT graph initialized as a timegraph using
tgraph_ini.html>tgraph_ini to be resetted.
Have a look at the source code!
PinK procedure: tprint
Prints a BLT graph in color mode postscript format forcing the
background to be white.
tprint graph [printer]
- graph is the BLT graph in your PinK application you want to print.
- printer is a printer name (suitable for the UNIX
lpr -P command.
Have a look at the source code!
PinK procedure: tsave
Save a BLT grap as a postscript file in color mode changing the background color to be
white. The user will be prompted for a filename using the procedure getfilename.
tsave graph [file]
- graph is the BLT graph in your PinK application you want to save.
- file is a file name to save the graph to.
Have a look at the source code!
PinK procedure: xtime
A procedure to configure the time axis tick labels of a timegraph
initialized using the tgraph_ini
procedure. This procedure you should usually call during configuration of
your timegraph, you have to specify the first argument, whereas the
other two are implicitly appended to the call if used like:
yourgraph xaxis configure -title "time" -command "xtime %H:%M:%S"
The procedure is then called automatically whenever you update your
timegraph with tgraph.
xtime format graph UNIX_time
- format is the time format for the tick labels. The
valid formats are the same as for the strftime command.
- graph is a BLT graph initialized as a timegraph using
tgraph_ini.html>tgraph_ini.
- UNIX_time is the UNIX time of the point to be plotted.
Have a look at the source code!

The PinK High Voltage Example
This is a short example on how to build a hardware client, a Dad server and
some PinK clients to control a high voltage power supply.
You may obtain all source codes of this example as an archive
from here.
The Server
The Server is build straight forward as described here in the
Dad Manual.
You may have a look at the DDL and the
source code used in this example. See also the
dadinit.cnf and
portdef.h files.
The Hardware client
The client simulates a meassurement of the current high voltage values
every ten seconds.
It can also process certain commands given by the controller task (see below)
via the server.
You may have a look at the source code here.
The Bargraph Monitor
This PinK script displays the current values of the High Voltage in a bargraph
style. It receives the newest values from the server.
You may have a look at the PinK script here.

The Timegraph Monitor
This PinK script displays the current values of the High Voltage in a timegraph
style. It receives the newest values from the server.
You may have a look at the PinK script here.

The Controller Task
This PinK script is a tiny High Voltage Controller. It can send commands to
the hardware client via the server and receive and display messages the
other way round.
You may have a look at the PinK script here.


This page is maintained by
pink@hermes.desy.de;
last modification: Tue Aug 12 18:19:19 MST 1997 .