/* Generic column types. */
typedef enum DB_Type_enum
{
DB_CHAR, DB_INT1, DB_INT2, DB_INT4, DB_INT8,
DB_FLOAT, DB_DOUBLE,
DB_STRING, DB_VARCHAR
} DB_Type_t;
/* Binary query result column. */
typedef struct DB_Column_struct
{
char *column_name; /* Name of the column. */
DB_Type_t type; /* The data type. */
unsigned int num_rows; /* Number of rows in the column. */
unsigned int size; /* Size of data type. */
char *data; /* Array of type "type" holding the column data.
The total length of *column_data is num_rows*size.
*/
signed short *is_null; /* An array of flags indicating if the field
contained a NULL value. */
} DB_Column_t;
/* Binary query result table. */
typedef struct DB_Binary_Result_struct
{
unsigned int num_rows; /* Number of rows in result. */
unsigned int num_cols; /* Number of columns in result. */
DB_Column_t *column;
} DB_Binary_Result_t;
/* Text query result table. */
typedef struct DB_Text_Result_struct
{
unsigned int num_rows;
unsigned int num_cols;
char **column_name; /* Name of the column. */
int *column_width; /* Max width of the column. */
char *buffer; /* buffers holding the results. On buffer per row. */
char ***field; /* field[i][j] is a string contained in the i'th row
and j'th column of the result. */
} DB_Text_Result_t;