Commit 755a8733 authored by Bruce Momjian's avatar Bruce Momjian

Run pgindent over ODBC source. We couldn't do this years ago because we

weren't the master source.  We are now, and it really needs it.
parent 505a828a
This diff is collapsed.
/* File: bind.h /* File: bind.h
* *
* Description: See "bind.c" * Description: See "bind.c"
* *
* Comments: See "notice.txt" for copyright and license information. * Comments: See "notice.txt" for copyright and license information.
* *
*/ */
...@@ -15,33 +15,40 @@ ...@@ -15,33 +15,40 @@
/* /*
* BindInfoClass -- stores information about a bound column * BindInfoClass -- stores information about a bound column
*/ */
struct BindInfoClass_ { struct BindInfoClass_
Int4 buflen; /* size of buffer */ {
Int4 data_left; /* amount of data left to read (SQLGetData) */ Int4 buflen; /* size of buffer */
char *buffer; /* pointer to the buffer */ Int4 data_left; /* amount of data left to read
Int4 *used; /* used space in the buffer (for strings not counting the '\0') */ * (SQLGetData) */
Int2 returntype; /* kind of conversion to be applied when returning (SQL_C_DEFAULT, SQL_C_CHAR...) */ char *buffer; /* pointer to the buffer */
Int4 *used; /* used space in the buffer (for strings
* not counting the '\0') */
Int2 returntype; /* kind of conversion to be applied when
* returning (SQL_C_DEFAULT,
* SQL_C_CHAR...) */
}; };
/* /*
* ParameterInfoClass -- stores information about a bound parameter * ParameterInfoClass -- stores information about a bound parameter
*/ */
struct ParameterInfoClass_ { struct ParameterInfoClass_
Int4 buflen; {
char *buffer; Int4 buflen;
Int4 *used; char *buffer;
Int2 paramType; Int4 *used;
Int2 CType; Int2 paramType;
Int2 SQLType; Int2 CType;
UInt4 precision; Int2 SQLType;
Int2 scale; UInt4 precision;
Oid lobj_oid; Int2 scale;
Int4 *EXEC_used; /* amount of data OR the oid of the large object */ Oid lobj_oid;
char *EXEC_buffer; /* the data or the FD of the large object */ Int4 *EXEC_used; /* amount of data OR the oid of the large
char data_at_exec; * object */
char *EXEC_buffer; /* the data or the FD of the large object */
char data_at_exec;
}; };
BindInfoClass *create_empty_bindings(int num_columns); BindInfoClass *create_empty_bindings(int num_columns);
void extend_bindings(StatementClass *stmt, int num_columns); void extend_bindings(StatementClass * stmt, int num_columns);
#endif #endif
/* Module: columninfo.c /* Module: columninfo.c
* *
* Description: This module contains routines related to * Description: This module contains routines related to
* reading and storing the field information from a query. * reading and storing the field information from a query.
* *
* Classes: ColumnInfoClass (Functions prefix: "CI_") * Classes: ColumnInfoClass (Functions prefix: "CI_")
* *
* API functions: none * API functions: none
* *
* Comments: See "notice.txt" for copyright and license information. * Comments: See "notice.txt" for copyright and license information.
* *
*/ */
...@@ -20,11 +20,12 @@ ...@@ -20,11 +20,12 @@
ColumnInfoClass * ColumnInfoClass *
CI_Constructor() CI_Constructor()
{ {
ColumnInfoClass *rv; ColumnInfoClass *rv;
rv = (ColumnInfoClass *) malloc(sizeof(ColumnInfoClass)); rv = (ColumnInfoClass *) malloc(sizeof(ColumnInfoClass));
if (rv) { if (rv)
{
rv->num_fields = 0; rv->num_fields = 0;
rv->name = NULL; rv->name = NULL;
rv->adtid = NULL; rv->adtid = NULL;
...@@ -37,28 +38,28 @@ ColumnInfoClass *rv; ...@@ -37,28 +38,28 @@ ColumnInfoClass *rv;
} }
void void
CI_Destructor(ColumnInfoClass *self) CI_Destructor(ColumnInfoClass * self)
{ {
CI_free_memory(self); CI_free_memory(self);
free(self); free(self);
} }
/* Read in field descriptions. /* Read in field descriptions.
If self is not null, then also store the information. If self is not null, then also store the information.
If self is null, then just read, don't store. If self is null, then just read, don't store.
*/ */
char char
CI_read_fields(ColumnInfoClass *self, ConnectionClass *conn) CI_read_fields(ColumnInfoClass * self, ConnectionClass * conn)
{ {
Int2 lf; Int2 lf;
int new_num_fields; int new_num_fields;
Oid new_adtid; Oid new_adtid;
Int2 new_adtsize; Int2 new_adtsize;
Int4 new_atttypmod = -1; Int4 new_atttypmod = -1;
char new_field_name[MAX_MESSAGE_LEN+1]; char new_field_name[MAX_MESSAGE_LEN + 1];
SocketClass *sock; SocketClass *sock;
ConnInfo *ci; ConnInfo *ci;
sock = CC_get_socket(conn); sock = CC_get_socket(conn);
ci = &conn->connInfo; ci = &conn->connInfo;
...@@ -68,24 +69,27 @@ ConnInfo *ci; ...@@ -68,24 +69,27 @@ ConnInfo *ci;
mylog("num_fields = %d\n", new_num_fields); mylog("num_fields = %d\n", new_num_fields);
if (self) { /* according to that allocate memory */ if (self)
{ /* according to that allocate memory */
CI_set_num_fields(self, new_num_fields); CI_set_num_fields(self, new_num_fields);
} }
/* now read in the descriptions */ /* now read in the descriptions */
for(lf = 0; lf < new_num_fields; lf++) { for (lf = 0; lf < new_num_fields; lf++)
{
SOCK_get_string(sock, new_field_name, MAX_MESSAGE_LEN); SOCK_get_string(sock, new_field_name, MAX_MESSAGE_LEN);
new_adtid = (Oid) SOCK_get_int(sock, 4); new_adtid = (Oid) SOCK_get_int(sock, 4);
new_adtsize = (Int2) SOCK_get_int(sock, 2); new_adtsize = (Int2) SOCK_get_int(sock, 2);
/* If 6.4 protocol, then read the atttypmod field */ /* If 6.4 protocol, then read the atttypmod field */
if (PG_VERSION_GE(conn, 6.4)) { if (PG_VERSION_GE(conn, 6.4))
{
mylog("READING ATTTYPMOD\n"); mylog("READING ATTTYPMOD\n");
new_atttypmod = (Int4) SOCK_get_int(sock, 4); new_atttypmod = (Int4) SOCK_get_int(sock, 4);
/* Subtract the header length */ /* Subtract the header length */
new_atttypmod -= 4; new_atttypmod -= 4;
if (new_atttypmod < 0) if (new_atttypmod < 0)
new_atttypmod = -1; new_atttypmod = -1;
...@@ -104,17 +108,18 @@ ConnInfo *ci; ...@@ -104,17 +108,18 @@ ConnInfo *ci;
void void
CI_free_memory(ColumnInfoClass *self) CI_free_memory(ColumnInfoClass * self)
{ {
register Int2 lf; register Int2 lf;
int num_fields = self->num_fields; int num_fields = self->num_fields;
for (lf = 0; lf < num_fields; lf++) { for (lf = 0; lf < num_fields; lf++)
if( self->name[lf]) {
free (self->name[lf]); if (self->name[lf])
free(self->name[lf]);
} }
/* Safe to call even if null */ /* Safe to call even if null */
free(self->name); free(self->name);
free(self->adtid); free(self->adtid);
free(self->adtsize); free(self->adtsize);
...@@ -124,35 +129,33 @@ int num_fields = self->num_fields; ...@@ -124,35 +129,33 @@ int num_fields = self->num_fields;
} }
void void
CI_set_num_fields(ColumnInfoClass *self, int new_num_fields) CI_set_num_fields(ColumnInfoClass * self, int new_num_fields)
{ {
CI_free_memory(self); /* always safe to call */ CI_free_memory(self); /* always safe to call */
self->num_fields = new_num_fields; self->num_fields = new_num_fields;
self->name = (char **) malloc (sizeof(char *) * self->num_fields); self->name = (char **) malloc(sizeof(char *) * self->num_fields);
self->adtid = (Oid *) malloc (sizeof(Oid) * self->num_fields); self->adtid = (Oid *) malloc(sizeof(Oid) * self->num_fields);
self->adtsize = (Int2 *) malloc (sizeof(Int2) * self->num_fields); self->adtsize = (Int2 *) malloc(sizeof(Int2) * self->num_fields);
self->display_size = (Int2 *) malloc(sizeof(Int2) * self->num_fields); self->display_size = (Int2 *) malloc(sizeof(Int2) * self->num_fields);
self->atttypmod = (Int4 *) malloc(sizeof(Int4) * self->num_fields); self->atttypmod = (Int4 *) malloc(sizeof(Int4) * self->num_fields);
} }
void void
CI_set_field_info(ColumnInfoClass *self, int field_num, char *new_name, CI_set_field_info(ColumnInfoClass * self, int field_num, char *new_name,
Oid new_adtid, Int2 new_adtsize, Int4 new_atttypmod) Oid new_adtid, Int2 new_adtsize, Int4 new_atttypmod)
{ {
/* check bounds */ /* check bounds */
if((field_num < 0) || (field_num >= self->num_fields)) { if ((field_num < 0) || (field_num >= self->num_fields))
return; return;
}
/* store the info */ /* store the info */
self->name[field_num] = strdup(new_name); self->name[field_num] = strdup(new_name);
self->adtid[field_num] = new_adtid; self->adtid[field_num] = new_adtid;
self->adtsize[field_num] = new_adtsize; self->adtsize[field_num] = new_adtsize;
self->atttypmod[field_num] = new_atttypmod; self->atttypmod[field_num] = new_atttypmod;
self->display_size[field_num] = 0; self->display_size[field_num] = 0;
} }
/* File: columninfo.h /* File: columninfo.h
* *
* Description: See "columninfo.c" * Description: See "columninfo.c"
* *
* Comments: See "notice.txt" for copyright and license information. * Comments: See "notice.txt" for copyright and license information.
* *
*/ */
...@@ -12,13 +12,14 @@ ...@@ -12,13 +12,14 @@
#include "psqlodbc.h" #include "psqlodbc.h"
struct ColumnInfoClass_ { struct ColumnInfoClass_
Int2 num_fields; {
char **name; /* list of type names */ Int2 num_fields;
Oid *adtid; /* list of type ids */ char **name; /* list of type names */
Int2 *adtsize; /* list type sizes */ Oid *adtid; /* list of type ids */
Int2 *display_size; /* the display size (longest row) */ Int2 *adtsize; /* list type sizes */
Int4 *atttypmod; /* the length of bpchar/varchar */ Int2 *display_size; /* the display size (longest row) */
Int4 *atttypmod; /* the length of bpchar/varchar */
}; };
#define CI_get_num_fields(self) (self->num_fields) #define CI_get_num_fields(self) (self->num_fields)
...@@ -29,15 +30,15 @@ struct ColumnInfoClass_ { ...@@ -29,15 +30,15 @@ struct ColumnInfoClass_ {
#define CI_get_atttypmod(self, col) (self->atttypmod[col]) #define CI_get_atttypmod(self, col) (self->atttypmod[col])
ColumnInfoClass *CI_Constructor(void); ColumnInfoClass *CI_Constructor(void);
void CI_Destructor(ColumnInfoClass *self); void CI_Destructor(ColumnInfoClass * self);
void CI_free_memory(ColumnInfoClass *self); void CI_free_memory(ColumnInfoClass * self);
char CI_read_fields(ColumnInfoClass *self, ConnectionClass *conn); char CI_read_fields(ColumnInfoClass * self, ConnectionClass * conn);
/* functions for setting up the fields from within the program, */ /* functions for setting up the fields from within the program, */
/* without reading from a socket */ /* without reading from a socket */
void CI_set_num_fields(ColumnInfoClass *self, int new_num_fields); void CI_set_num_fields(ColumnInfoClass * self, int new_num_fields);
void CI_set_field_info(ColumnInfoClass *self, int field_num, char *new_name, void CI_set_field_info(ColumnInfoClass * self, int field_num, char *new_name,
Oid new_adtid, Int2 new_adtsize, Int4 atttypmod); Oid new_adtid, Int2 new_adtsize, Int4 atttypmod);
#endif #endif
This diff is collapsed.
/* File: connection.h /* File: connection.h
* *
* Description: See "connection.c" * Description: See "connection.c"
* *
* Comments: See "notice.txt" for copyright and license information. * Comments: See "notice.txt" for copyright and license information.
* *
*/ */
...@@ -27,12 +27,15 @@ ...@@ -27,12 +27,15 @@
#endif #endif
typedef enum { typedef enum
CONN_NOT_CONNECTED, /* Connection has not been established */ {
CONN_CONNECTED, /* Connection is up and has been established */ CONN_NOT_CONNECTED, /* Connection has not been established */
CONN_DOWN, /* Connection is broken */ CONN_CONNECTED, /* Connection is up and has been
CONN_EXECUTING /* the connection is currently executing a statement */ * established */
} CONN_Status; CONN_DOWN, /* Connection is broken */
CONN_EXECUTING /* the connection is currently executing a
* statement */
} CONN_Status;
/* These errors have general sql error state */ /* These errors have general sql error state */
#define CONNECTION_SERVER_NOT_REACHED 101 #define CONNECTION_SERVER_NOT_REACHED 101
...@@ -50,7 +53,7 @@ typedef enum { ...@@ -50,7 +53,7 @@ typedef enum {
#define CONN_INIREAD_ERROR 201 #define CONN_INIREAD_ERROR 201
#define CONN_OPENDB_ERROR 202 #define CONN_OPENDB_ERROR 202
#define CONN_STMT_ALLOC_ERROR 203 #define CONN_STMT_ALLOC_ERROR 203
#define CONN_IN_USE 204 #define CONN_IN_USE 204
#define CONN_UNSUPPORTED_OPTION 205 #define CONN_UNSUPPORTED_OPTION 205
/* Used by SetConnectoption to indicate unsupported options */ /* Used by SetConnectoption to indicate unsupported options */
#define CONN_INVALID_ARGUMENT_NO 206 #define CONN_INVALID_ARGUMENT_NO 206
...@@ -110,38 +113,39 @@ typedef unsigned int ProtocolVersion; ...@@ -110,38 +113,39 @@ typedef unsigned int ProtocolVersion;
/* This startup packet is to support latest Postgres protocol */ /* This startup packet is to support latest Postgres protocol */
typedef struct _StartupPacket typedef struct _StartupPacket
{ {
ProtocolVersion protoVersion; ProtocolVersion protoVersion;
char database[SM_DATABASE]; char database[SM_DATABASE];
char user[SM_USER]; char user[SM_USER];
char options[SM_OPTIONS]; char options[SM_OPTIONS];
char unused[SM_UNUSED]; char unused[SM_UNUSED];
char tty[SM_TTY]; char tty[SM_TTY];
} StartupPacket; } StartupPacket;
/* Structure to hold all the connection attributes for a specific /* Structure to hold all the connection attributes for a specific
connection (used for both registry and file, DSN and DRIVER) connection (used for both registry and file, DSN and DRIVER)
*/ */
typedef struct { typedef struct
char dsn[MEDIUM_REGISTRY_LEN]; {
char desc[MEDIUM_REGISTRY_LEN]; char dsn[MEDIUM_REGISTRY_LEN];
char driver[MEDIUM_REGISTRY_LEN]; char desc[MEDIUM_REGISTRY_LEN];
char server[MEDIUM_REGISTRY_LEN]; char driver[MEDIUM_REGISTRY_LEN];
char database[MEDIUM_REGISTRY_LEN]; char server[MEDIUM_REGISTRY_LEN];
char username[MEDIUM_REGISTRY_LEN]; char database[MEDIUM_REGISTRY_LEN];
char password[MEDIUM_REGISTRY_LEN]; char username[MEDIUM_REGISTRY_LEN];
char conn_settings[LARGE_REGISTRY_LEN]; char password[MEDIUM_REGISTRY_LEN];
char protocol[SMALL_REGISTRY_LEN]; char conn_settings[LARGE_REGISTRY_LEN];
char port[SMALL_REGISTRY_LEN]; char protocol[SMALL_REGISTRY_LEN];
char onlyread[SMALL_REGISTRY_LEN]; char port[SMALL_REGISTRY_LEN];
char fake_oid_index[SMALL_REGISTRY_LEN]; char onlyread[SMALL_REGISTRY_LEN];
char show_oid_column[SMALL_REGISTRY_LEN]; char fake_oid_index[SMALL_REGISTRY_LEN];
char row_versioning[SMALL_REGISTRY_LEN]; char show_oid_column[SMALL_REGISTRY_LEN];
char show_system_tables[SMALL_REGISTRY_LEN]; char row_versioning[SMALL_REGISTRY_LEN];
char translation_dll[MEDIUM_REGISTRY_LEN]; char show_system_tables[SMALL_REGISTRY_LEN];
char translation_option[SMALL_REGISTRY_LEN]; char translation_dll[MEDIUM_REGISTRY_LEN];
char focus_password; char translation_option[SMALL_REGISTRY_LEN];
} ConnInfo; char focus_password;
} ConnInfo;
/* /*
* Macros to compare the server's version with a specified version * Macros to compare the server's version with a specified version
...@@ -160,15 +164,15 @@ typedef struct { ...@@ -160,15 +164,15 @@ typedef struct {
#define SERVER_VERSION_LE(conn, major, minor) (! SERVER_VERSION_GT(conn, major, minor)) #define SERVER_VERSION_LE(conn, major, minor) (! SERVER_VERSION_GT(conn, major, minor))
#define SERVER_VERSION_LT(conn, major, minor) (! SERVER_VERSION_GE(conn, major, minor)) #define SERVER_VERSION_LT(conn, major, minor) (! SERVER_VERSION_GE(conn, major, minor))
/*#if ! defined(HAVE_CONFIG_H) || defined(HAVE_STRINGIZE)*/ /*#if ! defined(HAVE_CONFIG_H) || defined(HAVE_STRINGIZE)*/
#define STRING_AFTER_DOT(string) (strchr(#string, '.') + 1) #define STRING_AFTER_DOT(string) (strchr(#string, '.') + 1)
/*#else /*#else
#define STRING_AFTER_DOT(str) (strchr("str", '.') + 1) #define STRING_AFTER_DOT(str) (strchr("str", '.') + 1)
#endif*/ #endif*/
/* /*
* Simplified macros to compare the server's version with a * Simplified macros to compare the server's version with a
* specified version * specified version
* Note: Never pass a variable as the second parameter. * Note: Never pass a variable as the second parameter.
* It must be a decimal constant of the form %d.%d . * It must be a decimal constant of the form %d.%d .
*/ */
#define PG_VERSION_GT(conn, ver) \ #define PG_VERSION_GT(conn, ver) \
(SERVER_VERSION_GT(conn, (int) ver, atoi(STRING_AFTER_DOT(ver)))) (SERVER_VERSION_GT(conn, (int) ver, atoi(STRING_AFTER_DOT(ver))))
...@@ -180,9 +184,10 @@ typedef struct { ...@@ -180,9 +184,10 @@ typedef struct {
#define PG_VERSION_LT(conn, ver) (! PG_VERSION_GE(conn, ver)) #define PG_VERSION_LT(conn, ver) (! PG_VERSION_GE(conn, ver))
/* This is used to store cached table information in the connection */ /* This is used to store cached table information in the connection */
struct col_info { struct col_info
QResultClass *result; {
char name[MAX_TABLE_LEN+1]; QResultClass *result;
char name[MAX_TABLE_LEN + 1];
}; };
/* Translation DLL entry points */ /* Translation DLL entry points */
...@@ -194,52 +199,58 @@ struct col_info { ...@@ -194,52 +199,58 @@ struct col_info {
#define HINSTANCE void * #define HINSTANCE void *
#endif #endif
typedef BOOL (FAR WINAPI *DataSourceToDriverProc) (UDWORD, typedef BOOL(FAR WINAPI * DataSourceToDriverProc) (UDWORD,
SWORD, SWORD,
PTR, PTR,
SDWORD, SDWORD,
PTR, PTR,
SDWORD, SDWORD,
SDWORD FAR *, SDWORD FAR *,
UCHAR FAR *, UCHAR FAR *,
SWORD, SWORD,
SWORD FAR *); SWORD FAR *);
typedef BOOL (FAR WINAPI *DriverToDataSourceProc) (UDWORD, typedef BOOL(FAR WINAPI * DriverToDataSourceProc) (UDWORD,
SWORD, SWORD,
PTR, PTR,
SDWORD, SDWORD,
PTR, PTR,
SDWORD, SDWORD,
SDWORD FAR *, SDWORD FAR *,
UCHAR FAR *, UCHAR FAR *,
SWORD, SWORD,
SWORD FAR *); SWORD FAR *);
/******* The Connection handle ************/ /******* The Connection handle ************/
struct ConnectionClass_ { struct ConnectionClass_
HENV henv; /* environment this connection was created on */ {
HENV henv; /* environment this connection was created
* on */
StatementOptions stmtOptions; StatementOptions stmtOptions;
char *errormsg; char *errormsg;
int errornumber; int errornumber;
CONN_Status status; CONN_Status status;
ConnInfo connInfo; ConnInfo connInfo;
StatementClass **stmts; StatementClass **stmts;
int num_stmts; int num_stmts;
SocketClass *sock; SocketClass *sock;
int lobj_type; int lobj_type;
int ntables; int ntables;
COL_INFO **col_info; COL_INFO **col_info;
long translation_option; long translation_option;
HINSTANCE translation_handle; HINSTANCE translation_handle;
DataSourceToDriverProc DataSourceToDriver; DataSourceToDriverProc DataSourceToDriver;
DriverToDataSourceProc DriverToDataSource; DriverToDataSourceProc DriverToDataSource;
char transact_status; /* Is a transaction is currently in progress */ char transact_status;/* Is a transaction is currently in
char errormsg_created; /* has an informative error msg been created? */ * progress */
char pg_version[MAX_INFO_STRING]; /* Version of PostgreSQL we're connected to - DJP 25-1-2001 */ char errormsg_created; /* has an informative error msg
float pg_version_number; * been created? */
Int2 pg_version_major; char pg_version[MAX_INFO_STRING]; /* Version of PostgreSQL
Int2 pg_version_minor; * we're connected to -
* DJP 25-1-2001 */
float pg_version_number;
Int2 pg_version_major;
Int2 pg_version_minor;
}; };
...@@ -252,31 +263,31 @@ struct ConnectionClass_ { ...@@ -252,31 +263,31 @@ struct ConnectionClass_ {
#define CC_is_onlyread(x) (x->connInfo.onlyread[0] == '1') #define CC_is_onlyread(x) (x->connInfo.onlyread[0] == '1')
/* for CC_DSN_info */ /* for CC_DSN_info */
#define CONN_DONT_OVERWRITE 0 #define CONN_DONT_OVERWRITE 0
#define CONN_OVERWRITE 1 #define CONN_OVERWRITE 1
/* prototypes */ /* prototypes */
ConnectionClass *CC_Constructor(void); ConnectionClass *CC_Constructor(void);
char CC_Destructor(ConnectionClass *self); char CC_Destructor(ConnectionClass * self);
int CC_cursor_count(ConnectionClass *self); int CC_cursor_count(ConnectionClass * self);
char CC_cleanup(ConnectionClass *self); char CC_cleanup(ConnectionClass * self);
char CC_abort(ConnectionClass *self); char CC_abort(ConnectionClass * self);
int CC_set_translation (ConnectionClass *self); int CC_set_translation(ConnectionClass * self);
char CC_connect(ConnectionClass *self, char do_password); char CC_connect(ConnectionClass * self, char do_password);
char CC_add_statement(ConnectionClass *self, StatementClass *stmt); char CC_add_statement(ConnectionClass * self, StatementClass * stmt);
char CC_remove_statement(ConnectionClass *self, StatementClass *stmt); char CC_remove_statement(ConnectionClass * self, StatementClass * stmt);
char CC_get_error(ConnectionClass *self, int *number, char **message); char CC_get_error(ConnectionClass * self, int *number, char **message);
QResultClass *CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi); QResultClass *CC_send_query(ConnectionClass * self, char *query, QueryInfo * qi);
void CC_clear_error(ConnectionClass *self); void CC_clear_error(ConnectionClass * self);
char *CC_create_errormsg(ConnectionClass *self); char *CC_create_errormsg(ConnectionClass * self);
int CC_send_function(ConnectionClass *conn, int fnid, void *result_buf, int *actual_result_len, int result_is_int, LO_ARG *argv, int nargs); int CC_send_function(ConnectionClass * conn, int fnid, void *result_buf, int *actual_result_len, int result_is_int, LO_ARG * argv, int nargs);
char CC_send_settings(ConnectionClass *self); char CC_send_settings(ConnectionClass * self);
void CC_lookup_lo(ConnectionClass *conn); void CC_lookup_lo(ConnectionClass * conn);
void CC_lookup_pg_version(ConnectionClass *conn); void CC_lookup_pg_version(ConnectionClass * conn);
void CC_initialize_pg_version(ConnectionClass *conn); void CC_initialize_pg_version(ConnectionClass * conn);
void CC_log_error(char *func, char *desc, ConnectionClass *self); void CC_log_error(char *func, char *desc, ConnectionClass * self);
#endif #endif
This diff is collapsed.
/* File: convert.h /* File: convert.h
* *
* Description: See "convert.c" * Description: See "convert.c"
* *
* Comments: See "notice.txt" for copyright and license information. * Comments: See "notice.txt" for copyright and license information.
* *
*/ */
...@@ -13,39 +13,40 @@ ...@@ -13,39 +13,40 @@
#include "psqlodbc.h" #include "psqlodbc.h"
/* copy_and_convert results */ /* copy_and_convert results */
#define COPY_OK 0 #define COPY_OK 0
#define COPY_UNSUPPORTED_TYPE 1 #define COPY_UNSUPPORTED_TYPE 1
#define COPY_UNSUPPORTED_CONVERSION 2 #define COPY_UNSUPPORTED_CONVERSION 2
#define COPY_RESULT_TRUNCATED 3 #define COPY_RESULT_TRUNCATED 3
#define COPY_GENERAL_ERROR 4 #define COPY_GENERAL_ERROR 4
#define COPY_NO_DATA_FOUND 5 #define COPY_NO_DATA_FOUND 5
typedef struct { typedef struct
int m; {
int d; int m;
int y; int d;
int hh; int y;
int mm; int hh;
int ss; int mm;
} SIMPLE_TIME; int ss;
} SIMPLE_TIME;
int copy_and_convert_field_bindinfo(StatementClass *stmt, Int4 field_type, void *value, int col);
int copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 fCType, int copy_and_convert_field_bindinfo(StatementClass * stmt, Int4 field_type, void *value, int col);
PTR rgbValue, SDWORD cbValueMax, SDWORD *pcbValue); int copy_and_convert_field(StatementClass * stmt, Int4 field_type, void *value, Int2 fCType,
PTR rgbValue, SDWORD cbValueMax, SDWORD * pcbValue);
int copy_statement_with_parameters(StatementClass *stmt);
char *convert_escape(char *value); int copy_statement_with_parameters(StatementClass * stmt);
char *convert_money(char *s); char *convert_escape(char *value);
char parse_datetime(char *buf, SIMPLE_TIME *st); char *convert_money(char *s);
int convert_linefeeds(char *s, char *dst, size_t max); char parse_datetime(char *buf, SIMPLE_TIME * st);
char *convert_special_chars(char *si, char *dst, int used); int convert_linefeeds(char *s, char *dst, size_t max);
char *convert_special_chars(char *si, char *dst, int used);
int convert_pgbinary_to_char(char *value, char *rgbValue, int cbValueMax);
int convert_from_pgbinary(unsigned char *value, unsigned char *rgbValue, int cbValueMax); int convert_pgbinary_to_char(char *value, char *rgbValue, int cbValueMax);
int convert_to_pgbinary(unsigned char *in, char *out, int len); int convert_from_pgbinary(unsigned char *value, unsigned char *rgbValue, int cbValueMax);
void encode(char *in, char *out); int convert_to_pgbinary(unsigned char *in, char *out, int len);
void decode(char *in, char *out); void encode(char *in, char *out);
int convert_lo(StatementClass *stmt, void *value, Int2 fCType, PTR rgbValue, void decode(char *in, char *out);
SDWORD cbValueMax, SDWORD *pcbValue); int convert_lo(StatementClass * stmt, void *value, Int2 fCType, PTR rgbValue,
SDWORD cbValueMax, SDWORD * pcbValue);
#endif #endif
This diff is collapsed.
/* File: dlg_specific.h /* File: dlg_specific.h
* *
* Description: See "dlg_specific.c" * Description: See "dlg_specific.c"
* *
* Comments: See "notice.txt" for copyright and license information. * Comments: See "notice.txt" for copyright and license information.
* *
*/ */
...@@ -31,41 +31,49 @@ ...@@ -31,41 +31,49 @@
/* INI File Stuff */ /* INI File Stuff */
#ifndef WIN32 #ifndef WIN32
# define ODBC_INI ".odbc.ini" #define ODBC_INI ".odbc.ini"
# ifdef ODBCINSTDIR #ifdef ODBCINSTDIR
# define ODBCINST_INI ODBCINSTDIR "/odbcinst.ini" #define ODBCINST_INI ODBCINSTDIR "/odbcinst.ini"
# else #else
# define ODBCINST_INI "/etc/odbcinst.ini" #define ODBCINST_INI "/etc/odbcinst.ini"
# warning "location of odbcinst.ini file defaulted to /etc" #warning "location of odbcinst.ini file defaulted to /etc"
# endif #endif
#else /* WIN32 */ #else /* WIN32 */
# define ODBC_INI "ODBC.INI" /* ODBC initialization file */ #define ODBC_INI "ODBC.INI" /* ODBC initialization file */
# define ODBCINST_INI "ODBCINST.INI" /* ODBC Installation file */ #define ODBCINST_INI "ODBCINST.INI" /* ODBC Installation file */
#endif /* WIN32 */ #endif /* WIN32 */
#define INI_DSN DBMS_NAME /* Name of default Datasource in ini file (not used?) */ #define INI_DSN DBMS_NAME /* Name of default Datasource in
#define INI_KDESC "Description" /* Data source description */ * ini file (not used?) */
#define INI_SERVER "Servername" /* Name of Server running the Postgres service */ #define INI_KDESC "Description" /* Data source description */
#define INI_PORT "Port" /* Port on which the Postmaster is listening */ #define INI_SERVER "Servername" /* Name of Server running the
#define INI_DATABASE "Database" /* Database Name */ * Postgres service */
#define INI_USER "Username" /* Default User Name */ #define INI_PORT "Port"/* Port on which the Postmaster is
#define INI_PASSWORD "Password" /* Default Password */ * listening */
#define INI_DEBUG "Debug" /* Debug flag */ #define INI_DATABASE "Database" /* Database Name */
#define INI_FETCH "Fetch" /* Fetch Max Count */ #define INI_USER "Username" /* Default User Name */
#define INI_SOCKET "Socket" /* Socket buffer size */ #define INI_PASSWORD "Password" /* Default Password */
#define INI_READONLY "ReadOnly" /* Database is read only */ #define INI_DEBUG "Debug" /* Debug flag */
#define INI_COMMLOG "CommLog" /* Communication to backend logging */ #define INI_FETCH "Fetch" /* Fetch Max Count */
#define INI_PROTOCOL "Protocol" /* What protocol (6.2) */ #define INI_SOCKET "Socket" /* Socket buffer size */
#define INI_OPTIMIZER "Optimizer" /* Use backend genetic optimizer */ #define INI_READONLY "ReadOnly" /* Database is read only */
#define INI_KSQO "Ksqo" /* Keyset query optimization */ #define INI_COMMLOG "CommLog" /* Communication to backend
#define INI_CONNSETTINGS "ConnSettings" /* Anything to send to backend on successful connection */ * logging */
#define INI_UNIQUEINDEX "UniqueIndex" /* Recognize unique indexes */ #define INI_PROTOCOL "Protocol" /* What protocol (6.2) */
#define INI_UNKNOWNSIZES "UnknownSizes" /* How to handle unknown result set sizes */ #define INI_OPTIMIZER "Optimizer" /* Use backend genetic optimizer */
#define INI_KSQO "Ksqo"/* Keyset query optimization */
#define INI_CONNSETTINGS "ConnSettings" /* Anything to send to
* backend on successful
* connection */
#define INI_UNIQUEINDEX "UniqueIndex" /* Recognize unique indexes */
#define INI_UNKNOWNSIZES "UnknownSizes" /* How to handle unknown
* result set sizes */
#define INI_CANCELASFREESTMT "CancelAsFreeStmt" #define INI_CANCELASFREESTMT "CancelAsFreeStmt"
#define INI_USEDECLAREFETCH "UseDeclareFetch" /* Use Declare/Fetch cursors */ #define INI_USEDECLAREFETCH "UseDeclareFetch" /* Use Declare/Fetch
* cursors */
/* More ini stuff */ /* More ini stuff */
#define INI_TEXTASLONGVARCHAR "TextAsLongVarchar" #define INI_TEXTASLONGVARCHAR "TextAsLongVarchar"
...@@ -82,15 +90,16 @@ ...@@ -82,15 +90,16 @@
#define INI_PARSE "Parse" #define INI_PARSE "Parse"
#define INI_EXTRASYSTABLEPREFIXES "ExtraSysTablePrefixes" #define INI_EXTRASYSTABLEPREFIXES "ExtraSysTablePrefixes"
#define INI_TRANSLATIONNAME "TranslationName" #define INI_TRANSLATIONNAME "TranslationName"
#define INI_TRANSLATIONDLL "TranslationDLL" #define INI_TRANSLATIONDLL "TranslationDLL"
#define INI_TRANSLATIONOPTION "TranslationOption" #define INI_TRANSLATIONOPTION "TranslationOption"
/* Connection Defaults */ /* Connection Defaults */
#define DEFAULT_PORT "5432" #define DEFAULT_PORT "5432"
#define DEFAULT_READONLY 1 #define DEFAULT_READONLY 1
#define DEFAULT_PROTOCOL "6.4" /* the latest protocol is the default */ #define DEFAULT_PROTOCOL "6.4" /* the latest protocol is
* the default */
#define DEFAULT_USEDECLAREFETCH 0 #define DEFAULT_USEDECLAREFETCH 0
#define DEFAULT_TEXTASLONGVARCHAR 1 #define DEFAULT_TEXTASLONGVARCHAR 1
#define DEFAULT_UNKNOWNSASLONGVARCHAR 0 #define DEFAULT_UNKNOWNSASLONGVARCHAR 0
...@@ -114,29 +123,30 @@ ...@@ -114,29 +123,30 @@
#define DEFAULT_EXTRASYSTABLEPREFIXES "dd_;" #define DEFAULT_EXTRASYSTABLEPREFIXES "dd_;"
/* prototypes */ /* prototypes */
void getGlobalDefaults(char *section, char *filename, char override); void getGlobalDefaults(char *section, char *filename, char override);
#ifdef WIN32 #ifdef WIN32
void SetDlgStuff(HWND hdlg, ConnInfo *ci); void SetDlgStuff(HWND hdlg, ConnInfo * ci);
void GetDlgStuff(HWND hdlg, ConnInfo *ci); void GetDlgStuff(HWND hdlg, ConnInfo * ci);
int CALLBACK driver_optionsProc(HWND hdlg, int CALLBACK driver_optionsProc(HWND hdlg,
WORD wMsg, WORD wMsg,
WPARAM wParam, WPARAM wParam,
LPARAM lParam); LPARAM lParam);
int CALLBACK ds_optionsProc(HWND hdlg, int CALLBACK ds_optionsProc(HWND hdlg,
WORD wMsg, WORD wMsg,
WPARAM wParam, WPARAM wParam,
LPARAM lParam); LPARAM lParam);
#endif /* WIN32 */
#endif /* WIN32 */
void updateGlobals(void);
void writeDSNinfo(ConnInfo *ci); void updateGlobals(void);
void getDSNdefaults(ConnInfo *ci); void writeDSNinfo(ConnInfo * ci);
void getDSNinfo(ConnInfo *ci, char overwrite); void getDSNdefaults(ConnInfo * ci);
void makeConnectString(char *connect_string, ConnInfo *ci); void getDSNinfo(ConnInfo * ci, char overwrite);
void copyAttributes(ConnInfo *ci, char *attribute, char *value); void makeConnectString(char *connect_string, ConnInfo * ci);
void copyAttributes(ConnInfo * ci, char *attribute, char *value);
#endif #endif
This diff is collapsed.
This diff is collapsed.
/* File: environ.h /* File: environ.h
* *
* Description: See "environ.c" * Description: See "environ.c"
* *
* Comments: See "notice.txt" for copyright and license information. * Comments: See "notice.txt" for copyright and license information.
* *
*/ */
...@@ -29,17 +29,18 @@ ...@@ -29,17 +29,18 @@
#define ENV_ALLOC_ERROR 1 #define ENV_ALLOC_ERROR 1
/********** Environment Handle *************/ /********** Environment Handle *************/
struct EnvironmentClass_ { struct EnvironmentClass_
char *errormsg; {
int errornumber; char *errormsg;
int errornumber;
}; };
/* Environment prototypes */ /* Environment prototypes */
EnvironmentClass *EN_Constructor(void); EnvironmentClass *EN_Constructor(void);
char EN_Destructor(EnvironmentClass *self); char EN_Destructor(EnvironmentClass * self);
char EN_get_error(EnvironmentClass *self, int *number, char **message); char EN_get_error(EnvironmentClass * self, int *number, char **message);
char EN_add_connection(EnvironmentClass *self, ConnectionClass *conn); char EN_add_connection(EnvironmentClass * self, ConnectionClass * conn);
char EN_remove_connection(EnvironmentClass *self, ConnectionClass *conn); char EN_remove_connection(EnvironmentClass * self, ConnectionClass * conn);
void EN_log_error(char *func, char *desc, EnvironmentClass *self); void EN_log_error(char *func, char *desc, EnvironmentClass * self);
#endif #endif
This diff is collapsed.
This diff is collapsed.
...@@ -13,25 +13,32 @@ ...@@ -13,25 +13,32 @@
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C"
{
#endif #endif
DWORD DWORD
GetPrivateProfileString(char *theSection, /* section name */ GetPrivateProfileString(char *theSection, /* section name */
char *theKey, /* search key name */ char *theKey, /* search key name */
char *theDefault, /* default value if not found */ char *theDefault, /* default value if not
char *theReturnBuffer, /* return valuse stored here */ * found */
size_t theBufferLength, /* byte length of return buffer */ char *theReturnBuffer, /* return valuse stored
char *theIniFileName); /* pathname of ini file to search */ * here */
size_t theBufferLength, /* byte length of return
* buffer */
char *theIniFileName); /* pathname of ini file
* to search */
DWORD DWORD
WritePrivateProfileString(char *theSection, /* section name */ WritePrivateProfileString(char *theSection, /* section name */
char *theKey, /* write key name */ char *theKey, /* write key name */
char *theBuffer, /* input buffer */ char *theBuffer, /* input buffer */
char *theIniFileName); /* pathname of ini file to write */ char *theIniFileName); /* pathname of ini file
* to write */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#ifndef WIN32 #ifndef WIN32
......
This diff is collapsed.
#ifndef _IODBC_H #ifndef _IODBC_H
#define _IODBC_H #define _IODBC_H
# if !defined(WIN32) && !defined(WIN32_SYSTEM) #if !defined(WIN32) && !defined(WIN32_SYSTEM)
# define _UNIX_ #define _UNIX_
# include <stdlib.h> #include <stdlib.h>
# include <sys/types.h> #include <sys/types.h>
# define MEM_ALLOC(size) (malloc((size_t)(size))) #define MEM_ALLOC(size) (malloc((size_t)(size)))
# define MEM_FREE(ptr) {if(ptr) free(ptr);} #define MEM_FREE(ptr) {if(ptr) free(ptr);}
# define STRCPY(t, s) (strcpy((char*)(t), (char*)(s))) #define STRCPY(t, s) (strcpy((char*)(t), (char*)(s)))
# define STRNCPY(t,s,n) (strncpy((char*)(t), (char*)(s), (size_t)(n))) #define STRNCPY(t,s,n) (strncpy((char*)(t), (char*)(s), (size_t)(n)))
# define STRCAT(t, s) (strcat((char*)(t), (char*)(s))) #define STRCAT(t, s) (strcat((char*)(t), (char*)(s)))
# define STRNCAT(t,s,n) (strncat((char*)(t), (char*)(s), (size_t)(n))) #define STRNCAT(t,s,n) (strncat((char*)(t), (char*)(s), (size_t)(n)))
# define STREQ(a, b) (strcmp((char*)(a), (char*)(b)) == 0) #define STREQ(a, b) (strcmp((char*)(a), (char*)(b)) == 0)
# define STRLEN(str) ((str)? strlen((char*)(str)):0) #define STRLEN(str) ((str)? strlen((char*)(str)):0)
# define EXPORT #define EXPORT
# define CALLBACK #define CALLBACK
# define FAR #define FAR
typedef signed short SSHOR; typedef signed short SSHOR;
typedef short WORD; typedef short WORD;
typedef long DWORD; typedef long DWORD;
typedef WORD WPARAM; typedef WORD WPARAM;
typedef DWORD LPARAM; typedef DWORD LPARAM;
typedef void* HWND; typedef void *HWND;
typedef int BOOL; typedef int BOOL;
# endif /* _UNIX_ */ #endif /* _UNIX_ */
# if defined(WIN32) || defined(WIN32_SYSTEM) #if defined(WIN32) || defined(WIN32_SYSTEM)
# include <windows.h> #include <windows.h>
# include <windowsx.h> #include <windowsx.h>
# ifdef _MSVC_ #ifdef _MSVC_
# define MEM_ALLOC(size) (fmalloc((size_t)(size))) #define MEM_ALLOC(size) (fmalloc((size_t)(size)))
# define MEM_FREE(ptr) ((ptr)? ffree((PTR)(ptr)):0)) #define MEM_FREE(ptr) ((ptr)? ffree((PTR)(ptr)):0))
# define STRCPY(t, s) (fstrcpy((char FAR*)(t), (char FAR*)(s))) #define STRCPY(t, s) (fstrcpy((char FAR*)(t), (char FAR*)(s)))
# define STRNCPY(t,s,n) (fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n))) #define STRNCPY(t,s,n) (fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n)))
# define STRLEN(str) ((str)? fstrlen((char FAR*)(str)):0) #define STRLEN(str) ((str)? fstrlen((char FAR*)(str)):0)
# define STREQ(a, b) (fstrcmp((char FAR*)(a), (char FAR*)(b) == 0) #define STREQ(a, b) (fstrcmp((char FAR*)(a), (char FAR*)(b) == 0)
# endif #endif
# ifdef _BORLAND_ #ifdef _BORLAND_
# define MEM_ALLOC(size) (farmalloc((unsigned long)(size)) #define MEM_ALLOC(size) (farmalloc((unsigned long)(size))
# define MEM_FREE(ptr) ((ptr)? farfree((void far*)(ptr)):0) #define MEM_FREE(ptr) ((ptr)? farfree((void far*)(ptr)):0)
# define STRCPY(t, s) (_fstrcpy((char FAR*)(t), (char FAR*)(s))) #define STRCPY(t, s) (_fstrcpy((char FAR*)(t), (char FAR*)(s)))
# define STRNCPY(t,s,n) (_fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n))) #define STRNCPY(t,s,n) (_fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n)))
# define STRLEN(str) ((str)? _fstrlen((char FAR*)(str)):0) #define STRLEN(str) ((str)? _fstrlen((char FAR*)(str)):0)
# define STREQ(a, b) (_fstrcmp((char FAR*)(a), (char FAR*)(b) == 0) #define STREQ(a, b) (_fstrcmp((char FAR*)(a), (char FAR*)(b) == 0)
# endif #endif
# endif /* WIN32 */ #endif /* WIN32 */
# define SYSERR (-1) #define SYSERR (-1)
# ifndef NULL #ifndef NULL
# define NULL ((void FAR*)0UL) #define NULL ((void FAR*)0UL)
# endif #endif
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* File: lobj.h /* File: lobj.h
* *
* Description: See "lobj.c" * Description: See "lobj.c"
* *
* Comments: See "notice.txt" for copyright and license information. * Comments: See "notice.txt" for copyright and license information.
* *
*/ */
...@@ -13,14 +13,15 @@ ...@@ -13,14 +13,15 @@
#include "psqlodbc.h" #include "psqlodbc.h"
struct lo_arg { struct lo_arg
int isint; {
int len; int isint;
int len;
union union
{ {
int integer; int integer;
char *ptr; char *ptr;
} u; } u;
}; };
#define LO_CREAT 957 #define LO_CREAT 957
...@@ -35,14 +36,13 @@ struct lo_arg { ...@@ -35,14 +36,13 @@ struct lo_arg {
#define INV_WRITE 0x00020000 #define INV_WRITE 0x00020000
#define INV_READ 0x00040000 #define INV_READ 0x00040000
Oid lo_creat(ConnectionClass *conn, int mode); Oid lo_creat(ConnectionClass * conn, int mode);
int lo_open(ConnectionClass *conn, int lobjId, int mode); int lo_open(ConnectionClass * conn, int lobjId, int mode);
int lo_close(ConnectionClass *conn, int fd); int lo_close(ConnectionClass * conn, int fd);
int lo_read(ConnectionClass *conn, int fd, char *buf, int len); int lo_read(ConnectionClass * conn, int fd, char *buf, int len);
int lo_write(ConnectionClass *conn, int fd, char *buf, int len); int lo_write(ConnectionClass * conn, int fd, char *buf, int len);
int lo_lseek(ConnectionClass *conn, int fd, int offset, int len); int lo_lseek(ConnectionClass * conn, int fd, int offset, int len);
int lo_tell(ConnectionClass *conn, int fd); int lo_tell(ConnectionClass * conn, int fd);
int lo_unlink(ConnectionClass *conn, Oid lobjId); int lo_unlink(ConnectionClass * conn, Oid lobjId);
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* File: tuple.h /* File: tuple.h
* *
* Description: See "tuple.c" * Description: See "tuple.c"
* *
* Important NOTE: The TupleField structure is used both to hold backend data and * Important NOTE: The TupleField structure is used both to hold backend data and
* manual result set data. The "set_" functions and the TupleNode * manual result set data. The "set_" functions and the TupleNode
* structure are only used for manual result sets by info routines. * structure are only used for manual result sets by info routines.
* *
* Comments: See "notice.txt" for copyright and license information. * Comments: See "notice.txt" for copyright and license information.
* *
*/ */
...@@ -17,15 +17,18 @@ ...@@ -17,15 +17,18 @@
#include "psqlodbc.h" #include "psqlodbc.h"
/* Used by backend data AND manual result sets */ /* Used by backend data AND manual result sets */
struct TupleField_ { struct TupleField_
Int4 len; /* length of the current Tuple */ {
void *value; /* an array representing the value */ Int4 len; /* length of the current Tuple */
void *value; /* an array representing the value */
}; };
/* Used ONLY for manual result sets */ /* Used ONLY for manual result sets */
struct TupleNode_ { struct TupleNode_
struct TupleNode_ *prev, *next; {
TupleField tuple[1]; struct TupleNode_ *prev,
*next;
TupleField tuple[1];
}; };
/* These macros are wrappers for the corresponding set_tuplefield functions /* These macros are wrappers for the corresponding set_tuplefield functions
...@@ -36,9 +39,9 @@ struct TupleNode_ { ...@@ -36,9 +39,9 @@ struct TupleNode_ {
#define set_nullfield_int2(FLD, VAL) ((VAL) != -1 ? set_tuplefield_int2(FLD, (VAL)) : set_tuplefield_null(FLD)) #define set_nullfield_int2(FLD, VAL) ((VAL) != -1 ? set_tuplefield_int2(FLD, (VAL)) : set_tuplefield_null(FLD))
#define set_nullfield_int4(FLD, VAL) ((VAL) != -1 ? set_tuplefield_int4(FLD, (VAL)) : set_tuplefield_null(FLD)) #define set_nullfield_int4(FLD, VAL) ((VAL) != -1 ? set_tuplefield_int4(FLD, (VAL)) : set_tuplefield_null(FLD))
void set_tuplefield_null(TupleField *tuple_field); void set_tuplefield_null(TupleField * tuple_field);
void set_tuplefield_string(TupleField *tuple_field, char *string); void set_tuplefield_string(TupleField * tuple_field, char *string);
void set_tuplefield_int2(TupleField *tuple_field, Int2 value); void set_tuplefield_int2(TupleField * tuple_field, Int2 value);
void set_tuplefield_int4(TupleField *tuple_field, Int4 value); void set_tuplefield_int4(TupleField * tuple_field, Int4 value);
#endif #endif
This diff is collapsed.
This diff is collapsed.
...@@ -3,7 +3,7 @@ This can format all PostgreSQL *.c and *.h files, excluding libpq++, ...@@ -3,7 +3,7 @@ This can format all PostgreSQL *.c and *.h files, excluding libpq++,
On 09/06/1997, from the top directory, I ran: On 09/06/1997, from the top directory, I ran:
find . -name '*.[ch]' -type f -print | egrep -v '\+\+|/odbc/|s_lock.h' | xargs -n100 pgindent find . -name '*.[ch]' -type f -print | egrep -v '\+\+|s_lock.h' | xargs -n100 pgindent
The stock BSD indent has two bugs. First, a comment after the word 'else' The stock BSD indent has two bugs. First, a comment after the word 'else'
causes the rest of the file to be ignored. Second, it silently ignores causes the rest of the file to be ignored. Second, it silently ignores
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment