A Rexx interface to Mix C/Database Toolchest
Version 1.1
28 December 2002
Table of Contents
- Introduction
- Rexx/CDT Usage
- Return Values
- Functions
- CDTaddrec
- CDTclose_db
- CDTcreate_db
- CDTdelrec
- CDTfindhead
- CDTfindkey
- CDTfindnext
- CDTfindprev
- CDTfindtail
- CDTgetindexdesc
- CDTgeterror
- CDTgetfldcount
- CDTgetfldnames
- CDTgetfldtype
- CDTgetindexnames
- CDTgetrec
- CDTopen_index
- CDTcreate_index
- CDTadd_index
- CDTmodrec
- CDTopen_db
- CDTexit
- CDTinit
- CDTLoadFuncs
- CDTDropFuncs
- CDTVariable
Introduction
This document describes the Rexx/CDT external function library
and how to use it. It assumes a general knowledge of the
Mix C/Database Toolchest
and have access to the reference manual for that package.
Rexx/CDT Usage
This section describes those usability issues that are not possible to
implement in Rexx in the same manner they are implemented in C.
Return Values
All Rexx/CDT return values that are as similar as possible to that documented in the
C/Database Toolchest User Manual. When a database or index obejct is returned, it is an
internal number that should only be used to pass back into other Rexx/CDT functions.
Changing this value in any way will probably make your program crash!
A return value of I_OK, I_ERROR etc, will be represented as the string equivalent, but
without the leading "I_". ie in a Rexx/CDT program:
If CDTclose_db( db_obj ) = "OK" Then ...
Functions
CDTaddrec( db_obj, index_obj, fields )
Adds a new record to the database.
db_obj is the value returned from
CDTiopen_db or
CDTcreate_db.
index_obj is the value returned from
CDTihandle, or if this parameter is not supplied or is
blank, the physical index is used.
The fields parameter is specified as a stem name which represents a Rexx array.
The array contains the new record values.
ie assuming you pass fields., fields.0 must represent the number of fields in the record, and fields.1 through
fields.n contain the values for each field.
Returns: I_OK on success, I_ERROR on error
CDTclose_db( db_obj )
Closes the specified database.
db_obj is the value returned from
CDTiopon_db.
Returns: I_OK on success, I_ERROR on error
CDTcreate_db( name, blksize, fielddesc )
Creates a new database and opens it.
name specifies the name of the database; it should not include an extension.
blksize specifies the size of of blocks to create.
The fielddesc parameter is specified as a stem name which represents a Rexx array.
The array contains the field descriptions for the database.
ie assuming you pass fields., fields.0 must represent the number of fields in the record, and fields.1 through
fields.n contain the description for each field.
Returns: The database handle (a number) on success, "" on error
CDTdelrec( db_obj, index_obj )
Deletes the current record for the specified database and index.
db_obj is the value returned from
CDTiopen_db or
CDTcreate_db.
index_obj is the value returned from
CDTihandle, or if this parameter is not supplied or is
blank, the physical index is used.
Returns: I_OK on success, I_ERROR on error
More functions to be documented here!!
CDTDropFuncs( )
This function is used to terminate Rexx/CDT and free up all resources that have been used.
It should be called at the end of every Rexx/CDT program. In particular, this
function should be called after a syntax error has been caught with SIGNAL ON SYNTAX.
Returns: 0
CDTLoadFuncs( )
This function is used to load all the Rexx/CDT external functions. This
function is called after the function has been loaded with the Rexx builtin
function rxfuncadd().
Although this function is useful only for dynamic library implementations
of Rexx/CDT, it can be called by the executable version of Rexx/CDT. In this
case it does nothing.
Returns: 0
CDTVariable( variable[, newvalue])
Set or get the value for the specified variable.
If newvalue is specified, the setable variable is set to
newvalue.
The following variables are available:
Copyright ©
Mark Hessling 1997-2003
<M.Hessling@qut.edu.au>
Last updated 18 January 2003