tbllib2
NAME
tbllib2 - tb2 routines for linac database access
DESCRIPTION
tbllib2 library (libtb2.a and tb2.h) contains tb2_xxx() functions
for linac database access. These routines are developed to expand
the functionalities in tbllib library. It contains compatibility
functions tbl_xxx(). See tbllib.man for basic usages.
List of tbllib2 functions.
/* tb2_read.c */
tb2_Spec *tb2_read( char *abbrev );
int tbl_read( char *abbrev );
extern tb2_Spec *default_tbl; /* default table for old functions */
#define tbl_errno tb2_errno
extern int tb2_errno; /* error code */
/* _tb2_num.c */
int _tb2_num( tb2_Spec *tb2, char* name );
int _tbl_num( char *name );
/* tb2_name.c */
char *tb2_name( tb2_Spec *tb2, int serial );
char *tbl_name( int serial );
/* tb2_int.c */
int tb2_int( tb2_Spec *tb2, char *name, char *key, int *data );
int tb2_longint( tb2_Spec *tb2, char *name, char *key, long *data );
int tbl_int( char *name, char *key, int *data );
int tbl_longint( char *name, char *key, long *data );
/* tb2_get.c */
int tb2_doublereal( tb2_Spec *tb2, char* name, char *key, double *data );
int tb2_real( tb2_Spec *tb2, char* name, char *key, float *data );
int tb2_string( tb2_Spec *tb2, char* name, char *key, char **data );
int tbl_doublereal( char* name, char *key, double *data );
int tbl_real( char* name, char *key, float *data );
int tbl_string( char* name, char *key, char **data );
/* tb2_node.c */
char *tb2_node( tb2_Spec *tb2, char *name );
char *tbl_node( char *name );
/* tb2_entry.c */
tb2_ParamEnt *tb2_entry( tb2_Spec *tb2, char *name );
/* tb2_Entry *tb2_entry( tb2_Spec *tb2, char *name ); */
tb2_ParamEnt *tb2_data( tb2_Spec *tb2, char *name, char *key );
tb2_ParamEnt *tb2_sentry( tb2_Spec *tb2, int serial );
int tbl_param( char *name, int *param );
/* tb2_hash.c */
tb2_Hash *tb2_hashcreate( char typek, char typed );
int tb2_enteryhash( tb2_Spec *tb2spec, tb2_Entry *tb2entry );
int tb2_keywordhash( tb2_Spec *tb2spec, struct _tb2_paramkey (*tb2paramkey)[]);
tb2_Entry *tb2_entryfind( tb2_Spec *tb2spec, char *name, int serial,
char type );
int tb2_keywordfind( tb2_Spec *tb2spec, char *keyword );
/* tb2_misc.c */
void *tb2_malloc( size_t size );
char *tb2_strdup( const char *str );
/* tb2_err.c */
void tbl_errend();
int tb2_errmsg( char *str );
Some more details.
/**
* tbl_read.c n.k. june 9, 1992
* tb2_read.c k.f. july 29, 1996
*
* Modifications:
* k.f. sep.25 1996 rewrite whole structure for v2.0
*
* tb2_Spec * tb2_read( char* abbr );
* read specified table file into buffer
* abbr - abbreviated name of the table
* example: "mgv3" seraches for "mgv3tbl.tbl" at default directory
* return: pointer to tb2_Spec structure on success
* 0 -- error (error code in tb2_errno, see tb2.h)
*
* (old interface for compatibility)
* int tbl_read( char* abbr ) - read specified table file into buffer
* abbr - abbreviated name of the table
* example: "mg" seraches for "mgtbl.tbl" at default directory
* return: 0 -- successfully completed
* <0 -- error (see tb2.h)
*
**/
/**
* _tbl_num.c n.k. june 9, 1992
* _tb2_num.c k.f. july 29, 1996
*
* Modifications:
*
* int _tb2_num( tb2_Spec tb2, char* name )
* - get serial number of name in the table
* tb2 - table spec returned from tb2_read()
* name - name to be searched (in the first row, KEY="NAME")
* return: n>=0 -- serial number, successfully completed
* < 0 -- error (see tbl.h)
*
* int _tbl_num( char* name ) - get serial number of name in the table
* name - name to be searched (in the first row, KEY="NAME")
* return: n>=0 -- serial number, successfully completed
* < 0 -- error (see tbl.h)
*
* (cf.) char *tb2_name( tb2_Spec tb2, int n )
* - get name from serial-number
**/
/**
* tbl_name.c n.k. may 28, 1993
* tb2_name.c k.f. july 29, 1996
*
* char *tb2_name( tb2_Spec *tb2, int ser )
* - get name from serial-number
* tb2 - table spec returned from tb2_read()
* ser - serial # for the name
*
* char *tbl_name( int ser )
* - get name from serial-number
* ser - serial # for the name
*
* return: pointer to name (char*) for specified serial number ser
* tb2_errno: n=0 -- successfully completed
* < 0 -- error (see tbl.h)
*
* (cf.) int _tb2_num( tb2_Spec tb2, char* name )
* - get serial number of name in the table
**/
/**
* tbl_int.c n.k. june 9, 1992
* tb2_int.c k.f. july 29, 1996
*
* int tb2_int( tb2_Spec tb2, char* name, char *key, int *data )
* -- get integer parameter (data) for name by specifing keyword
* tb2 - table spec returned from tb2_read()
* name - name to be searched (in the first row, KEY="NAME")
* key - parameter keyword to be searched, defined in the table itself
* data - integer data for specified name and keyword
* return: n=0 -- successfully completed
* < 0 -- error (see tb2.h)
*
* int tb2_longint( tb2_Spec tb2, char* name, char *key, long *data )
* -- get long integer parameter (data) for name by specifing keyword
* tb2 - table spec returned from tb2_read()
* name - name to be searched (in the first row, KEY="NAME")
* key - parameter keyword to be searched, defined in the table itself
* data - long integer data for specified name and keyword
* return: n=0 -- successfully completed
* < 0 -- error (see tb2.h)
*
* int tbl_int( char* name, char *key, int *data ) (old interface)
* -- get integer parameter (data) for name by specifing keyword
*
* int tbl_longint( char* name, char *key, long *data ) (old interface)
* -- get long integer parameter (data) for name by specifing keyword
*
* Modifications:
**/
/**
* tb2_get.c k.f. july 29, 1996
*
* int tb2_doublereal( tb2_Spec *tb2, char* name, char *key, double *data )
* -- get doublereal parameter (data) for name by specifing keyword
* tb2 - table spec returned from tb2_read()
* name - name to be searched (in the first row, KEY="NAME")
* key - parameter keyword to be searched, defined in the table itself
* data - double data for specified name and keyword
* return: n=0 -- successfully completed
* < 0 -- error (see tb2.h)
*
* int tb2_real( tb2_Spec *tb2, char* name, char *key, float *data )
* -- get (single) real parameter (data) for name by specifing keyword
* tb2 - table spec returned from tb2_read()
* name - name to be searched (in the first row, KEY="NAME")
* key - parameter keyword to be searched, defined in the table itself
* data - float data for specified name and keyword
* return: n=0 -- successfully completed
* < 0 -- error (see tb2.h)
*
* int tb2_string( tb2_Spec *tb2, char* name, char *key, char **data )
* -- get string parameter (data) for name by specifing keyword
* tb2 - table spec returned from tb2_read()
* name - name to be searched (in the first row, KEY="NAME")
* key - parameter keyword to be searched, defined in the table itself
* data - string data for specified name and keyword
* return: n=0 -- successfully completed
* < 0 -- error (see tb2.h)
*
* int tbl_doublereal( char* name, char *key, double *data )
* -- get double parameter (data) for name by specifing keyword
*
* int tbl_real( char* name, char *key, float *data )
* -- get float parameter (data) for name by specifing keyword
*
* int tbl_string( char* name, char *key, char **data )
* -- get string parameter (data) for name by specifing keyword
*
* Modifications:
**/
/**
* tbl_node.c n.k. june 9, 1992
* tb2_node.c k.f. july 29, 1996
*
* char *tb2_node( tb2_Spec *tb2, char* name )
* - get pointer of node for specified name
* tb2 - table spec returned from tb2_read()
* name - name to be searched (in the first row, KEY="NAME")
*
* char *tbl_node( char* name )
* - get pointer of node for specified name
* name - name to be searched (in the first row, KEY="NAME")
*
* return: pointer to node (char*) for specified name and keyword
* tb2_errno: n=0 -- successfully completed
* < 0 -- error (see tbl.h)
*
* Modifications:
**/
/**
* tb2_entry.c k.furukawa july 29, 1996
*
* Modifications:
*
* tb2_ParamEnt(*)[] tb2_entry( tb2_Spec *tb2, char *name );
* get a entry (array of parameters) for specified entry name
* tb2 - table spec return by tb2_read
* name - entry name (first parameter)
* return: pointer to tb2_Entry structure on success
* 0 -- error (error code in tb2_errno, see tb2.h)
*
* tb2_ParamEnt * tb2_data( tb2_Spec *tb2, char *name, char *key );
* get a parameter (union) for specified entry name and keyword
* tb2 - table spec return by tb2_read
* name - entry name (first parameter)
* key - keyword
* return: pointer to tb2_ParamEnt union on success
* 0 -- error (error code in tb2_errno, see tb2.h)
*
* tb2_ParamEnt(*)[] tb2_sentry( tb2_Spec *tb2, int serial );
* get a entry (array of parameters) for specified serial number
* tb2 - table spec returned from tb2_read
* name - entry name (first parameter)
* return: pointer to tb2_Entry structure on success
* 0 -- error (error code in tb2_errno, see tb2.h)
*
* int tbl_param( char *name, int *param );
* get parameters assuming all parameters are integers
* emulation of old interface
* name - entry name (first parameter)
* param - parameters to be returned (array of integers)
**/
/**
* tb2_hash.c k.furukawa july 29 1996.
*
* interface between linac table routines and dynamic hash routines
*
* k.furukawa, feb.14.1997. replace dynhash-1.0 with dht-1.2
*
* tb2_Hash * tb2_hashcreate( char typek, char typed );
* create hash table with specified key/data type
*
* int tb2_enteryhash( tb2_Spec *tb2spec, tb2_Entry *tb2entry );
* enter a entry into double hash table
*
* int tb2_keywordhash( tb2_Spec *tb2spec, struct _tb2_paramkey (*tb2key)[]);
* enter a keyword into hash table
*
* tb2_Entry * tb2_entryfind( tb2_Spec *tb2spec, char *name, int serial,
* char type );
* find an entry for specified name/serial (row)
*
* int tb2_keywordfind( tb2_Spec *tb2spec, char *keyword );
* find an index number (start at 0) for the specified keyword (column)
**/
Man(1) output converted with
man2html