1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-21 02:52:47 +03:00

Back out all ODBC formatting changes, and back out removal of <6.4

protocol. I have left in Tom's SOCK_get_next_byte() fix, and the new
win32.mak file addition.  I have also left in the 'X' connection close
fix.
This commit is contained in:
Bruce Momjian
2001-02-14 05:45:46 +00:00
parent 18b04ae131
commit 594e97b72f
45 changed files with 9580 additions and 11060 deletions

View File

@@ -1,9 +1,9 @@
/* File: socket.h
/* File: socket.h
*
* Description: See "socket.c"
* Description: See "socket.c"
*
* Comments: See "notice.txt" for copyright and license information.
* Comments: See "notice.txt" for copyright and license information.
*
*/
@@ -25,11 +25,10 @@
#define closesocket(xxx) close(xxx)
#define SOCKETFD int
#ifndef INADDR_NONE
#ifndef INADDR_NONE
#ifndef _IN_ADDR_T
#define _IN_ADDR_T
typedef unsigned int in_addr_t;
typedef unsigned int in_addr_t;
#endif
#define INADDR_NONE ((in_addr_t)-1)
#endif
@@ -41,34 +40,32 @@ typedef unsigned int in_addr_t;
#include "psqlodbc.h"
#define SOCKET_ALREADY_CONNECTED 1
#define SOCKET_HOST_NOT_FOUND 2
#define SOCKET_COULD_NOT_CREATE_SOCKET 3
#define SOCKET_COULD_NOT_CONNECT 4
#define SOCKET_READ_ERROR 5
#define SOCKET_WRITE_ERROR 6
#define SOCKET_NULLPOINTER_PARAMETER 7
#define SOCKET_PUT_INT_WRONG_LENGTH 8
#define SOCKET_GET_INT_WRONG_LENGTH 9
#define SOCKET_CLOSED 10
#define SOCKET_ALREADY_CONNECTED 1
#define SOCKET_HOST_NOT_FOUND 2
#define SOCKET_COULD_NOT_CREATE_SOCKET 3
#define SOCKET_COULD_NOT_CONNECT 4
#define SOCKET_READ_ERROR 5
#define SOCKET_WRITE_ERROR 6
#define SOCKET_NULLPOINTER_PARAMETER 7
#define SOCKET_PUT_INT_WRONG_LENGTH 8
#define SOCKET_GET_INT_WRONG_LENGTH 9
#define SOCKET_CLOSED 10
struct SocketClass_
{
struct SocketClass_ {
int buffer_filled_in;
int buffer_filled_out;
int buffer_read_in;
int buffer_filled_in;
int buffer_filled_out;
int buffer_read_in;
unsigned char *buffer_in;
unsigned char *buffer_out;
SOCKETFD socket;
SOCKETFD socket;
char *errormsg;
int errornumber;
char *errormsg;
int errornumber;
char reverse; /* used to handle Postgres 6.2 protocol
* (reverse byte order) */
char reverse; /* used to handle Postgres 6.2 protocol (reverse byte order) */
};
@@ -83,17 +80,17 @@ struct SocketClass_
/* Socket prototypes */
SocketClass *SOCK_Constructor(void);
void SOCK_Destructor(SocketClass *self);
char SOCK_connect_to(SocketClass *self, unsigned short port, char *hostname);
void SOCK_get_n_char(SocketClass *self, char *buffer, int len);
void SOCK_put_n_char(SocketClass *self, char *buffer, int len);
void SOCK_get_string(SocketClass *self, char *buffer, int bufsize);
void SOCK_put_string(SocketClass *self, char *string);
int SOCK_get_int(SocketClass *self, short len);
void SOCK_put_int(SocketClass *self, int value, short len);
void SOCK_flush_output(SocketClass *self);
void SOCK_Destructor(SocketClass *self);
char SOCK_connect_to(SocketClass *self, unsigned short port, char *hostname);
void SOCK_get_n_char(SocketClass *self, char *buffer, int len);
void SOCK_put_n_char(SocketClass *self, char *buffer, int len);
void SOCK_get_string(SocketClass *self, char *buffer, int bufsize);
void SOCK_put_string(SocketClass *self, char *string);
int SOCK_get_int(SocketClass *self, short len);
void SOCK_put_int(SocketClass *self, int value, short len);
void SOCK_flush_output(SocketClass *self);
unsigned char SOCK_get_next_byte(SocketClass *self);
void SOCK_put_next_byte(SocketClass *self, unsigned char next_byte);
void SOCK_clear_error(SocketClass *self);
void SOCK_put_next_byte(SocketClass *self, unsigned char next_byte);
void SOCK_clear_error(SocketClass *self);
#endif