3
* Description: See "columninfo.c"
5
* Comments: See "notice.txt" for copyright and license information.
9
#ifndef __COLUMNINFO_H__
10
#define __COLUMNINFO_H__
14
struct ColumnInfoClass_
17
char **name; /* list of type names */
18
Oid *adtid; /* list of type ids */
19
Int2 *adtsize; /* list type sizes */
20
Int2 *display_size; /* the display size (longest row) */
21
Int4 *atttypmod; /* the length of bpchar/varchar */
24
#define CI_get_num_fields(self) (self->num_fields)
25
#define CI_get_oid(self, col) (self->adtid[col])
26
#define CI_get_fieldname(self, col) (self->name[col])
27
#define CI_get_fieldsize(self, col) (self->adtsize[col])
28
#define CI_get_display_size(self, col) (self->display_size[col])
29
#define CI_get_atttypmod(self, col) (self->atttypmod[col])
31
ColumnInfoClass *CI_Constructor(void);
32
void CI_Destructor(ColumnInfoClass *self);
33
void CI_free_memory(ColumnInfoClass *self);
34
char CI_read_fields(ColumnInfoClass *self, ConnectionClass *conn);
36
/* functions for setting up the fields from within the program, */
37
/* without reading from a socket */
38
void CI_set_num_fields(ColumnInfoClass *self, int new_num_fields);
39
void CI_set_field_info(ColumnInfoClass *self, int field_num, char *new_name,
40
Oid new_adtid, Int2 new_adtsize, Int4 atttypmod);