Commit 26dc5014 authored by Bruce Momjian's avatar Bruce Momjian

More cleanup.

parent 82b1fd1e
......@@ -46,7 +46,7 @@ SQLBindParameter(
SWORD ibScale,
PTR rgbValue,
SDWORD cbValueMax,
SDWORD FAR * pcbValue)
SDWORD FAR *pcbValue)
{
StatementClass *stmt = (StatementClass *) hstmt;
static char *func = "SQLBindParameter";
......@@ -163,7 +163,7 @@ SQLBindCol(
SWORD fCType,
PTR rgbValue,
SDWORD cbValueMax,
SDWORD FAR * pcbValue)
SDWORD FAR *pcbValue)
{
StatementClass *stmt = (StatementClass *) hstmt;
static char *func = "SQLBindCol";
......@@ -271,10 +271,10 @@ RETCODE SQL_API
SQLDescribeParam(
HSTMT hstmt,
UWORD ipar,
SWORD FAR * pfSqlType,
UDWORD FAR * pcbColDef,
SWORD FAR * pibScale,
SWORD FAR * pfNullable)
SWORD FAR *pfSqlType,
UDWORD FAR *pcbColDef,
SWORD FAR *pibScale,
SWORD FAR *pfNullable)
{
StatementClass *stmt = (StatementClass *) hstmt;
static char *func = "SQLDescribeParam";
......@@ -325,7 +325,7 @@ RETCODE SQL_API
SQLParamOptions(
HSTMT hstmt,
UDWORD crow,
UDWORD FAR * pirow)
UDWORD FAR *pirow)
{
static char *func = "SQLParamOptions";
......@@ -347,7 +347,7 @@ SQLParamOptions(
RETCODE SQL_API
SQLNumParams(
HSTMT hstmt,
SWORD FAR * pcpar)
SWORD FAR *pcpar)
{
StatementClass *stmt = (StatementClass *) hstmt;
char in_quote = FALSE;
......@@ -421,7 +421,7 @@ create_empty_bindings(int num_columns)
}
void
extend_bindings(StatementClass * stmt, int num_columns)
extend_bindings(StatementClass *stmt, int num_columns)
{
static char *func = "extend_bindings";
BindInfoClass *new_bindings;
......
......@@ -49,6 +49,6 @@ struct ParameterInfoClass_
};
BindInfoClass *create_empty_bindings(int num_columns);
void extend_bindings(StatementClass * stmt, int num_columns);
void extend_bindings(StatementClass *stmt, int num_columns);
#endif
......@@ -38,7 +38,7 @@ CI_Constructor()
}
void
CI_Destructor(ColumnInfoClass * self)
CI_Destructor(ColumnInfoClass *self)
{
CI_free_memory(self);
......@@ -50,7 +50,7 @@ CI_Destructor(ColumnInfoClass * self)
If self is null, then just read, don't store.
*/
char
CI_read_fields(ColumnInfoClass * self, ConnectionClass * conn)
CI_read_fields(ColumnInfoClass *self, ConnectionClass *conn)
{
Int2 lf;
int new_num_fields;
......@@ -105,7 +105,7 @@ CI_read_fields(ColumnInfoClass * self, ConnectionClass * conn)
void
CI_free_memory(ColumnInfoClass * self)
CI_free_memory(ColumnInfoClass *self)
{
register Int2 lf;
int num_fields = self->num_fields;
......@@ -126,7 +126,7 @@ CI_free_memory(ColumnInfoClass * self)
}
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 */
......@@ -140,7 +140,7 @@ CI_set_num_fields(ColumnInfoClass * self, int new_num_fields)
}
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)
{
/* check bounds */
......
......@@ -30,14 +30,14 @@ struct ColumnInfoClass_
#define CI_get_atttypmod(self, col) (self->atttypmod[col])
ColumnInfoClass *CI_Constructor(void);
void CI_Destructor(ColumnInfoClass * self);
void CI_free_memory(ColumnInfoClass * self);
char CI_read_fields(ColumnInfoClass * self, ConnectionClass * conn);
void CI_Destructor(ColumnInfoClass *self);
void CI_free_memory(ColumnInfoClass *self);
char CI_read_fields(ColumnInfoClass *self, ConnectionClass *conn);
/* functions for setting up the fields from within the program, */
/* without reading from a socket */
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_num_fields(ColumnInfoClass *self, int new_num_fields);
void CI_set_field_info(ColumnInfoClass *self, int field_num, char *new_name,
Oid new_adtid, Int2 new_adtsize, Int4 atttypmod);
......
......@@ -37,7 +37,7 @@ extern GLOBAL_VALUES globals;
RETCODE SQL_API
SQLAllocConnect(
HENV henv,
HDBC FAR * phdbc)
HDBC FAR *phdbc)
{
EnvironmentClass *env = (EnvironmentClass *) henv;
ConnectionClass *conn;
......@@ -78,11 +78,11 @@ SQLAllocConnect(
RETCODE SQL_API
SQLConnect(
HDBC hdbc,
UCHAR FAR * szDSN,
UCHAR FAR *szDSN,
SWORD cbDSN,
UCHAR FAR * szUID,
UCHAR FAR *szUID,
SWORD cbUID,
UCHAR FAR * szAuthStr,
UCHAR FAR *szAuthStr,
SWORD cbAuthStr)
{
ConnectionClass *conn = (ConnectionClass *) hdbc;
......@@ -135,11 +135,11 @@ SQLConnect(
RETCODE SQL_API
SQLBrowseConnect(
HDBC hdbc,
UCHAR FAR * szConnStrIn,
UCHAR FAR *szConnStrIn,
SWORD cbConnStrIn,
UCHAR FAR * szConnStrOut,
UCHAR FAR *szConnStrOut,
SWORD cbConnStrOutMax,
SWORD FAR * pcbConnStrOut)
SWORD FAR *pcbConnStrOut)
{
static char *func = "SQLBrowseConnect";
......@@ -285,7 +285,7 @@ CC_Constructor()
char
CC_Destructor(ConnectionClass * self)
CC_Destructor(ConnectionClass *self)
{
mylog("enter CC_Destructor, self=%u\n", self);
......@@ -329,7 +329,7 @@ CC_Destructor(ConnectionClass * self)
/* Return how many cursors are opened on this connection */
int
CC_cursor_count(ConnectionClass * self)
CC_cursor_count(ConnectionClass *self)
{
StatementClass *stmt;
int i,
......@@ -350,7 +350,7 @@ CC_cursor_count(ConnectionClass * self)
}
void
CC_clear_error(ConnectionClass * self)
CC_clear_error(ConnectionClass *self)
{
self->errornumber = 0;
self->errormsg = NULL;
......@@ -360,7 +360,7 @@ CC_clear_error(ConnectionClass * self)
/* Used to cancel a transaction */
/* We are almost always in the middle of a transaction. */
char
CC_abort(ConnectionClass * self)
CC_abort(ConnectionClass *self)
{
QResultClass *res;
......@@ -384,7 +384,7 @@ CC_abort(ConnectionClass * self)
/* This is called by SQLDisconnect also */
char
CC_cleanup(ConnectionClass * self)
CC_cleanup(ConnectionClass *self)
{
int i;
StatementClass *stmt;
......@@ -437,7 +437,7 @@ CC_cleanup(ConnectionClass * self)
}
int
CC_set_translation(ConnectionClass * self)
CC_set_translation(ConnectionClass *self)
{
#ifdef WIN32
......@@ -480,7 +480,7 @@ CC_set_translation(ConnectionClass * self)
}
char
CC_connect(ConnectionClass * self, char do_password)
CC_connect(ConnectionClass *self, char do_password)
{
StartupPacket sp;
QResultClass *res;
......@@ -733,7 +733,7 @@ CC_connect(ConnectionClass * self, char do_password)
}
char
CC_add_statement(ConnectionClass * self, StatementClass * stmt)
CC_add_statement(ConnectionClass *self, StatementClass *stmt)
{
int i;
......@@ -765,7 +765,7 @@ CC_add_statement(ConnectionClass * self, StatementClass * stmt)
}
char
CC_remove_statement(ConnectionClass * self, StatementClass * stmt)
CC_remove_statement(ConnectionClass *self, StatementClass *stmt)
{
int i;
......@@ -785,7 +785,7 @@ CC_remove_statement(ConnectionClass * self, StatementClass * stmt)
error message with its socket error message.
*/
char *
CC_create_errormsg(ConnectionClass * self)
CC_create_errormsg(ConnectionClass *self)
{
SocketClass *sock = self->sock;
int pos;
......@@ -812,7 +812,7 @@ CC_create_errormsg(ConnectionClass * self)
char
CC_get_error(ConnectionClass * self, int *number, char **message)
CC_get_error(ConnectionClass *self, int *number, char **message)
{
int rv;
......@@ -849,7 +849,7 @@ CC_get_error(ConnectionClass * self, int *number, char **message)
'declare cursor C3326857 for ...' and 'fetch 100 in C3326857' statements.
*/
QResultClass *
CC_send_query(ConnectionClass * self, char *query, QueryInfo * qi)
CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi)
{
QResultClass *result_in,
*res = NULL;
......@@ -1142,7 +1142,7 @@ CC_send_query(ConnectionClass * self, char *query, QueryInfo * qi)
}
int
CC_send_function(ConnectionClass * self, int fnid, void *result_buf, int *actual_result_len, int result_is_int, LO_ARG * args, int nargs)
CC_send_function(ConnectionClass *self, int fnid, void *result_buf, int *actual_result_len, int result_is_int, LO_ARG *args, int nargs)
{
char id,
c,
......@@ -1289,7 +1289,7 @@ CC_send_function(ConnectionClass * self, int fnid, void *result_buf, int *actual
char
CC_send_settings(ConnectionClass * self)
CC_send_settings(ConnectionClass *self)
{
/* char ini_query[MAX_MESSAGE_LEN]; */
ConnInfo *ci = &(self->connInfo);
......@@ -1393,7 +1393,7 @@ CC_send_settings(ConnectionClass * self)
will go away and the define 'PG_TYPE_LO' will be updated.
*/
void
CC_lookup_lo(ConnectionClass * self)
CC_lookup_lo(ConnectionClass *self)
{
HSTMT hstmt;
StatementClass *stmt;
......@@ -1442,7 +1442,7 @@ CC_lookup_lo(ConnectionClass * self)
h-inoue 01-2-2001
*/
void
CC_initialize_pg_version(ConnectionClass * self)
CC_initialize_pg_version(ConnectionClass *self)
{
strcpy(self->pg_version, self->connInfo.protocol);
self->pg_version_number = (float) 6.4;
......@@ -1455,7 +1455,7 @@ CC_initialize_pg_version(ConnectionClass * self)
DJP - 25-1-2001
*/
void
CC_lookup_pg_version(ConnectionClass * self)
CC_lookup_pg_version(ConnectionClass *self)
{
HSTMT hstmt;
StatementClass *stmt;
......@@ -1517,7 +1517,7 @@ CC_lookup_pg_version(ConnectionClass * self)
}
void
CC_log_error(char *func, char *desc, ConnectionClass * self)
CC_log_error(char *func, char *desc, ConnectionClass *self)
{
#ifdef PRN_NULLCHECK
#define nullcheck(a) (a ? a : "(NULL)")
......
......@@ -35,7 +35,7 @@ typedef enum
CONN_DOWN, /* Connection is broken */
CONN_EXECUTING /* the connection is currently executing a
* statement */
} CONN_Status;
} CONN_Status;
/* These errors have general sql error state */
#define CONNECTION_SERVER_NOT_REACHED 101
......@@ -145,7 +145,7 @@ typedef struct
char translation_dll[MEDIUM_REGISTRY_LEN];
char translation_option[SMALL_REGISTRY_LEN];
char focus_password;
} ConnInfo;
} ConnInfo;
/*
* Macros to compare the server's version with a specified version
......@@ -199,27 +199,27 @@ struct col_info
#define HINSTANCE void *
#endif
typedef BOOL(FAR WINAPI * DataSourceToDriverProc) (UDWORD,
SWORD,
PTR,
SDWORD,
PTR,
SDWORD,
SDWORD FAR *,
UCHAR FAR *,
SWORD,
SWORD FAR *);
typedef BOOL(FAR WINAPI * DriverToDataSourceProc) (UDWORD,
SWORD,
PTR,
SDWORD,
PTR,
SDWORD,
SDWORD FAR *,
UCHAR FAR *,
SWORD,
SWORD FAR *);
typedef BOOL (FAR WINAPI * DataSourceToDriverProc) (UDWORD,
SWORD,
PTR,
SDWORD,
PTR,
SDWORD,
SDWORD FAR *,
UCHAR FAR *,
SWORD,
SWORD FAR *);
typedef BOOL (FAR WINAPI * DriverToDataSourceProc) (UDWORD,
SWORD,
PTR,
SDWORD,
PTR,
SDWORD,
SDWORD FAR *,
UCHAR FAR *,
SWORD,
SWORD FAR *);
/******* The Connection handle ************/
struct ConnectionClass_
......@@ -270,24 +270,24 @@ struct ConnectionClass_
/* prototypes */
ConnectionClass *CC_Constructor(void);
char CC_Destructor(ConnectionClass * self);
int CC_cursor_count(ConnectionClass * self);
char CC_cleanup(ConnectionClass * self);
char CC_abort(ConnectionClass * self);
int CC_set_translation(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);
char CC_get_error(ConnectionClass * self, int *number, char **message);
QResultClass *CC_send_query(ConnectionClass * self, char *query, QueryInfo * qi);
void CC_clear_error(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);
char CC_send_settings(ConnectionClass * self);
void CC_lookup_lo(ConnectionClass * conn);
void CC_lookup_pg_version(ConnectionClass * conn);
void CC_initialize_pg_version(ConnectionClass * conn);
void CC_log_error(char *func, char *desc, ConnectionClass * self);
char CC_Destructor(ConnectionClass *self);
int CC_cursor_count(ConnectionClass *self);
char CC_cleanup(ConnectionClass *self);
char CC_abort(ConnectionClass *self);
int CC_set_translation(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);
char CC_get_error(ConnectionClass *self, int *number, char **message);
QResultClass *CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi);
void CC_clear_error(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);
char CC_send_settings(ConnectionClass *self);
void CC_lookup_lo(ConnectionClass *conn);
void CC_lookup_pg_version(ConnectionClass *conn);
void CC_initialize_pg_version(ConnectionClass *conn);
void CC_log_error(char *func, char *desc, ConnectionClass *self);
#endif
......@@ -154,7 +154,7 @@ char *conv_to_octal(unsigned char val);
/* This is called by SQLFetch() */
int
copy_and_convert_field_bindinfo(StatementClass * stmt, Int4 field_type, void *value, int col)
copy_and_convert_field_bindinfo(StatementClass *stmt, Int4 field_type, void *value, int col)
{
BindInfoClass *bic = &(stmt->bindings[col]);
......@@ -164,8 +164,8 @@ copy_and_convert_field_bindinfo(StatementClass * stmt, Int4 field_type, void *va
/* This is called by SQLGetData() */
int
copy_and_convert_field(StatementClass * stmt, Int4 field_type, void *value, Int2 fCType,
PTR rgbValue, SDWORD cbValueMax, SDWORD * pcbValue)
copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 fCType,
PTR rgbValue, SDWORD cbValueMax, SDWORD *pcbValue)
{
Int4 len = 0,
copy_len = 0;
......@@ -672,7 +672,7 @@ copy_and_convert_field(StatementClass * stmt, Int4 field_type, void *value, Int2
This function no longer does any dynamic memory allocation!
*/
int
copy_statement_with_parameters(StatementClass * stmt)
copy_statement_with_parameters(StatementClass *stmt)
{
static char *func = "copy_statement_with_parameters";
unsigned int opos,
......@@ -1308,7 +1308,7 @@ convert_money(char *s)
/* This function parses a character string for date/time info and fills in SIMPLE_TIME */
/* It does not zero out SIMPLE_TIME in case it is desired to initialize it with a value */
char
parse_datetime(char *buf, SIMPLE_TIME * st)
parse_datetime(char *buf, SIMPLE_TIME *st)
{
int y,
m,
......@@ -1610,8 +1610,8 @@ decode(char *in, char *out)
mapped to PG_TYPE_LO someday, instead of PG_TYPE_TEXT as it is now.
*/
int
convert_lo(StatementClass * stmt, void *value, Int2 fCType, PTR rgbValue,
SDWORD cbValueMax, SDWORD * pcbValue)
convert_lo(StatementClass *stmt, void *value, Int2 fCType, PTR rgbValue,
SDWORD cbValueMax, SDWORD *pcbValue)
{
Oid oid;
int retval,
......
......@@ -28,16 +28,16 @@ typedef struct
int hh;
int mm;
int ss;
} SIMPLE_TIME;
} 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,
PTR rgbValue, SDWORD cbValueMax, SDWORD * pcbValue);
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,
PTR rgbValue, SDWORD cbValueMax, SDWORD *pcbValue);
int copy_statement_with_parameters(StatementClass * stmt);
int copy_statement_with_parameters(StatementClass *stmt);
char *convert_escape(char *value);
char *convert_money(char *s);
char parse_datetime(char *buf, SIMPLE_TIME * st);
char parse_datetime(char *buf, SIMPLE_TIME *st);
int convert_linefeeds(char *s, char *dst, size_t max);
char *convert_special_chars(char *si, char *dst, int used);
......@@ -46,7 +46,7 @@ int convert_from_pgbinary(unsigned char *value, unsigned char *rgbValue, int c
int convert_to_pgbinary(unsigned char *in, char *out, int len);
void encode(char *in, char *out);
void decode(char *in, char *out);
int convert_lo(StatementClass * stmt, void *value, Int2 fCType, PTR rgbValue,
SDWORD cbValueMax, SDWORD * pcbValue);
int convert_lo(StatementClass *stmt, void *value, Int2 fCType, PTR rgbValue,
SDWORD cbValueMax, SDWORD *pcbValue);
#endif
......@@ -47,7 +47,7 @@ extern GLOBAL_VALUES globals;
#ifdef WIN32
void
SetDlgStuff(HWND hdlg, ConnInfo * ci)
SetDlgStuff(HWND hdlg, ConnInfo *ci)
{
/*
......@@ -68,7 +68,7 @@ SetDlgStuff(HWND hdlg, ConnInfo * ci)
}
void
GetDlgStuff(HWND hdlg, ConnInfo * ci)
GetDlgStuff(HWND hdlg, ConnInfo *ci)
{
GetDlgItemText(hdlg, IDC_DESC, ci->desc, sizeof(ci->desc));
......@@ -318,7 +318,7 @@ ds_optionsProc(HWND hdlg,
#endif /* WIN32 */
void
makeConnectString(char *connect_string, ConnInfo * ci)
makeConnectString(char *connect_string, ConnInfo *ci)
{
char got_dsn = (ci->dsn[0] != '\0');
char encoded_conn_settings[LARGE_REGISTRY_LEN];
......@@ -348,7 +348,7 @@ makeConnectString(char *connect_string, ConnInfo * ci)
}
void
copyAttributes(ConnInfo * ci, char *attribute, char *value)
copyAttributes(ConnInfo *ci, char *attribute, char *value)
{
if (stricmp(attribute, "DSN") == 0)
strcpy(ci->dsn, value);
......@@ -399,7 +399,7 @@ copyAttributes(ConnInfo * ci, char *attribute, char *value)
}
void
getDSNdefaults(ConnInfo * ci)
getDSNdefaults(ConnInfo *ci)
{
if (ci->port[0] == '\0')
strcpy(ci->port, DEFAULT_PORT);
......@@ -425,7 +425,7 @@ getDSNdefaults(ConnInfo * ci)
void
getDSNinfo(ConnInfo * ci, char overwrite)
getDSNinfo(ConnInfo *ci, char overwrite)
{
char *DSN = ci->dsn;
char encoded_conn_settings[LARGE_REGISTRY_LEN];
......@@ -522,7 +522,7 @@ getDSNinfo(ConnInfo * ci, char overwrite)
/* This is for datasource based options only */
void
writeDSNinfo(ConnInfo * ci)
writeDSNinfo(ConnInfo *ci)
{
char *DSN = ci->dsn;
char encoded_conn_settings[LARGE_REGISTRY_LEN];
......
......@@ -127,8 +127,8 @@
void getGlobalDefaults(char *section, char *filename, char override);
#ifdef WIN32
void SetDlgStuff(HWND hdlg, ConnInfo * ci);
void GetDlgStuff(HWND hdlg, ConnInfo * ci);
void SetDlgStuff(HWND hdlg, ConnInfo *ci);
void GetDlgStuff(HWND hdlg, ConnInfo *ci);
int CALLBACK driver_optionsProc(HWND hdlg,
WORD wMsg,
......@@ -142,11 +142,11 @@ int CALLBACK ds_optionsProc(HWND hdlg,
#endif /* WIN32 */
void updateGlobals(void);
void writeDSNinfo(ConnInfo * ci);
void getDSNdefaults(ConnInfo * ci);
void getDSNinfo(ConnInfo * ci, char overwrite);
void makeConnectString(char *connect_string, ConnInfo * ci);
void copyAttributes(ConnInfo * ci, char *attribute, char *value);
void writeDSNinfo(ConnInfo *ci);
void getDSNdefaults(ConnInfo *ci);
void getDSNinfo(ConnInfo *ci, char overwrite);
void makeConnectString(char *connect_string, ConnInfo *ci);
void copyAttributes(ConnInfo *ci, char *attribute, char *value);
#endif
......@@ -52,11 +52,11 @@
#include "dlg_specific.h"
/* prototypes */
void dconn_get_connect_attributes(UCHAR FAR * connect_string, ConnInfo * ci);
void dconn_get_connect_attributes(UCHAR FAR *connect_string, ConnInfo *ci);
#ifdef WIN32
BOOL FAR PASCAL dconn_FDriverConnectProc(HWND hdlg, UINT wMsg, WPARAM wParam, LPARAM lParam);
RETCODE dconn_DoDialog(HWND hwnd, ConnInfo * ci);
RETCODE dconn_DoDialog(HWND hwnd, ConnInfo *ci);
extern HINSTANCE NEAR s_hModule;/* Saved module handle. */
......@@ -69,11 +69,11 @@ RETCODE SQL_API
SQLDriverConnect(
HDBC hdbc,
HWND hwnd,
UCHAR FAR * szConnStrIn,
UCHAR FAR *szConnStrIn,
SWORD cbConnStrIn,
UCHAR FAR * szConnStrOut,
UCHAR FAR *szConnStrOut,
SWORD cbConnStrOutMax,
SWORD FAR * pcbConnStrOut,
SWORD FAR *pcbConnStrOut,
UWORD fDriverCompletion)
{
static char *func = "SQLDriverConnect";
......@@ -248,7 +248,7 @@ dialog:
#ifdef WIN32
RETCODE
dconn_DoDialog(HWND hwnd, ConnInfo * ci)
dconn_DoDialog(HWND hwnd, ConnInfo *ci)
{
int dialog_result;
......@@ -350,7 +350,7 @@ dconn_FDriverConnectProc(
#endif /* WIN32 */
void
dconn_get_connect_attributes(UCHAR FAR * connect_string, ConnInfo * ci)
dconn_get_connect_attributes(UCHAR FAR *connect_string, ConnInfo *ci)
{
char *our_connect_string;
char *pair,
......
......@@ -23,7 +23,7 @@ ConnectionClass *conns[MAX_CONNECTIONS];
RETCODE SQL_API
SQLAllocEnv(HENV FAR * phenv)
SQLAllocEnv(HENV FAR *phenv)
{
static char *func = "SQLAllocEnv";
......@@ -67,11 +67,11 @@ SQLError(
HENV henv,
HDBC hdbc,
HSTMT hstmt,
UCHAR FAR * szSqlState,
SDWORD FAR * pfNativeError,
UCHAR FAR * szErrorMsg,
UCHAR FAR *szSqlState,
SDWORD FAR *pfNativeError,
UCHAR FAR *szErrorMsg,
SWORD cbErrorMsgMax,
SWORD FAR * pcbErrorMsg)
SWORD FAR *pcbErrorMsg)
{
char *msg;
int status;
......@@ -410,7 +410,8 @@ SQLError(
EnvironmentClass
* EN_Constructor(void)
*
EN_Constructor(void)
{
EnvironmentClass *rv;
......@@ -426,7 +427,7 @@ EnvironmentClass
char
EN_Destructor(EnvironmentClass * self)
EN_Destructor(EnvironmentClass *self)
{
int lf;
char rv = 1;
......@@ -448,7 +449,7 @@ EN_Destructor(EnvironmentClass * self)
}
char
EN_get_error(EnvironmentClass * self, int *number, char **message)
EN_get_error(EnvironmentClass *self, int *number, char **message)
{
if (self && self->errormsg && self->errornumber)
{
......@@ -463,7 +464,7 @@ EN_get_error(EnvironmentClass * self, int *number, char **message)
}
char
EN_add_connection(EnvironmentClass * self, ConnectionClass * conn)
EN_add_connection(EnvironmentClass *self, ConnectionClass *conn)
{
int i;
......@@ -486,7 +487,7 @@ EN_add_connection(EnvironmentClass * self, ConnectionClass * conn)
}
char
EN_remove_connection(EnvironmentClass * self, ConnectionClass * conn)
EN_remove_connection(EnvironmentClass *self, ConnectionClass *conn)
{
int i;
......@@ -501,7 +502,7 @@ EN_remove_connection(EnvironmentClass * self, ConnectionClass * conn)
}
void
EN_log_error(char *func, char *desc, EnvironmentClass * self)
EN_log_error(char *func, char *desc, EnvironmentClass *self)
{
if (self)
qlog("ENVIRON ERROR: func=%s, desc='%s', errnum=%d, errmsg='%s'\n", func, desc, self->errornumber, self->errormsg);
......
......@@ -37,10 +37,10 @@ struct EnvironmentClass_
/* Environment prototypes */
EnvironmentClass *EN_Constructor(void);
char EN_Destructor(EnvironmentClass * self);
char EN_get_error(EnvironmentClass * self, int *number, char **message);
char EN_add_connection(EnvironmentClass * self, ConnectionClass * conn);
char EN_remove_connection(EnvironmentClass * self, ConnectionClass * conn);
void EN_log_error(char *func, char *desc, EnvironmentClass * self);
char EN_Destructor(EnvironmentClass *self);
char EN_get_error(EnvironmentClass *self, int *number, char **message);
char EN_add_connection(EnvironmentClass *self, ConnectionClass *conn);
char EN_remove_connection(EnvironmentClass *self, ConnectionClass *conn);
void EN_log_error(char *func, char *desc, EnvironmentClass *self);
#endif
......@@ -41,7 +41,7 @@ extern GLOBAL_VALUES globals;
/* Perform a Prepare on the SQL statement */
RETCODE SQL_API
SQLPrepare(HSTMT hstmt,
UCHAR FAR * szSqlStr,
UCHAR FAR *szSqlStr,
SDWORD cbSqlStr)
{
static char *func = "SQLPrepare";
......@@ -136,7 +136,7 @@ SQLPrepare(HSTMT hstmt,
RETCODE SQL_API
SQLExecDirect(
HSTMT hstmt,
UCHAR FAR * szSqlStr,
UCHAR FAR *szSqlStr,
SDWORD cbSqlStr)
{
StatementClass *stmt = (StatementClass *) hstmt;
......@@ -489,11 +489,11 @@ SQLCancel(
RETCODE SQL_API
SQLNativeSql(
HDBC hdbc,
UCHAR FAR * szSqlStrIn,
UCHAR FAR *szSqlStrIn,
SDWORD cbSqlStrIn,
UCHAR FAR * szSqlStr,
UCHAR FAR *szSqlStr,
SDWORD cbSqlStrMax,
SDWORD FAR * pcbSqlStr)
SDWORD FAR *pcbSqlStr)
{
static char *func = "SQLNativeSql";
int len = 0;
......@@ -543,7 +543,7 @@ SQLNativeSql(
RETCODE SQL_API
SQLParamData(
HSTMT hstmt,
PTR FAR * prgbValue)
PTR FAR *prgbValue)
{
static char *func = "SQLParamData";
StatementClass *stmt = (StatementClass *) hstmt;
......
......@@ -18,23 +18,23 @@ extern "C"
#endif
DWORD
GetPrivateProfileString(char *theSection, /* section name */
char *theKey, /* search key name */
char *theDefault, /* default value if not
* found */
char *theReturnBuffer, /* return valuse stored
* here */
size_t theBufferLength, /* byte length of return
* buffer */
char *theIniFileName); /* pathname of ini file
* to search */
GetPrivateProfileString(char *theSection, /* section name */
char *theKey, /* search key name */
char *theDefault, /* default value if not
* found */
char *theReturnBuffer, /* return valuse stored
* here */
size_t theBufferLength, /* byte length of return
* buffer */
char *theIniFileName); /* pathname of ini file
* to search */
DWORD
WritePrivateProfileString(char *theSection, /* section name */
char *theKey, /* write key name */
char *theBuffer, /* input buffer */
char *theIniFileName); /* pathname of ini file
* to write */
WritePrivateProfileString(char *theSection, /* section name */
char *theKey, /* write key name */
char *theBuffer, /* input buffer */
char *theIniFileName); /* pathname of ini file
* to write */
#ifdef __cplusplus
}
......
......@@ -64,7 +64,7 @@ SQLGetInfo(
UWORD fInfoType,
PTR rgbInfoValue,
SWORD cbInfoValueMax,
SWORD FAR * pcbInfoValue)
SWORD FAR *pcbInfoValue)
{
static char *func = "SQLGetInfo";
ConnectionClass *conn = (ConnectionClass *) hdbc;
......@@ -769,7 +769,7 @@ SQLGetTypeInfo(
if (fSqlType == SQL_ALL_TYPES || fSqlType == sqlType)
{
row = (TupleNode *) malloc(sizeof(TupleNode) + (15 - 1) * sizeof(TupleField));
row = (TupleNode *) malloc(sizeof(TupleNode) + (15 - 1) *sizeof(TupleField));
/* These values can't be NULL */
set_tuplefield_string(&row->tuple[0], pgtype_to_name(stmt, pgType));
......@@ -814,7 +814,7 @@ RETCODE SQL_API
SQLGetFunctions(
HDBC hdbc,
UWORD fFunction,
UWORD FAR * pfExists)
UWORD FAR *pfExists)
{
static char *func = "SQLGetFunctions";
......@@ -1097,13 +1097,13 @@ SQLGetFunctions(
RETCODE SQL_API
SQLTables(
HSTMT hstmt,
UCHAR FAR * szTableQualifier,
UCHAR FAR *szTableQualifier,
SWORD cbTableQualifier,
UCHAR FAR * szTableOwner,
UCHAR FAR *szTableOwner,
SWORD cbTableOwner,
UCHAR FAR * szTableName,
UCHAR FAR *szTableName,
SWORD cbTableName,
UCHAR FAR * szTableType,
UCHAR FAR *szTableType,
SWORD cbTableType)
{
static char *func = "SQLTables";
......@@ -1372,7 +1372,7 @@ SQLTables(
(view && show_views) ||
(regular_table && show_regular_tables))
{
row = (TupleNode *) malloc(sizeof(TupleNode) + (5 - 1) * sizeof(TupleField));
row = (TupleNode *) malloc(sizeof(TupleNode) + (5 - 1) *sizeof(TupleField));
set_tuplefield_string(&row->tuple[0], "");
......@@ -1422,13 +1422,13 @@ SQLTables(
RETCODE SQL_API
SQLColumns(
HSTMT hstmt,
UCHAR FAR * szTableQualifier,
UCHAR FAR *szTableQualifier,
SWORD cbTableQualifier,
UCHAR FAR * szTableOwner,
UCHAR FAR *szTableOwner,
SWORD cbTableOwner,
UCHAR FAR * szTableName,
UCHAR FAR *szTableName,
SWORD cbTableName,
UCHAR FAR * szColumnName,
UCHAR FAR *szColumnName,
SWORD cbColumnName)
{
static char *func = "SQLColumns";
......@@ -1684,7 +1684,7 @@ SQLColumns(
/* For OID fields */
the_type = PG_TYPE_OID;
row = (TupleNode *) malloc(sizeof(TupleNode) +
(result_cols - 1) * sizeof(TupleField));
(result_cols - 1) *sizeof(TupleField));
set_tuplefield_string(&row->tuple[0], "");
/* see note in SQLTables() */
......@@ -1713,7 +1713,7 @@ SQLColumns(
while ((result == SQL_SUCCESS) || (result == SQL_SUCCESS_WITH_INFO))
{
row = (TupleNode *) malloc(sizeof(TupleNode) +
(result_cols - 1) * sizeof(TupleField));
(result_cols - 1) *sizeof(TupleField));
set_tuplefield_string(&row->tuple[0], "");
......@@ -1821,7 +1821,7 @@ SQLColumns(
the_type = PG_TYPE_INT4;
row = (TupleNode *) malloc(sizeof(TupleNode) +
(result_cols - 1) * sizeof(TupleField));
(result_cols - 1) *sizeof(TupleField));
set_tuplefield_string(&row->tuple[0], "");
set_tuplefield_string(&row->tuple[1], "");
......@@ -1859,11 +1859,11 @@ RETCODE SQL_API
SQLSpecialColumns(
HSTMT hstmt,
UWORD fColType,
UCHAR FAR * szTableQualifier,
UCHAR FAR *szTableQualifier,
SWORD cbTableQualifier,
UCHAR FAR * szTableOwner,
UCHAR FAR *szTableOwner,
SWORD cbTableOwner,
UCHAR FAR * szTableName,
UCHAR FAR *szTableName,
SWORD cbTableName,
UWORD fScope,
UWORD fNullable)
......@@ -1958,7 +1958,7 @@ SQLSpecialColumns(
/* use the oid value for the rowid */
if (fColType == SQL_BEST_ROWID)
{
row = (TupleNode *) malloc(sizeof(TupleNode) + (8 - 1) * sizeof(TupleField));
row = (TupleNode *) malloc(sizeof(TupleNode) + (8 - 1) *sizeof(TupleField));
set_tuplefield_int2(&row->tuple[0], SQL_SCOPE_SESSION);
set_tuplefield_string(&row->tuple[1], "oid");
......@@ -1977,7 +1977,7 @@ SQLSpecialColumns(
if (atoi(ci->row_versioning))
{
row = (TupleNode *) malloc(sizeof(TupleNode) + (8 - 1) * sizeof(TupleField));
row = (TupleNode *) malloc(sizeof(TupleNode) + (8 - 1) *sizeof(TupleField));
set_tuplefield_null(&row->tuple[0]);
set_tuplefield_string(&row->tuple[1], "xmin");
......@@ -2007,11 +2007,11 @@ SQLSpecialColumns(
RETCODE SQL_API
SQLStatistics(
HSTMT hstmt,
UCHAR FAR * szTableQualifier,
UCHAR FAR *szTableQualifier,
SWORD cbTableQualifier,
UCHAR FAR * szTableOwner,
UCHAR FAR *szTableOwner,
SWORD cbTableOwner,
UCHAR FAR * szTableName,
UCHAR FAR *szTableName,
SWORD cbTableName,
UWORD fUnique,
UWORD fAccuracy)
......@@ -2255,7 +2255,7 @@ SQLStatistics(
if (relhasrules[0] != '1' && atoi(ci->show_oid_column) && atoi(ci->fake_oid_index))
{
row = (TupleNode *) malloc(sizeof(TupleNode) +
(13 - 1) * sizeof(TupleField));
(13 - 1) *sizeof(TupleField));
/* no table qualifier */
set_tuplefield_string(&row->tuple[0], "");
......@@ -2300,7 +2300,7 @@ SQLStatistics(
while (i < 8 && fields_vector[i] != 0)
{
row = (TupleNode *) malloc(sizeof(TupleNode) +
(13 - 1) * sizeof(TupleField));
(13 - 1) *sizeof(TupleField));
/* no table qualifier */
set_tuplefield_string(&row->tuple[0], "");
......@@ -2396,13 +2396,13 @@ SEEYA:
RETCODE SQL_API
SQLColumnPrivileges(
HSTMT hstmt,
UCHAR FAR * szTableQualifier,
UCHAR FAR *szTableQualifier,
SWORD cbTableQualifier,
UCHAR FAR * szTableOwner,
UCHAR FAR *szTableOwner,
SWORD cbTableOwner,
UCHAR FAR * szTableName,
UCHAR FAR *szTableName,
SWORD cbTableName,
UCHAR FAR * szColumnName,
UCHAR FAR *szColumnName,
SWORD cbColumnName)
{
static char *func = "SQLColumnPrivileges";
......@@ -2422,11 +2422,11 @@ SQLColumnPrivileges(
RETCODE SQL_API
SQLPrimaryKeys(
HSTMT hstmt,
UCHAR FAR * szTableQualifier,
UCHAR FAR *szTableQualifier,
SWORD cbTableQualifier,
UCHAR FAR * szTableOwner,
UCHAR FAR *szTableOwner,
SWORD cbTableOwner,
UCHAR FAR * szTableName,
UCHAR FAR *szTableName,
SWORD cbTableName)
{
static char *func = "SQLPrimaryKeys";
......@@ -2547,7 +2547,7 @@ SQLPrimaryKeys(
while ((result == SQL_SUCCESS) || (result == SQL_SUCCESS_WITH_INFO))
{
row = (TupleNode *) malloc(sizeof(TupleNode) + (result_cols - 1) * sizeof(TupleField));
row = (TupleNode *) malloc(sizeof(TupleNode) + (result_cols - 1) *sizeof(TupleField));
set_tuplefield_null(&row->tuple[0]);
......@@ -2598,17 +2598,17 @@ SQLPrimaryKeys(
RETCODE SQL_API
SQLForeignKeys(
HSTMT hstmt,
UCHAR FAR * szPkTableQualifier,
UCHAR FAR *szPkTableQualifier,
SWORD cbPkTableQualifier,
UCHAR FAR * szPkTableOwner,
UCHAR FAR *szPkTableOwner,
SWORD cbPkTableOwner,
UCHAR FAR * szPkTableName,
UCHAR FAR *szPkTableName,
SWORD cbPkTableName,
UCHAR FAR * szFkTableQualifier,
UCHAR FAR *szFkTableQualifier,
SWORD cbFkTableQualifier,
UCHAR FAR * szFkTableOwner,
UCHAR FAR *szFkTableOwner,
SWORD cbFkTableOwner,
UCHAR FAR * szFkTableName,
UCHAR FAR *szFkTableName,
SWORD cbFkTableName)
{
static char *func = "SQLForeignKeys";
......@@ -2974,7 +2974,7 @@ SQLForeignKeys(
for (k = 0; k < num_keys; k++)
{
row = (TupleNode *) malloc(sizeof(TupleNode) + (result_cols - 1) * sizeof(TupleField));
row = (TupleNode *) malloc(sizeof(TupleNode) + (result_cols - 1) *sizeof(TupleField));
mylog("%s: pk_table = '%s', pkey_ptr = '%s'\n", func, pk_table, pkey_ptr);
set_tuplefield_null(&row->tuple[0]);
......@@ -3199,7 +3199,7 @@ SQLForeignKeys(
{
mylog("pkey_ptr = '%s', fk_table = '%s', fkey_ptr = '%s'\n", pkey_ptr, fk_table, fkey_ptr);
row = (TupleNode *) malloc(sizeof(TupleNode) + (result_cols - 1) * sizeof(TupleField));
row = (TupleNode *) malloc(sizeof(TupleNode) + (result_cols - 1) *sizeof(TupleField));
mylog("pk_table_needed = '%s', pkey_ptr = '%s'\n", pk_table_needed, pkey_ptr);
set_tuplefield_null(&row->tuple[0]);
......@@ -3262,13 +3262,13 @@ SQLForeignKeys(
RETCODE SQL_API
SQLProcedureColumns(
HSTMT hstmt,
UCHAR FAR * szProcQualifier,
UCHAR FAR *szProcQualifier,
SWORD cbProcQualifier,
UCHAR FAR * szProcOwner,
UCHAR FAR *szProcOwner,
SWORD cbProcOwner,
UCHAR FAR * szProcName,
UCHAR FAR *szProcName,
SWORD cbProcName,
UCHAR FAR * szColumnName,
UCHAR FAR *szColumnName,
SWORD cbColumnName)
{
static char *func = "SQLProcedureColumns";
......@@ -3282,11 +3282,11 @@ SQLProcedureColumns(
RETCODE SQL_API
SQLProcedures(
HSTMT hstmt,
UCHAR FAR * szProcQualifier,
UCHAR FAR *szProcQualifier,
SWORD cbProcQualifier,
UCHAR FAR * szProcOwner,
UCHAR FAR *szProcOwner,
SWORD cbProcOwner,
UCHAR FAR * szProcName,
UCHAR FAR *szProcName,
SWORD cbProcName)
{
static char *func = "SQLProcedures";
......@@ -3300,11 +3300,11 @@ SQLProcedures(
RETCODE SQL_API
SQLTablePrivileges(
HSTMT hstmt,
UCHAR FAR * szTableQualifier,
UCHAR FAR *szTableQualifier,
SWORD cbTableQualifier,
UCHAR FAR * szTableOwner,
UCHAR FAR *szTableOwner,
SWORD cbTableOwner,
UCHAR FAR * szTableName,
UCHAR FAR *szTableName,
SWORD cbTableName)
{
static char *func = "SQLTablePrivileges";
......
......@@ -134,16 +134,16 @@ extern "C"
#endif
RETCODE SQL_API SQLAllocConnect(HENV henv,
HDBC FAR * phdbc);
RETCODE SQL_API SQLAllocEnv(HENV FAR * phenv);
HDBC FAR *phdbc);
RETCODE SQL_API SQLAllocEnv(HENV FAR *phenv);
RETCODE SQL_API SQLAllocStmt(HDBC hdbc,
HSTMT FAR * phstmt);
HSTMT FAR *phstmt);
RETCODE SQL_API SQLBindCol(HSTMT hstmt,
UWORD icol,
SWORD fCType,
PTR rgbValue,
SDWORD cbValueMax,
SDWORD FAR * pcbValue);
SDWORD FAR *pcbValue);
RETCODE SQL_API SQLCancel(HSTMT hstmt);
......@@ -152,40 +152,40 @@ extern "C"
UWORD fDescType,
PTR rgbDesc,
SWORD cbDescMax,
SWORD FAR * pcbDesc,
SDWORD FAR * pfDesc);
SWORD FAR *pcbDesc,
SDWORD FAR *pfDesc);
RETCODE SQL_API SQLConnect(HDBC hdbc,
UCHAR FAR * szDSN,
UCHAR FAR *szDSN,
SWORD cbDSN,
UCHAR FAR * szUID,
UCHAR FAR *szUID,
SWORD cbUID,
UCHAR FAR * szAuthStr,
UCHAR FAR *szAuthStr,
SWORD cbAuthStr);
RETCODE SQL_API SQLDescribeCol(HSTMT hstmt,
UWORD icol,
UCHAR FAR * szColName,
UCHAR FAR *szColName,
SWORD cbColNameMax,
SWORD FAR * pcbColName,
SWORD FAR * pfSqlType,
UDWORD FAR * pcbColDef,
SWORD FAR * pibScale,
SWORD FAR * pfNullable);
SWORD FAR *pcbColName,
SWORD FAR *pfSqlType,
UDWORD FAR *pcbColDef,
SWORD FAR *pibScale,
SWORD FAR *pfNullable);
RETCODE SQL_API SQLDisconnect(HDBC hdbc);
RETCODE SQL_API SQLError(HENV henv,
HDBC hdbc,
HSTMT hstmt,
UCHAR FAR * szSqlState,
SDWORD FAR * pfNativeError,
UCHAR FAR * szErrorMsg,
UCHAR FAR *szSqlState,
SDWORD FAR *pfNativeError,
UCHAR FAR *szErrorMsg,
SWORD cbErrorMsgMax,
SWORD FAR * pcbErrorMsg);
SWORD FAR *pcbErrorMsg);
RETCODE SQL_API SQLExecDirect(HSTMT hstmt,
UCHAR FAR * szSqlStr,
UCHAR FAR *szSqlStr,
SDWORD cbSqlStr);
RETCODE SQL_API SQLExecute(HSTMT hstmt);
......@@ -200,18 +200,18 @@ extern "C"
UWORD fOption);
RETCODE SQL_API SQLGetCursorName(HSTMT hstmt,
UCHAR FAR * szCursor,
UCHAR FAR *szCursor,
SWORD cbCursorMax,
SWORD FAR * pcbCursor);
SWORD FAR *pcbCursor);
RETCODE SQL_API SQLNumResultCols(HSTMT hstmt, SWORD FAR * pccol);
RETCODE SQL_API SQLNumResultCols(HSTMT hstmt, SWORD FAR *pccol);
RETCODE SQL_API SQLPrepare(HSTMT hstmt, UCHAR FAR * szSqlStr,
RETCODE SQL_API SQLPrepare(HSTMT hstmt, UCHAR FAR *szSqlStr,
SDWORD cbSqlStr);
RETCODE SQL_API SQLRowCount(HSTMT hstmt, SDWORD FAR * pcrow);
RETCODE SQL_API SQLRowCount(HSTMT hstmt, SDWORD FAR *pcrow);
RETCODE SQL_API SQLSetCursorName(HSTMT hstmt, UCHAR FAR * szCursor,
RETCODE SQL_API SQLSetCursorName(HSTMT hstmt, UCHAR FAR *szCursor,
SWORD cbCursor);
RETCODE SQL_API SQLTransact(HENV henv, HDBC hdbc,
......@@ -223,7 +223,7 @@ extern "C"
UDWORD cbColDef,
SWORD ibScale,
PTR rgbValue,
SDWORD FAR * pcbValue);
SDWORD FAR *pcbValue);
#ifdef __cplusplus
}
......
This diff is collapsed.
......@@ -16,7 +16,7 @@
#include "connection.h"
Oid
lo_creat(ConnectionClass * conn, int mode)
lo_creat(ConnectionClass *conn, int mode)
{
LO_ARG argv[1];
int retval,
......@@ -35,7 +35,7 @@ lo_creat(ConnectionClass * conn, int mode)
}
int
lo_open(ConnectionClass * conn, int lobjId, int mode)
lo_open(ConnectionClass *conn, int lobjId, int mode)
{
int fd;
int result_len;
......@@ -60,7 +60,7 @@ lo_open(ConnectionClass * conn, int lobjId, int mode)
}
int
lo_close(ConnectionClass * conn, int fd)
lo_close(ConnectionClass *conn, int fd)
{
LO_ARG argv[1];
int retval,
......@@ -80,7 +80,7 @@ lo_close(ConnectionClass * conn, int fd)
int
lo_read(ConnectionClass * conn, int fd, char *buf, int len)
lo_read(ConnectionClass *conn, int fd, char *buf, int len)
{
LO_ARG argv[2];
int result_len;
......@@ -102,7 +102,7 @@ lo_read(ConnectionClass * conn, int fd, char *buf, int len)
}
int
lo_write(ConnectionClass * conn, int fd, char *buf, int len)
lo_write(ConnectionClass *conn, int fd, char *buf, int len)
{
LO_ARG argv[2];
int retval,
......@@ -128,7 +128,7 @@ lo_write(ConnectionClass * conn, int fd, char *buf, int len)
}
int
lo_lseek(ConnectionClass * conn, int fd, int offset, int whence)
lo_lseek(ConnectionClass *conn, int fd, int offset, int whence)
{
LO_ARG argv[3];
int retval,
......@@ -155,7 +155,7 @@ lo_lseek(ConnectionClass * conn, int fd, int offset, int whence)
}
int
lo_tell(ConnectionClass * conn, int fd)
lo_tell(ConnectionClass *conn, int fd)
{
LO_ARG argv[1];
int retval,
......@@ -174,7 +174,7 @@ lo_tell(ConnectionClass * conn, int fd)
}
int
lo_unlink(ConnectionClass * conn, Oid lobjId)
lo_unlink(ConnectionClass *conn, Oid lobjId)
{
LO_ARG argv[1];
int retval,
......
......@@ -36,13 +36,13 @@ struct lo_arg
#define INV_WRITE 0x00020000
#define INV_READ 0x00040000
Oid lo_creat(ConnectionClass * conn, int mode);
int lo_open(ConnectionClass * conn, int lobjId, int mode);
int lo_close(ConnectionClass * conn, int fd);
int lo_read(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_tell(ConnectionClass * conn, int fd);
int lo_unlink(ConnectionClass * conn, Oid lobjId);
Oid lo_creat(ConnectionClass *conn, int mode);
int lo_open(ConnectionClass *conn, int lobjId, int mode);
int lo_close(ConnectionClass *conn, int fd);
int lo_read(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_tell(ConnectionClass *conn, int fd);
int lo_unlink(ConnectionClass *conn, Oid lobjId);
#endif
......@@ -37,16 +37,16 @@
extern GLOBAL_VALUES globals;
RETCODE set_statement_option(ConnectionClass * conn,
StatementClass * stmt,
RETCODE set_statement_option(ConnectionClass *conn,
StatementClass *stmt,
UWORD fOption,
UDWORD vParam);
RETCODE
set_statement_option(ConnectionClass * conn,
StatementClass * stmt,
set_statement_option(ConnectionClass *conn,
StatementClass *stmt,
UWORD fOption,
UDWORD vParam)
{
......
......@@ -38,8 +38,8 @@
#define COL_INCR 16
char *getNextToken(char *s, char *token, int smax, char *delim, char *quote, char *dquote, char *numeric);
void getColInfo(COL_INFO * col_info, FIELD_INFO * fi, int k);
char searchColInfo(COL_INFO * col_info, FIELD_INFO * fi);
void getColInfo(COL_INFO *col_info, FIELD_INFO *fi, int k);
char searchColInfo(COL_INFO *col_info, FIELD_INFO *fi);
char *
getNextToken(char *s, char *token, int smax, char *delim, char *quote, char *dquote, char *numeric)
......@@ -196,7 +196,7 @@ QR_set_field_info(stmt->result, 13, "FIELD_TYPE", PG_TYPE_INT4, 4);
#endif
void
getColInfo(COL_INFO * col_info, FIELD_INFO * fi, int k)
getColInfo(COL_INFO *col_info, FIELD_INFO *fi, int k)
{
if (fi->name[0] == '\0')
strcpy(fi->name, QR_get_value_manual(col_info->result, k, 3));
......@@ -209,7 +209,7 @@ getColInfo(COL_INFO * col_info, FIELD_INFO * fi, int k)
}
char
searchColInfo(COL_INFO * col_info, FIELD_INFO * fi)
searchColInfo(COL_INFO *col_info, FIELD_INFO *fi)
{
int k;
char *col;
......@@ -232,7 +232,7 @@ searchColInfo(COL_INFO * col_info, FIELD_INFO * fi)
char
parse_statement(StatementClass * stmt)
parse_statement(StatementClass *stmt)
{
static char *func = "parse_statement";
char token[256];
......
......@@ -38,7 +38,7 @@
extern GLOBAL_VALUES globals;
Int4 getCharPrecision(StatementClass * stmt, Int4 type, int col, int handle_unknown_size_as);
Int4 getCharPrecision(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as);
/* these are the types we support. all of the pgtype_ functions should */
......@@ -194,7 +194,7 @@ sqltype_to_pgtype(SWORD fSqlType)
types that are unknown. All other pg routines in here return a suitable default.
*/
Int2
pgtype_to_sqltype(StatementClass * stmt, Int4 type)
pgtype_to_sqltype(StatementClass *stmt, Int4 type)
{
switch (type)
{
......@@ -267,7 +267,7 @@ pgtype_to_sqltype(StatementClass * stmt, Int4 type)
}
Int2
pgtype_to_ctype(StatementClass * stmt, Int4 type)
pgtype_to_ctype(StatementClass *stmt, Int4 type)
{
switch (type)
{
......@@ -314,7 +314,7 @@ pgtype_to_ctype(StatementClass * stmt, Int4 type)
}
char *
pgtype_to_name(StatementClass * stmt, Int4 type)
pgtype_to_name(StatementClass *stmt, Int4 type)
{
switch (type)
{
......@@ -381,7 +381,7 @@ pgtype_to_name(StatementClass * stmt, Int4 type)
}
static Int2
getNumericScale(StatementClass * stmt, Int4 type, int col)
getNumericScale(StatementClass *stmt, Int4 type, int col)
{
Int4 atttypmod;
QResultClass *result;
......@@ -417,7 +417,7 @@ getNumericScale(StatementClass * stmt, Int4 type, int col)
}
static Int4
getNumericPrecision(StatementClass * stmt, Int4 type, int col)
getNumericPrecision(StatementClass *stmt, Int4 type, int col)
{
Int4 atttypmod;
QResultClass *result;
......@@ -453,7 +453,7 @@ getNumericPrecision(StatementClass * stmt, Int4 type, int col)
}
Int4
getCharPrecision(StatementClass * stmt, Int4 type, int col, int handle_unknown_size_as)
getCharPrecision(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as)
{
int p = -1,
maxsize;
......@@ -530,7 +530,7 @@ getCharPrecision(StatementClass * stmt, Int4 type, int col, int handle_unknown_s
This is used for functions SQLDescribeCol and SQLColAttributes.
*/
Int4
pgtype_precision(StatementClass * stmt, Int4 type, int col, int handle_unknown_size_as)
pgtype_precision(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as)
{
switch (type)
{
......@@ -595,7 +595,7 @@ pgtype_precision(StatementClass * stmt, Int4 type, int col, int handle_unknown_s
}
Int4
pgtype_display_size(StatementClass * stmt, Int4 type, int col, int handle_unknown_size_as)
pgtype_display_size(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as)
{
switch (type)
{
......@@ -634,7 +634,7 @@ pgtype_display_size(StatementClass * stmt, Int4 type, int col, int handle_unknow
override this length with the atttypmod length from pg_attribute
*/
Int4
pgtype_length(StatementClass * stmt, Int4 type, int col, int handle_unknown_size_as)
pgtype_length(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as)
{
switch (type)
{
......@@ -676,7 +676,7 @@ pgtype_length(StatementClass * stmt, Int4 type, int col, int handle_unknown_size
}
Int2
pgtype_scale(StatementClass * stmt, Int4 type, int col)
pgtype_scale(StatementClass *stmt, Int4 type, int col)
{
switch (type)
{
......@@ -709,7 +709,7 @@ pgtype_scale(StatementClass * stmt, Int4 type, int col)
Int2
pgtype_radix(StatementClass * stmt, Int4 type)
pgtype_radix(StatementClass *stmt, Int4 type)
{
switch (type)
{
......@@ -729,13 +729,13 @@ pgtype_radix(StatementClass * stmt, Int4 type)
}
Int2
pgtype_nullable(StatementClass * stmt, Int4 type)
pgtype_nullable(StatementClass *stmt, Int4 type)
{
return SQL_NULLABLE; /* everything should be nullable */
}
Int2
pgtype_auto_increment(StatementClass * stmt, Int4 type)
pgtype_auto_increment(StatementClass *stmt, Int4 type)
{
switch (type)
{
......@@ -763,7 +763,7 @@ pgtype_auto_increment(StatementClass * stmt, Int4 type)
}
Int2
pgtype_case_sensitive(StatementClass * stmt, Int4 type)
pgtype_case_sensitive(StatementClass *stmt, Int4 type)
{
switch (type)
{
......@@ -785,7 +785,7 @@ pgtype_case_sensitive(StatementClass * stmt, Int4 type)
}
Int2
pgtype_money(StatementClass * stmt, Int4 type)
pgtype_money(StatementClass *stmt, Int4 type)
{
switch (type)
{
......@@ -797,7 +797,7 @@ pgtype_money(StatementClass * stmt, Int4 type)
}
Int2
pgtype_searchable(StatementClass * stmt, Int4 type)
pgtype_searchable(StatementClass *stmt, Int4 type)
{
switch (type)
{
......@@ -818,7 +818,7 @@ pgtype_searchable(StatementClass * stmt, Int4 type)
}
Int2
pgtype_unsigned(StatementClass * stmt, Int4 type)
pgtype_unsigned(StatementClass *stmt, Int4 type)
{
switch (type)
{
......@@ -841,7 +841,7 @@ pgtype_unsigned(StatementClass * stmt, Int4 type)
}
char *
pgtype_literal_prefix(StatementClass * stmt, Int4 type)
pgtype_literal_prefix(StatementClass *stmt, Int4 type)
{
switch (type)
{
......@@ -861,7 +861,7 @@ pgtype_literal_prefix(StatementClass * stmt, Int4 type)
}
char *
pgtype_literal_suffix(StatementClass * stmt, Int4 type)
pgtype_literal_suffix(StatementClass *stmt, Int4 type)
{
switch (type)
{
......@@ -881,7 +881,7 @@ pgtype_literal_suffix(StatementClass * stmt, Int4 type)
}
char *
pgtype_create_params(StatementClass * stmt, Int4 type)
pgtype_create_params(StatementClass *stmt, Int4 type)
{
switch (type)
{
......
......@@ -71,26 +71,26 @@ extern Int2 sqlTypes[];
Int4 sqltype_to_pgtype(Int2 fSqlType);
Int2 pgtype_to_sqltype(StatementClass * stmt, Int4 type);
Int2 pgtype_to_ctype(StatementClass * stmt, Int4 type);
char *pgtype_to_name(StatementClass * stmt, Int4 type);
Int2 pgtype_to_sqltype(StatementClass *stmt, Int4 type);
Int2 pgtype_to_ctype(StatementClass *stmt, Int4 type);
char *pgtype_to_name(StatementClass *stmt, Int4 type);
/* These functions can use static numbers or result sets(col parameter) */
Int4 pgtype_precision(StatementClass * stmt, Int4 type, int col, int handle_unknown_size_as);
Int4 pgtype_display_size(StatementClass * stmt, Int4 type, int col, int handle_unknown_size_as);
Int4 pgtype_length(StatementClass * stmt, Int4 type, int col, int handle_unknown_size_as);
Int4 pgtype_precision(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as);
Int4 pgtype_display_size(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as);
Int4 pgtype_length(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as);
Int2 pgtype_scale(StatementClass * stmt, Int4 type, int col);
Int2 pgtype_radix(StatementClass * stmt, Int4 type);
Int2 pgtype_nullable(StatementClass * stmt, Int4 type);
Int2 pgtype_auto_increment(StatementClass * stmt, Int4 type);
Int2 pgtype_case_sensitive(StatementClass * stmt, Int4 type);
Int2 pgtype_money(StatementClass * stmt, Int4 type);
Int2 pgtype_searchable(StatementClass * stmt, Int4 type);
Int2 pgtype_unsigned(StatementClass * stmt, Int4 type);
char *pgtype_literal_prefix(StatementClass * stmt, Int4 type);
char *pgtype_literal_suffix(StatementClass * stmt, Int4 type);
char *pgtype_create_params(StatementClass * stmt, Int4 type);
Int2 pgtype_scale(StatementClass *stmt, Int4 type, int col);
Int2 pgtype_radix(StatementClass *stmt, Int4 type);
Int2 pgtype_nullable(StatementClass *stmt, Int4 type);
Int2 pgtype_auto_increment(StatementClass *stmt, Int4 type);
Int2 pgtype_case_sensitive(StatementClass *stmt, Int4 type);
Int2 pgtype_money(StatementClass *stmt, Int4 type);
Int2 pgtype_searchable(StatementClass *stmt, Int4 type);
Int2 pgtype_unsigned(StatementClass *stmt, Int4 type);
char *pgtype_literal_prefix(StatementClass *stmt, Int4 type);
char *pgtype_literal_suffix(StatementClass *stmt, Int4 type);
char *pgtype_create_params(StatementClass *stmt, Int4 type);
Int2 sqltype_to_default_ctype(Int2 sqltype);
......
......@@ -6,7 +6,7 @@
*
* Comments: See "notice.txt" for copyright and license information.
*
* $Id: psqlodbc.h,v 1.33 2001/02/11 02:01:22 momjian Exp $
* $Id: psqlodbc.h,v 1.34 2001/02/11 05:13:51 momjian Exp $
*/
#ifndef __PSQLODBC_H__
......@@ -147,7 +147,7 @@ typedef struct GlobalValues_
char protocol[SMALL_REGISTRY_LEN];
FILE *mylogFP;
FILE *qlogFP;
} GLOBAL_VALUES;
} GLOBAL_VALUES;
typedef struct StatementOptions_
{
......@@ -161,7 +161,7 @@ typedef struct StatementOptions_
int bind_size; /* size of each structure if using Row
* Binding */
int use_bookmarks;
} StatementOptions;
} StatementOptions;
/* Used to pass extra query info to send_query */
typedef struct QueryInfo_
......@@ -169,7 +169,7 @@ typedef struct QueryInfo_
int row_size;
QResultClass *result_in;
char *cursor;
} QueryInfo;
} QueryInfo;
#define PG_TYPE_LO -999 /* hack until permanent type
......
......@@ -34,7 +34,7 @@ extern GLOBAL_VALUES globals;
/* Used for building a Manual Result only */
/* All info functions call this function to create the manual result set. */
void
QR_set_num_fields(QResultClass * self, int new_num_fields)
QR_set_num_fields(QResultClass *self, int new_num_fields)
{
mylog("in QR_set_num_fields\n");
......@@ -48,25 +48,25 @@ QR_set_num_fields(QResultClass * self, int new_num_fields)
}
void
QR_set_position(QResultClass * self, int pos)
QR_set_position(QResultClass *self, int pos)
{
self->tupleField = self->backend_tuples + ((self->base + pos) * self->num_fields);
}
void
QR_set_cache_size(QResultClass * self, int cache_size)
QR_set_cache_size(QResultClass *self, int cache_size)
{
self->cache_size = cache_size;
}
void
QR_set_rowset_size(QResultClass * self, int rowset_size)
QR_set_rowset_size(QResultClass *self, int rowset_size)
{
self->rowset_size = rowset_size;
}
void
QR_inc_base(QResultClass * self, int base_inc)
QR_inc_base(QResultClass *self, int base_inc)
{
self->base += base_inc;
}
......@@ -117,7 +117,7 @@ QR_Constructor(void)
}
void
QR_Destructor(QResultClass * self)
QR_Destructor(QResultClass *self)
{
mylog("QResult: in DESTRUCTOR\n");
......@@ -154,7 +154,7 @@ QR_Destructor(QResultClass * self)
}
void
QR_set_command(QResultClass * self, char *msg)
QR_set_command(QResultClass *self, char *msg)
{
if (self->command)
free(self->command);
......@@ -163,7 +163,7 @@ QR_set_command(QResultClass * self, char *msg)
}
void
QR_set_notice(QResultClass * self, char *msg)
QR_set_notice(QResultClass *self, char *msg)
{
if (self->notice)
free(self->notice);
......@@ -172,7 +172,7 @@ QR_set_notice(QResultClass * self, char *msg)
}
void
QR_free_memory(QResultClass * self)
QR_free_memory(QResultClass *self)
{
register int lf,
row;
......@@ -209,7 +209,7 @@ QR_free_memory(QResultClass * self)
/* This function is called by send_query() */
char
QR_fetch_tuples(QResultClass * self, ConnectionClass * conn, char *cursor)
QR_fetch_tuples(QResultClass *self, ConnectionClass *conn, char *cursor)
{
int tuple_size;
......@@ -297,7 +297,7 @@ QR_fetch_tuples(QResultClass * self, ConnectionClass * conn, char *cursor)
/* Close the cursor and end the transaction (if no cursors left) */
/* We only close cursor/end the transaction if a cursor was used. */
int
QR_close(QResultClass * self)
QR_close(QResultClass *self)
{
QResultClass *res;
......@@ -346,7 +346,7 @@ QR_close(QResultClass * self)
/* This function is called by fetch_tuples() AND SQLFetch() */
int
QR_next_tuple(QResultClass * self)
QR_next_tuple(QResultClass *self)
{
int id;
QResultClass *res;
......@@ -573,7 +573,7 @@ QR_next_tuple(QResultClass * self)
}
char
QR_read_tuple(QResultClass * self, char binary)
QR_read_tuple(QResultClass *self, char binary)
{
Int2 field_lf;
TupleField *this_tuplefield;
......
......@@ -106,20 +106,20 @@ struct QResultClass_
/* Core Functions */
QResultClass *QR_Constructor(void);
void QR_Destructor(QResultClass * self);
char QR_read_tuple(QResultClass * self, char binary);
int QR_next_tuple(QResultClass * self);
int QR_close(QResultClass * self);
char QR_fetch_tuples(QResultClass * self, ConnectionClass * conn, char *cursor);
void QR_free_memory(QResultClass * self);
void QR_set_command(QResultClass * self, char *msg);
void QR_set_notice(QResultClass * self, char *msg);
void QR_set_num_fields(QResultClass * self, int new_num_fields); /* manual result only */
void QR_inc_base(QResultClass * self, int base_inc);
void QR_set_cache_size(QResultClass * self, int cache_size);
void QR_set_rowset_size(QResultClass * self, int rowset_size);
void QR_set_position(QResultClass * self, int pos);
void QR_Destructor(QResultClass *self);
char QR_read_tuple(QResultClass *self, char binary);
int QR_next_tuple(QResultClass *self);
int QR_close(QResultClass *self);
char QR_fetch_tuples(QResultClass *self, ConnectionClass *conn, char *cursor);
void QR_free_memory(QResultClass *self);
void QR_set_command(QResultClass *self, char *msg);
void QR_set_notice(QResultClass *self, char *msg);
void QR_set_num_fields(QResultClass *self, int new_num_fields); /* manual result only */
void QR_inc_base(QResultClass *self, int base_inc);
void QR_set_cache_size(QResultClass *self, int cache_size);
void QR_set_rowset_size(QResultClass *self, int rowset_size);
void QR_set_position(QResultClass *self, int pos);
#endif
......@@ -46,7 +46,7 @@ extern GLOBAL_VALUES globals;
RETCODE SQL_API
SQLRowCount(
HSTMT hstmt,
SDWORD FAR * pcrow)
SDWORD FAR *pcrow)
{
static char *func = "SQLRowCount";
StatementClass *stmt = (StatementClass *) hstmt;
......@@ -116,7 +116,7 @@ SQLRowCount(
RETCODE SQL_API
SQLNumResultCols(
HSTMT hstmt,
SWORD FAR * pccol)
SWORD FAR *pccol)
{
static char *func = "SQLNumResultCols";
StatementClass *stmt = (StatementClass *) hstmt;
......@@ -180,13 +180,13 @@ RETCODE SQL_API
SQLDescribeCol(
HSTMT hstmt,
UWORD icol,
UCHAR FAR * szColName,
UCHAR FAR *szColName,
SWORD cbColNameMax,
SWORD FAR * pcbColName,
SWORD FAR * pfSqlType,
UDWORD FAR * pcbColDef,
SWORD FAR * pibScale,
SWORD FAR * pfNullable)
SWORD FAR *pcbColName,
SWORD FAR *pfSqlType,
UDWORD FAR *pcbColDef,
SWORD FAR *pibScale,
SWORD FAR *pfNullable)
{
static char *func = "SQLDescribeCol";
......@@ -382,8 +382,8 @@ SQLColAttributes(
UWORD fDescType,
PTR rgbDesc,
SWORD cbDescMax,
SWORD FAR * pcbDesc,
SDWORD FAR * pfDesc)
SWORD FAR *pcbDesc,
SDWORD FAR *pfDesc)
{
static char *func = "SQLColAttributes";
StatementClass *stmt = (StatementClass *) hstmt;
......@@ -658,7 +658,7 @@ SQLGetData(
SWORD fCType,
PTR rgbValue,
SDWORD cbValueMax,
SDWORD FAR * pcbValue)
SDWORD FAR *pcbValue)
{
static char *func = "SQLGetData";
QResultClass *res;
......@@ -911,8 +911,8 @@ SQLExtendedFetch(
HSTMT hstmt,
UWORD fFetchType,
SDWORD irow,
UDWORD FAR * pcrow,
UWORD FAR * rgfRowStatus)
UDWORD FAR *pcrow,
UWORD FAR *rgfRowStatus)
{
static char *func = "SQLExtendedFetch";
StatementClass *stmt = (StatementClass *) hstmt;
......@@ -1298,7 +1298,7 @@ SQLSetScrollOptions(
RETCODE SQL_API
SQLSetCursorName(
HSTMT hstmt,
UCHAR FAR * szCursor,
UCHAR FAR *szCursor,
SWORD cbCursor)
{
static char *func = "SQLSetCursorName";
......@@ -1332,9 +1332,9 @@ SQLSetCursorName(
RETCODE SQL_API
SQLGetCursorName(
HSTMT hstmt,
UCHAR FAR * szCursor,
UCHAR FAR *szCursor,
SWORD cbCursorMax,
SWORD FAR * pcbCursor)
SWORD FAR *pcbCursor)
{
static char *func = "SQLGetCursorName";
StatementClass *stmt = (StatementClass *) hstmt;
......
......@@ -50,7 +50,7 @@ typedef struct tagSETUPDLG
char szDSN[MAXDSNAME]; /* Original data source name */
BOOL fNewDSN; /* New data source flag */
BOOL fDefault; /* Default data source flag */
} SETUPDLG, FAR * LPSETUPDLG;
} SETUPDLG, FAR *LPSETUPDLG;
......@@ -323,7 +323,7 @@ ConfigDlgProc(HWND hdlg,
lpsetupdlg = (LPSETUPDLG) GetWindowLong(hdlg, DWL_USER);
DialogBoxParam(s_hModule, MAKEINTRESOURCE(DLG_OPTIONS_DS),
hdlg, ds_optionsProc, (LPARAM) & lpsetupdlg->ci);
hdlg, ds_optionsProc, (LPARAM) &lpsetupdlg->ci);
return TRUE;
}
......
......@@ -36,7 +36,7 @@ extern GLOBAL_VALUES globals;
void
SOCK_clear_error(SocketClass * self)
SOCK_clear_error(SocketClass *self)
{
self->errornumber = 0;
self->errormsg = NULL;
......@@ -73,7 +73,7 @@ SOCK_Constructor()
}
void
SOCK_Destructor(SocketClass * self)
SOCK_Destructor(SocketClass *self)
{
if (self->socket != -1)
{
......@@ -98,7 +98,7 @@ SOCK_Destructor(SocketClass * self)
char
SOCK_connect_to(SocketClass * self, unsigned short port, char *hostname)
SOCK_connect_to(SocketClass *self, unsigned short port, char *hostname)
{
struct hostent *host;
struct sockaddr_in sadr;
......@@ -156,7 +156,7 @@ SOCK_connect_to(SocketClass * self, unsigned short port, char *hostname)
void
SOCK_get_n_char(SocketClass * self, char *buffer, int len)
SOCK_get_n_char(SocketClass *self, char *buffer, int len)
{
int lf;
......@@ -173,7 +173,7 @@ SOCK_get_n_char(SocketClass * self, char *buffer, int len)
void
SOCK_put_n_char(SocketClass * self, char *buffer, int len)
SOCK_put_n_char(SocketClass *self, char *buffer, int len)
{
int lf;
......@@ -193,7 +193,7 @@ SOCK_put_n_char(SocketClass * self, char *buffer, int len)
will read at most bufsize-1 characters + null.
*/
void
SOCK_get_string(SocketClass * self, char *buffer, int bufsize)
SOCK_get_string(SocketClass *self, char *buffer, int bufsize)
{
register int lf = 0;
......@@ -206,7 +206,7 @@ SOCK_get_string(SocketClass * self, char *buffer, int bufsize)
void
SOCK_put_string(SocketClass * self, char *string)
SOCK_put_string(SocketClass *self, char *string)
{
register int lf;
int len;
......@@ -219,7 +219,7 @@ SOCK_put_string(SocketClass * self, char *string)
int
SOCK_get_int(SocketClass * self, short len)
SOCK_get_int(SocketClass *self, short len)
{
char buf[4];
......@@ -248,7 +248,7 @@ SOCK_get_int(SocketClass * self, short len)
void
SOCK_put_int(SocketClass * self, int value, short len)
SOCK_put_int(SocketClass *self, int value, short len)
{
unsigned int rv;
......@@ -273,7 +273,7 @@ SOCK_put_int(SocketClass * self, int value, short len)
void
SOCK_flush_output(SocketClass * self)
SOCK_flush_output(SocketClass *self)
{
int written;
......@@ -287,7 +287,7 @@ SOCK_flush_output(SocketClass * self)
}
unsigned char
SOCK_get_next_byte(SocketClass * self)
SOCK_get_next_byte(SocketClass *self)
{
if (self->buffer_read_in >= self->buffer_filled_in)
{
......@@ -316,7 +316,7 @@ SOCK_get_next_byte(SocketClass * self)
}
void
SOCK_put_next_byte(SocketClass * self, unsigned char next_byte)
SOCK_put_next_byte(SocketClass *self, unsigned char next_byte)
{
int bytes_sent;
......
......@@ -83,17 +83,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);
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_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);
#endif
......@@ -87,7 +87,7 @@ static struct
RETCODE SQL_API
SQLAllocStmt(HDBC hdbc,
HSTMT FAR * phstmt)
HSTMT FAR *phstmt)
{
static char *func = "SQLAllocStmt";
ConnectionClass *conn = (ConnectionClass *) hdbc;
......@@ -213,7 +213,7 @@ SQLFreeStmt(HSTMT hstmt,
* StatementClass implementation
*/
void
InitializeStatementOptions(StatementOptions * opt)
InitializeStatementOptions(StatementOptions *opt)
{
opt->maxRows = 0; /* driver returns all rows */
opt->maxLength = 0; /* driver returns all data for char/binary */
......@@ -288,7 +288,7 @@ SC_Constructor(void)
}
char
SC_Destructor(StatementClass * self)
SC_Destructor(StatementClass *self)
{
mylog("SC_Destructor: self=%u, self->result=%u, self->hdbc=%u\n", self, self->result, self->hdbc);
if (STMT_EXECUTING == self->status)
......@@ -358,7 +358,7 @@ SC_Destructor(StatementClass * self)
data-at-execution parameters that was allocated in SQLPutData.
*/
void
SC_free_params(StatementClass * self, char option)
SC_free_params(StatementClass *self, char option)
{
int i;
......@@ -422,7 +422,7 @@ statement_type(char *statement)
from SQLFreeStmt(SQL_CLOSE)
*/
char
SC_recycle_statement(StatementClass * self)
SC_recycle_statement(StatementClass *self)
{
ConnectionClass *conn;
......@@ -535,7 +535,7 @@ SC_recycle_statement(StatementClass * self)
/* Pre-execute a statement (SQLPrepare/SQLDescribeCol) */
void
SC_pre_execute(StatementClass * self)
SC_pre_execute(StatementClass *self)
{
mylog("SC_pre_execute: status = %d\n", self->status);
......@@ -555,7 +555,7 @@ SC_pre_execute(StatementClass * self)
/* This is only called from SQLFreeStmt(SQL_UNBIND) */
char
SC_unbind_cols(StatementClass * self)
SC_unbind_cols(StatementClass *self)
{
Int2 lf;
......@@ -575,7 +575,7 @@ SC_unbind_cols(StatementClass * self)
}
void
SC_clear_error(StatementClass * self)
SC_clear_error(StatementClass *self)
{
self->errornumber = 0;
self->errormsg = NULL;
......@@ -586,7 +586,7 @@ SC_clear_error(StatementClass * self)
/* This function creates an error msg which is the concatenation */
/* of the result, statement, connection, and socket messages. */
char *
SC_create_errormsg(StatementClass * self)
SC_create_errormsg(StatementClass *self)
{
QResultClass *res = self->result;
ConnectionClass *conn = self->hdbc;
......@@ -622,7 +622,7 @@ SC_create_errormsg(StatementClass * self)
}
char
SC_get_error(StatementClass * self, int *number, char **message)
SC_get_error(StatementClass *self, int *number, char **message)
{
char rv;
......@@ -651,13 +651,13 @@ SC_get_error(StatementClass * self, int *number, char **message)
someday, such as mapping a key to a 32 bit value
*/
unsigned long
SC_get_bookmark(StatementClass * self)
SC_get_bookmark(StatementClass *self)
{
return (self->currTuple + 1);
}
RETCODE
SC_fetch(StatementClass * self)
SC_fetch(StatementClass *self)
{
static char *func = "SC_fetch";
QResultClass *res = self->result;
......@@ -817,7 +817,7 @@ SC_fetch(StatementClass * self)
RETCODE
SC_execute(StatementClass * self)
SC_execute(StatementClass *self)
{
static char *func = "SC_execute";
ConnectionClass *conn;
......@@ -1024,7 +1024,7 @@ SC_execute(StatementClass * self)
}
void
SC_log_error(char *func, char *desc, StatementClass * self)
SC_log_error(char *func, char *desc, StatementClass *self)
{
#ifdef PRN_NULLCHECK
#define nullcheck(a) (a ? a : "(NULL)")
......
......@@ -48,7 +48,7 @@ typedef enum
* considered to be "premature". */
STMT_FINISHED, /* statement execution has finished */
STMT_EXECUTING /* statement execution is still going on */
} STMT_Status;
} STMT_Status;
#define STMT_TRUNCATED -2
#define STMT_INFO_ONLY -1 /* not an error message, just a
......@@ -124,7 +124,7 @@ typedef struct
COL_INFO *col_info; /* cached SQLColumns info for this table */
char name[MAX_TABLE_LEN + 1];
char alias[MAX_TABLE_LEN + 1];
} TABLE_INFO;
} TABLE_INFO;
typedef struct
{
......@@ -142,7 +142,7 @@ typedef struct
char dot[MAX_TABLE_LEN + 1];
char name[MAX_COLUMN_LEN + 1];
char alias[MAX_COLUMN_LEN + 1];
} FIELD_INFO;
} FIELD_INFO;
/******** Statement Handle ***********/
......@@ -224,22 +224,22 @@ struct StatementClass_
/* Statement prototypes */
StatementClass *SC_Constructor(void);
void InitializeStatementOptions(StatementOptions * opt);
char SC_Destructor(StatementClass * self);
void InitializeStatementOptions(StatementOptions *opt);
char SC_Destructor(StatementClass *self);
int statement_type(char *statement);
char parse_statement(StatementClass * stmt);
void SC_pre_execute(StatementClass * self);
char SC_unbind_cols(StatementClass * self);
char SC_recycle_statement(StatementClass * self);
void SC_clear_error(StatementClass * self);
char SC_get_error(StatementClass * self, int *number, char **message);
char *SC_create_errormsg(StatementClass * self);
RETCODE SC_execute(StatementClass * self);
RETCODE SC_fetch(StatementClass * self);
void SC_free_params(StatementClass * self, char option);
void SC_log_error(char *func, char *desc, StatementClass * self);
unsigned long SC_get_bookmark(StatementClass * self);
char parse_statement(StatementClass *stmt);
void SC_pre_execute(StatementClass *self);
char SC_unbind_cols(StatementClass *self);
char SC_recycle_statement(StatementClass *self);
void SC_clear_error(StatementClass *self);
char SC_get_error(StatementClass *self, int *number, char **message);
char *SC_create_errormsg(StatementClass *self);
RETCODE SC_execute(StatementClass *self);
RETCODE SC_fetch(StatementClass *self);
void SC_free_params(StatementClass *self, char option);
void SC_log_error(char *func, char *desc, StatementClass *self);
unsigned long SC_get_bookmark(StatementClass *self);
#endif
......@@ -19,14 +19,14 @@
#include <stdlib.h>
void
set_tuplefield_null(TupleField * tuple_field)
set_tuplefield_null(TupleField *tuple_field)
{
tuple_field->len = 0;
tuple_field->value = NULL; /* strdup(""); */
}
void
set_tuplefield_string(TupleField * tuple_field, char *string)
set_tuplefield_string(TupleField *tuple_field, char *string)
{
tuple_field->len = strlen(string);
tuple_field->value = malloc(strlen(string) + 1);
......@@ -35,7 +35,7 @@ set_tuplefield_string(TupleField * tuple_field, char *string)
void
set_tuplefield_int2(TupleField * tuple_field, Int2 value)
set_tuplefield_int2(TupleField *tuple_field, Int2 value)
{
char buffer[10];
......@@ -48,7 +48,7 @@ set_tuplefield_int2(TupleField * tuple_field, Int2 value)
}
void
set_tuplefield_int4(TupleField * tuple_field, Int4 value)
set_tuplefield_int4(TupleField *tuple_field, Int4 value)
{
char buffer[15];
......
......@@ -39,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_int4(FLD, VAL) ((VAL) != -1 ? set_tuplefield_int4(FLD, (VAL)) : set_tuplefield_null(FLD))
void set_tuplefield_null(TupleField * tuple_field);
void set_tuplefield_string(TupleField * tuple_field, char *string);
void set_tuplefield_int2(TupleField * tuple_field, Int2 value);
void set_tuplefield_int4(TupleField * tuple_field, Int4 value);
void set_tuplefield_null(TupleField *tuple_field);
void set_tuplefield_string(TupleField *tuple_field, char *string);
void set_tuplefield_int2(TupleField *tuple_field, Int2 value);
void set_tuplefield_int4(TupleField *tuple_field, Int4 value);
#endif
......@@ -39,7 +39,7 @@ TL_Constructor(UInt4 fieldcnt)
}
void
TL_Destructor(TupleListClass * self)
TL_Destructor(TupleListClass *self)
{
int lf;
TupleNode *node,
......@@ -65,7 +65,7 @@ TL_Destructor(TupleListClass * self)
void *
TL_get_fieldval(TupleListClass * self, Int4 tupleno, Int2 fieldno)
TL_get_fieldval(TupleListClass *self, Int4 tupleno, Int2 fieldno)
{
Int4 lf;
Int4 delta,
......@@ -178,7 +178,7 @@ TL_get_fieldval(TupleListClass * self, Int4 tupleno, Int2 fieldno)
char
TL_add_tuple(TupleListClass * self, TupleNode * new_field)
TL_add_tuple(TupleListClass *self, TupleNode *new_field)
{
/*
......
......@@ -29,8 +29,8 @@ struct TupleListClass_
/* Create a TupleList. Each tuple consits of fieldcnt columns */
TupleListClass *TL_Constructor(UInt4 fieldcnt);
void TL_Destructor(TupleListClass * self);
void *TL_get_fieldval(TupleListClass * self, Int4 tupleno, Int2 fieldno);
char TL_add_tuple(TupleListClass * self, TupleNode * new_field);
void TL_Destructor(TupleListClass *self);
void *TL_get_fieldval(TupleListClass *self, Int4 tupleno, Int2 fieldno);
char TL_add_tuple(TupleListClass *self, TupleNode *new_field);
#endif
This diff is collapsed.
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