~ubuntu-branches/ubuntu/intrepid/psqlodbc/intrepid

« back to all changes in this revision

Viewing changes to columninfo.h

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut
  • Date: 2008-05-09 10:40:32 UTC
  • mfrom: (1.1.5 upstream) (4.1.1 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080509104032-brus47zgn7ak380w
Tags: 1:08.03.0200-1
* New upstream release
  - Disables some broken code (closes: #396218)
  - Obsoletes psqlodbc-413534.diff and most of psqlodbc-358949.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
#define __COLUMNINFO_H__
11
11
 
12
12
#include "psqlodbc.h"
13
 
#include <libpq-fe.h>
14
13
 
15
14
struct ColumnInfoClass_
16
15
{
17
16
        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 */
 
17
        struct srvr_info
 
18
        {
 
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 */
 
26
        }       *coli_array;
23
27
};
24
28
 
25
29
#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])
 
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)
31
37
 
32
38
ColumnInfoClass *CI_Constructor(void);
33
39
void            CI_Destructor(ColumnInfoClass *self);
34
40
void            CI_free_memory(ColumnInfoClass *self);
 
41
char            CI_read_fields(ColumnInfoClass *self, ConnectionClass *conn);
35
42
 
36
43
/* functions for setting up the fields from within the program, */
37
44
/* without reading from a socket */
38
 
void            CI_set_num_fields(ColumnInfoClass *self, int new_num_fields);
 
45
void            CI_set_num_fields(ColumnInfoClass *self, int new_num_fields, BOOL);
39
46
void CI_set_field_info(ColumnInfoClass *self, int field_num, char *new_name,
40
 
                                  Oid new_adtid, Int2 new_adtsize, Int4 atttypmod);
 
47
                OID new_adtid, Int2 new_adtsize, Int4 atttypmod,
 
48
                OID new_relid, OID new_attid);
41
49
 
42
50
#endif