summaryrefslogtreecommitdiff
path: root/src/interfaces/odbc/connection.h
diff options
context:
space:
mode:
authorByron Nikolaidis1998-06-03 20:33:45 +0000
committerByron Nikolaidis1998-06-03 20:33:45 +0000
commit99d21d5b62a54d64b95dc915a35fb35111bbc430 (patch)
tree06f02f33d40f78fd3b73ad6d775b18fd34ffd7e4 /src/interfaces/odbc/connection.h
parent85f91d0e8e2fa996a2c7ec629037387e1a9cfd88 (diff)
Update odbc driver to current version V.0244
Diffstat (limited to 'src/interfaces/odbc/connection.h')
-rw-r--r--src/interfaces/odbc/connection.h97
1 files changed, 53 insertions, 44 deletions
diff --git a/src/interfaces/odbc/connection.h b/src/interfaces/odbc/connection.h
index 30d567212ca..8ffc15b3d35 100644
--- a/src/interfaces/odbc/connection.h
+++ b/src/interfaces/odbc/connection.h
@@ -1,17 +1,18 @@
-
-/* File: connection.h
- *
- * Description: See "connection.c"
- *
- * Comments: See "notice.txt" for copyright and license information.
- *
- */
+
+/* File: connection.h
+ *
+ * Description: See "connection.c"
+ *
+ * Comments: See "notice.txt" for copyright and license information.
+ *
+ */
#ifndef __CONNECTION_H__
#define __CONNECTION_H__
#include <windows.h>
#include <sql.h>
+#include <sqlext.h>
#include "psqlodbc.h"
typedef enum {
@@ -44,9 +45,9 @@ typedef enum {
/* SetConnectOption: corresponds to ODBC--"S1009" */
#define CONN_TRANSACT_IN_PROGRES 7
#define CONN_NO_MEMORY_ERROR 8
-#define CONN_NOT_IMPLEMENTED_ERROR 9
+#define CONN_NOT_IMPLEMENTED_ERROR 9
#define CONN_INVALID_AUTHENTICATION 10
-#define CONN_AUTH_TYPE_UNSUPPORTED 11
+#define CONN_AUTH_TYPE_UNSUPPORTED 11
/* Conn_status defines */
@@ -77,12 +78,12 @@ typedef enum {
#define SM_OPTIONS 64
#define SM_UNUSED 64
#define SM_TTY 64
-
-/* Old 6.2 protocol defines */
-#define NO_AUTHENTICATION 7
-#define PATH_SIZE 64
-#define ARGV_SIZE 64
-#define NAMEDATALEN 16
+
+/* Old 6.2 protocol defines */
+#define NO_AUTHENTICATION 7
+#define PATH_SIZE 64
+#define ARGV_SIZE 64
+#define NAMEDATALEN 16
typedef unsigned int ProtocolVersion;
@@ -90,7 +91,7 @@ typedef unsigned int ProtocolVersion;
#define PG_PROTOCOL_LATEST PG_PROTOCOL(1, 0)
#define PG_PROTOCOL_EARLIEST PG_PROTOCOL(0, 0)
-/* This startup packet is to support latest Postgres protocol (6.3) */
+/* This startup packet is to support latest Postgres protocol (6.3) */
typedef struct _StartupPacket
{
ProtocolVersion protoVersion;
@@ -100,41 +101,47 @@ typedef struct _StartupPacket
char unused[SM_UNUSED];
char tty[SM_TTY];
} StartupPacket;
-
-
+
+
/* This startup packet is to support pre-Postgres 6.3 protocol */
-typedef struct _StartupPacket6_2
-{
- unsigned int authtype;
- char database[PATH_SIZE];
- char user[NAMEDATALEN];
- char options[ARGV_SIZE];
- char execfile[ARGV_SIZE];
- char tty[PATH_SIZE];
-} StartupPacket6_2;
-
-
-/* Structure to hold all the connection attributes for a specific
- connection (used for both registry and file, DSN and DRIVER)
+typedef struct _StartupPacket6_2
+{
+ unsigned int authtype;
+ char database[PATH_SIZE];
+ char user[NAMEDATALEN];
+ char options[ARGV_SIZE];
+ char execfile[ARGV_SIZE];
+ char tty[PATH_SIZE];
+} StartupPacket6_2;
+
+
+/* Structure to hold all the connection attributes for a specific
+ connection (used for both registry and file, DSN and DRIVER)
*/
typedef struct {
char dsn[MEDIUM_REGISTRY_LEN];
+ char desc[MEDIUM_REGISTRY_LEN];
char driver[MEDIUM_REGISTRY_LEN];
char server[MEDIUM_REGISTRY_LEN];
char database[MEDIUM_REGISTRY_LEN];
char username[MEDIUM_REGISTRY_LEN];
- char password[MEDIUM_REGISTRY_LEN];
- char conn_settings[LARGE_REGISTRY_LEN];
+ char password[MEDIUM_REGISTRY_LEN];
+ char conn_settings[LARGE_REGISTRY_LEN];
char protocol[SMALL_REGISTRY_LEN];
char port[SMALL_REGISTRY_LEN];
- char readonly[SMALL_REGISTRY_LEN];
+ char readonly[SMALL_REGISTRY_LEN];
+// char unknown_sizes[SMALL_REGISTRY_LEN];
+ char fake_oid_index[SMALL_REGISTRY_LEN];
+ char show_oid_column[SMALL_REGISTRY_LEN];
+ char show_system_tables[SMALL_REGISTRY_LEN];
char focus_password;
} ConnInfo;
-
+
/* Macro to determine is the connection using 6.2 protocol? */
-#define PROTOCOL_62(conninfo_) (strncmp((conninfo_)->protocol, PG62, strlen(PG62)) == 0)
-
-
+#define PROTOCOL_62(conninfo_) (strncmp((conninfo_)->protocol, PG62, strlen(PG62)) == 0)
+
+
+
/******* The Connection handle ************/
struct ConnectionClass_ {
HENV henv; /* environment this connection was created on */
@@ -145,6 +152,7 @@ struct ConnectionClass_ {
StatementClass **stmts;
int num_stmts;
SocketClass *sock;
+ int lobj_type;
char transact_status; /* Is a transaction is currently in progress */
char errormsg_created; /* has an informative error msg been created? */
};
@@ -162,15 +170,14 @@ struct ConnectionClass_ {
/* for CC_DSN_info */
#define CONN_DONT_OVERWRITE 0
#define CONN_OVERWRITE 1
-
-
+
+
/* prototypes */
ConnectionClass *CC_Constructor();
char CC_Destructor(ConnectionClass *self);
+int CC_cursor_count(ConnectionClass *self);
char CC_cleanup(ConnectionClass *self);
char CC_abort(ConnectionClass *self);
-void CC_DSN_info(ConnectionClass *self, char overwrite);
-void CC_set_defaults(ConnectionClass *self);
char CC_connect(ConnectionClass *self, char do_password);
char CC_add_statement(ConnectionClass *self, StatementClass *stmt);
char CC_remove_statement(ConnectionClass *self, StatementClass *stmt);
@@ -178,6 +185,8 @@ char CC_get_error(ConnectionClass *self, int *number, char **message);
QResultClass *CC_send_query(ConnectionClass *self, char *query, QResultClass *result_in, char *cursor);
void CC_clear_error(ConnectionClass *self);
char *CC_create_errormsg(ConnectionClass *self);
-char CC_send_settings(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);
+char CC_send_settings(ConnectionClass *self);
+void CC_lookup_lo(ConnectionClass *conn);
#endif