#include "ltable.h"
FUNCTION put_vector (tab,name,dtype,desc,nrow,ncol,sep)
struct TAB_DEF *tab; char *name; long dtype; char *desc; long nrow; long ncol; char sep;
Pointer to a structure defining the LT file structure. The structure is initialized by the open_tab() utility.
Attribute name for the current element of the vector linked list. It is assigned to the vector field label.
Data type for the current element of the vector linked list. It is assigned to the vector field dtypeare:
= C: Character data = I1: unsigned byte data = I2: signed two byte data = I4: signed four byte data = R4: four byte floating point data = R8: eight byte floating point data
Description for the current element of the vector linked list. It is assigned to the vector field desc.
Number of rows in the matrix for the current element of the vector linked list. It is assigned to the vector field lt_size.nrow. If the data type is character, this value should be set to 1 (one).
Number of columns in the matrix for the current element of the vector linked list. It is assigned to the vector field lt_size.ncol. If the data type is character, this value should be set to the maximum character string length to be written to the LT.
Type of separator to be written to terminate the label vector. If this is to be the last element of the linked list, sep to the constant FIELD_SEP1 or FIELD_SEP2.
The put_vector() routine places an element of the label vector (defined by structure VECTOR) into the LT. The label vector is written as specified by the input parameters. Each time put_vector() is called, it adds an element to the vector linked list. The following fields are assigned to the new vector element:
1. Name of the attribute (label) 2. Data type of the attribute (dtype) 3. Description of the attribute (desc) 4. Number of rows and columns in the matrix (lt_size)If the LT was opened for append and the LT already exists, error checking is done to ensure the label vector of the LT is exactly the same as the label vector to be processed by the program.
In addition, put_vector() allocates dynamic memory to store logical records to be written to the LT; therefore, it is required that an application program to call put_vector() prior to calling put_matrix() and put_record().
put_vector() has no return values.