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