File: globals.h

package info (click to toggle)
grass 8.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 277,040 kB
  • sloc: ansic: 460,798; python: 227,732; cpp: 42,026; sh: 11,262; makefile: 7,007; xml: 3,637; sql: 968; lex: 520; javascript: 484; yacc: 450; asm: 387; perl: 157; sed: 25; objc: 6; ruby: 4
file content (58 lines) | stat: -rw-r--r-- 2,157 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <libpq-fe.h>

/* cursors */
typedef struct _cursor {
    PGresult *res;
    int nrows; /* number of rows in query result */
    int row;   /* current row */
    dbToken token;
    int type;  /* type of cursor: SELECT, UPDATE, INSERT */
    int *cols; /* indexes of known (type) columns */
    int ncols; /* number of known columns */
} cursor;

typedef struct {
    char *host, *port, *options, *tty, *dbname, *user, *password, *schema;
} PGCONN;

/* PostgreSQL data types defined in GRASS
   (see also: /usr/include/postgresql/<version>/server/catalog/pg_type.h)
   PostGIS types are encoded as 17xxx.
   Types/OIDs are fetched in db.c from server.
 */
typedef enum {                  /* name in pg_type, aliases */
               PG_TYPE_UNKNOWN, /* all types not supported by GRASS */

               PG_TYPE_BIT,    /* bit */
               PG_TYPE_INT2,   /* int2,   smallint */
               PG_TYPE_INT4,   /* int4,   integer, int */
               PG_TYPE_INT8,   /* int8,   bigint */
               PG_TYPE_SERIAL, /* serial */
               PG_TYPE_OID,    /* oid */

               PG_TYPE_FLOAT4,  /* float4, real */
               PG_TYPE_FLOAT8,  /* float8, double precision */
               PG_TYPE_NUMERIC, /* numeric, decimal */

               PG_TYPE_CHAR,    /* char,   character */
               PG_TYPE_BPCHAR,  /* ??? blank padded character, oid of this type
                                   is returned for char fields */
               PG_TYPE_VARCHAR, /* varchar,        character varying */
               PG_TYPE_TEXT,    /* text */

               PG_TYPE_DATE,      /* date */
               PG_TYPE_TIME,      /* time */
               PG_TYPE_TIMESTAMP, /* timestamp */

               PG_TYPE_BOOL, /* bool, boolean */

               PG_TYPE_POSTGIS_GEOM,    /* geometry column of PostGIS, GRASS
                                           internal type */
               PG_TYPE_POSTGIS_TOPOGEOM /* topogeometry column of PostGIS, GRASS
                                           internal type */
} PG_TYPES;

extern PGconn *pg_conn;
extern dbString *errMsg;
extern int (*pg_types)[2];
extern int pg_ntypes;