OSDN Git Service

pgindent run. Make it all clean.
[pg-rex/syncrep.git] / src / interfaces / odbc / columninfo.h
1
2 /* File:                        columninfo.h
3  *
4  * Description:         See "columninfo.c"
5  *
6  * Comments:            See "notice.txt" for copyright and license information.
7  *
8  */
9
10 #ifndef __COLUMNINFO_H__
11 #define __COLUMNINFO_H__
12
13 #include "psqlodbc.h"
14
15 struct ColumnInfoClass_
16 {
17         Int2            num_fields;
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 */
23 };
24
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])
31
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);
36
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);
42
43
44 #endif