-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplunijava_spi.h
55 lines (42 loc) · 989 Bytes
/
plunijava_spi.h
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
#ifndef PLUNIJAVA_SPI_H
#define PLUNIJAVA_SPI_H
#include "postgres.h"
typedef struct {
double* arr;
int size;
} double_array_data;
typedef struct {
float* arr;
int size;
} float_array_data;
typedef struct {
char* arr;
int size;
} char_array_data;
typedef struct {
int ncols;
int proc;
int pos;
Datum* data;
} row_cache;
typedef struct Vector
{
int32 vl_len_;
int16 dim;
int16 unused;
float x[FLEXIBLE_ARRAY_MEMBER];
} Vector;
extern bool activeSPI;
extern int connect_SPI();
extern void disconnect_SPI();
extern int execute(char* query, bool use_cursor);
extern bool fetch_next();
extern double getdouble(int column);
extern float getfloat(int column);
extern int getint(int column);
extern long getlong(int column);
extern double_array_data* getdoublearray(int column);
extern float_array_data* getvector(int column);
/* ? CHECK IF CAN BE DEPRECATED */
extern double_array_data* fetch_next_double_array(int column);
#endif