~ubuntu-branches/ubuntu/lucid/psqlodbc/lucid

« back to all changes in this revision

Viewing changes to columninfo.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-05-13 10:47:36 UTC
  • Revision ID: james.westby@ubuntu.com-20040513104736-a530gmn0p3knep89
Tags: upstream-07.03.0200
ImportĀ upstreamĀ versionĀ 07.03.0200

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* File:                        columninfo.h
 
2
 *
 
3
 * Description:         See "columninfo.c"
 
4
 *
 
5
 * Comments:            See "notice.txt" for copyright and license information.
 
6
 *
 
7
 */
 
8
 
 
9
#ifndef __COLUMNINFO_H__
 
10
#define __COLUMNINFO_H__
 
11
 
 
12
#include "psqlodbc.h"
 
13
 
 
14
struct ColumnInfoClass_
 
15
{
 
16
        Int2            num_fields;
 
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 */
 
22
};
 
23
 
 
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])
 
30
 
 
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);
 
35
 
 
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);
 
41
 
 
42
#endif