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_
19 char *name
; /* field name */
20 OID adtid
; /* type oid */
21 Int2 adtsize
; /* type size */
22 Int4 display_size
; /* the display size (longest row) */
23 Int4 atttypmod
; /* the length of bpchar/varchar */
24 OID relid
; /* the relation id */
25 Int2 attid
; /* the attribute number */
29 #define CI_get_num_fields(self) (self->num_fields)
30 #define CI_get_oid(self, col) (self->coli_array[col].adtid)
31 #define CI_get_fieldname(self, col) (self->coli_array[col].name)
32 #define CI_get_fieldsize(self, col) (self->coli_array[col].adtsize)
33 #define CI_get_display_size(self, col) (self->coli_array[col].display_size)
34 #define CI_get_atttypmod(self, col) (self->coli_array[col].atttypmod)
35 #define CI_get_relid(self, col) (self->coli_array[col].relid)
36 #define CI_get_attid(self, col) (self->coli_array[col].attid)
38 ColumnInfoClass
*CI_Constructor(void);
39 void CI_Destructor(ColumnInfoClass
*self
);
40 void CI_free_memory(ColumnInfoClass
*self
);
41 char CI_read_fields(ColumnInfoClass
*self
, ConnectionClass
*conn
);
43 /* functions for setting up the fields from within the program, */
44 /* without reading from a socket */
45 void CI_set_num_fields(ColumnInfoClass
*self
, int new_num_fields
, BOOL
);
46 void CI_set_field_info(ColumnInfoClass
*self
, int field_num
,
48 OID new_adtid
, Int2 new_adtsize
, Int4 atttypmod
,
49 OID new_relid
, OID new_attid
);