colgeth - get table or list header information
SYNOPSIS
DESCRIPTION
colgeth
obtains information about the table or list file
which has been previously opened on the channel
pointed to by
row->p_filein.
It uses the librdb.a function
colgetr
to read the first row; if blank,
colgeth
assumes it's a list format file and assigns
row->list to TRUE.
If the first row is not blank,
colgeth
stores the columns from the first
row in the array pointed to by
row->p_heads
and calls
colgetr
to read the second row into
row->p_columns.
RETURN VALUE
colgeth
returns -1 in the following cases:
- the input table or list has zero length.
- the input table has less than two rows.
- the number of columns in the table header rows differ.
- the second table row contains invalid characters.
Otherwise,
colgeth
returns the number of columns found in the header row
(zero for list files).
NOTES
In addition to the global variable
Debug,
programs using
colgeth
must also define the global variable
Program:
char *Program;
row->fs,
which defines the input field separation character
and the input file stream
row->p_filein,
if
not
the standard input,
must be set and/or opened prior to invocation of
colgeth.
SEE ALSO