diff options
author | Bruce Momjian <bruce@momjian.us> | 2001-10-28 06:26:15 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2001-10-28 06:26:15 +0000 |
commit | 6783b2372ef13c141649840a836ff0a954ea1d4d (patch) | |
tree | 81c727b2b08930bcf3ab7107c84ef59f1f68a78d /src/interfaces | |
parent | c29797deeb5dfca61b8959344b682b4c32fe53a1 (diff) | |
download | postgresql-6783b2372ef13c141649840a836ff0a954ea1d4d.tar.gz |
Another pgindent run. Fixes enum indenting, and improves #endif
spacing. Also adds space for one-line comments.
Diffstat (limited to 'src/interfaces')
69 files changed, 854 insertions, 824 deletions
diff --git a/src/interfaces/cli/example1.c b/src/interfaces/cli/example1.c index 75cedda3dd..9660ce5719 100644 --- a/src/interfaces/cli/example1.c +++ b/src/interfaces/cli/example1.c @@ -40,7 +40,7 @@ int print_err(SQLSMALLINT handletype, SQLINTEGER handle); int -example1(SQLCHAR * server, SQLCHAR * uid, SQLCHAR * authen) +example1(SQLCHAR *server, SQLCHAR *uid, SQLCHAR *authen) { SQLHENV henv; SQLHDBC hdbc; @@ -135,12 +135,12 @@ example1(SQLCHAR * server, SQLCHAR * uid, SQLCHAR * authen) /* this time, explicitly allocate an application row descriptor */ SQLAllocHandle(SQL_HANDLE_DESC, hdbc, &hdesc); SQLSetDescRec(hdesc, 1, SQL_INTEGER, 0, 0L, 0, 0, - (SQLPOINTER) & id, (SQLINTEGER *) NULL, (SQLSMALLINT *) & idind); + (SQLPOINTER) & id, (SQLINTEGER *) NULL, (SQLSMALLINT *) &idind); SQLSetDescRec(hdesc, 2, SQL_ CHAR, 0, (SQLINTEGER) sizeof(name), - 0, 0, (SQLPOINTER) & name, (SQLINTEGER *) & namelen, - (SQLSMALLINT *) & nameind); + 0, 0, (SQLPOINTER) & name, (SQLINTEGER *) &namelen, + (SQLSMALLINT *) &nameind); /* associate descriptor with statement handle */ SQLSetStmtAttr(hstmt, SQL_ATTR_APP_ROW_DESC, &hdesc, 0); /* execute the fetch */ diff --git a/src/interfaces/cli/example2.c b/src/interfaces/cli/example2.c index 7230abc4da..42a63e5b50 100644 --- a/src/interfaces/cli/example2.c +++ b/src/interfaces/cli/example2.c @@ -39,17 +39,17 @@ #define max(a,b) (a>b?a:b) int print_err(SQLSMALLINT handletype, SQLINTEGER handle); -int build_indicator_message(SQLCHAR * errmsg, +int build_indicator_message(SQLCHAR *errmsg, SQLPOINTER * data, SQLINTEGER collen, - SQLINTEGER * outlen, + SQLINTEGER *outlen, SQLSMALLINT colnum); SQLINTEGER display_length(SQLSMALLINT coltype, SQLINTEGER collen, - SQLCHAR * colname); + SQLCHAR *colname); -example2(SQLCHAR * server, SQLCHAR * uid, SQLCHAR * authen, SQLCHAR * sqlstr) +example2(SQLCHAR *server, SQLCHAR *uid, SQLCHAR *authen, SQLCHAR *sqlstr) { int i; SQLHENV henv; @@ -214,7 +214,7 @@ example2(SQLCHAR * server, SQLCHAR * uid, SQLCHAR * authen, SQLCHAR * sqlstr) SQLINTEGER display_length(SQLSMALLINT coltype, SQLINTEGER collen, - SQLCHAR * colname) + SQLCHAR *colname) { switch (coltype) { @@ -252,8 +252,8 @@ display_length(SQLSMALLINT coltype, SQLINTEGER collen, } int -build_indicator_message(SQLCHAR * errmsg, SQLPOINTER * data, - SQLINTEGER collen, SQLINTEGER * outlen, SQLSMALLINT colnum) +build_indicator_message(SQLCHAR *errmsg, SQLPOINTER * data, + SQLINTEGER collen, SQLINTEGER *outlen, SQLSMALLINT colnum) { if (*outlen == SQL_NULL_DATA) { diff --git a/src/interfaces/cli/sqlcli.h b/src/interfaces/cli/sqlcli.h index a9145495fc..2942abf12f 100644 --- a/src/interfaces/cli/sqlcli.h +++ b/src/interfaces/cli/sqlcli.h @@ -473,7 +473,7 @@ SQLRETURN SQLAllocEnv(SQLHENV * EnvironmentHandle); SQLRETURN SQLAllocHandle(SQLSMALLINT HandleType, SQLINTEGER InputHandle, - SQLINTEGER * OutputHandle); + SQLINTEGER *OutputHandle); SQLRETURN SQLAllocStmt(SQLHDBC ConnectionHandle, SQLSTMT * StatementHandle); @@ -483,7 +483,7 @@ SQLRETURN SQLBindCol(SQLHSTMT StatementHandle, SQLSMALLINT BufferType, SQLPOINTER Data, SQLINTEGER BufferLength, - SQLINTEGER * DataLength); + SQLINTEGER *DataLength); SQLRETURN SQLBindParam(SQLHSTMT StatementHandle, SQLSMALLINT ParamNumber, @@ -492,7 +492,7 @@ SQLRETURN SQLBindParam(SQLHSTMT StatementHandle, SQLINTEGER ParamLength, SQLSMALLINT Scale, SQLPOINTER Data, - SQLINTEGER * DataLength); + SQLINTEGER *DataLength); SQLRETURN SQLCancel(SQLHSTMT StatementHandle); @@ -501,17 +501,17 @@ SQLRETURN SQLCloseCursor(SQLHSTMT StatementHandle); SQLRETURN SQLColAttribute(SQLHSTMT StatementHandle, SQLSMALLINT ColumnNumber, SQLSMALLINT FieldIdentifier, - SQLCHAR * CharacterAttribute, + SQLCHAR *CharacterAttribute, SQLINTEGER BufferLength, - SQLINTEGER * AttributetLength, - SQLINTEGER * NumericAttribute); + SQLINTEGER *AttributetLength, + SQLINTEGER *NumericAttribute); SQLRETURN SQLConnect(SQLHDBC ConnectionHandle, - SQLCHAR * ServerName, + SQLCHAR *ServerName, SQLSMALLINT NameLength1, - SQLCHAR * UserName, + SQLCHAR *UserName, SQLSMALLINT NameLength2, - SQLCHAR * Authentication, + SQLCHAR *Authentication, SQLSMALLINT NameLength3); SQLRETURN SQLCopyDesc(SQLHDESC SourceDescHandle, @@ -519,22 +519,22 @@ SQLRETURN SQLCopyDesc(SQLHDESC SourceDescHandle, SQLRETURN SQLDataSources(SQLHENV EnvironmentHandle, SQLSMALLINT Direction, - SQLCHAR * ServerName, + SQLCHAR *ServerName, SQLSMALLINT BufferLength1, - SQLSMALLINT * NameLength1, - SQLCHAR * Description, + SQLSMALLINT *NameLength1, + SQLCHAR *Description, SQLSMALLINT BufferLength2, - SQLSMALLINT * NameLength2); + SQLSMALLINT *NameLength2); SQLRETURN SQLDescribeCol(SQLHSTMT StatementHandle, SQLSMALLINT ColumnNumber, - SQLCHAR * ColumnName, + SQLCHAR *ColumnName, SQLSMALLINT BufferLength, - SQLSMALLINT * ColumnNameLength, - SQLSMALLINT * ColumnType, - SQLINTEGER * ColumnLength, - SQLSMALLINT * ColumnScale, - SQLSMALLINT * Nullable); + SQLSMALLINT *ColumnNameLength, + SQLSMALLINT *ColumnType, + SQLINTEGER *ColumnLength, + SQLSMALLINT *ColumnScale, + SQLSMALLINT *Nullable); SQLRETURN SQLDisconnect(SQLHDBC ConnectionHandle); @@ -545,14 +545,14 @@ SQLRETURN SQLEndTran(SQLSMALLINT HandleType, SQLRETURN SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLSTMT StatementHandle, - SQLCHAR * Sqlstate, - SQLINTEGER * NativeError, - SQLCHAR * MessageText, + SQLCHAR *Sqlstate, + SQLINTEGER *NativeError, + SQLCHAR *MessageText, SQLINTEGER BufferLength, - SQLINTEGER * TextLength); + SQLINTEGER *TextLength); SQLRETURN SQLExecDirect(SQLHSTMT StatementHandle, - SQLCHAR * StatementText, + SQLCHAR *StatementText, SQLSMALLINT StringLength); SQLRETURN SQLExecute(SQLHSTMT StatementHandle); @@ -576,38 +576,38 @@ SQLRETURN SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, - SQLINTEGER * StringLength); + SQLINTEGER *StringLength); SQLRETURN SQLGetCursorName(SQLHSTMT StatementHandle, - SQLCHAR * CursorName, + SQLCHAR *CursorName, SQLSMALLINT BufferLength, - SQLSMALLINT * NameLength); + SQLSMALLINT *NameLength); SQLRETURN SQLGetData(SQLHSTMT StatementHandle, SQLSMALLINT ColumnNumber, SQLSMALLINT TargetType, SQLPOINTER TargetValue, SQLINTEGER BufferLength, - SQLINTEGER * IndicatorValue); + SQLINTEGER *IndicatorValue); SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecordNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength, - SQLINTEGER * StringLength); + SQLINTEGER *StringLength); SQLRETURN SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecordNumber, - SQLCHAR * Name, + SQLCHAR *Name, SQLSMALLINT BufferLength, - SQLSMALLINT * StringLength, - SQLSMALLINT * Type, - SQLSMALLINT * SubType, - SQLINTEGER * Length, - SQLSMALLINT * Precision, - SQLSMALLINT * Scale, - SQLSMALLINT * Nullable); + SQLSMALLINT *StringLength, + SQLSMALLINT *Type, + SQLSMALLINT *SubType, + SQLINTEGER *Length, + SQLSMALLINT *Precision, + SQLSMALLINT *Scale, + SQLSMALLINT *Nullable); SQLRETURN SQLGetDiagField(SQLSMALLINT HandleType, SQLINTEGER Handle, @@ -615,51 +615,51 @@ SQLRETURN SQLGetDiagField(SQLSMALLINT HandleType, SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, - SQLSMALLINT * StringLength); + SQLSMALLINT *StringLength); SQLRETURN SQLGetDiagRec(SQLSMALLINT HandleType, SQLINTEGER Handle, SQLSMALLINT RecordNumber, - SQLCHAR * Sqlstate, - SQLINTEGER * NativeError, - SQLCHAR * MessageText, + SQLCHAR *Sqlstate, + SQLINTEGER *NativeError, + SQLCHAR *MessageText, SQLSMALLINT BufferLength, - SQLSMALLINT * StringLength); + SQLSMALLINT *StringLength); SQLRETURN SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, - SQLINTEGER * StringLength); + SQLINTEGER *StringLength); SQLRETURN SQLGetFunctions(SQLHDBC ConnectionHandle, SQLSMALLINT FunctionId, - SQLSMALLINT * Supported); + SQLSMALLINT *Supported); SQLRETURN SQLGetInfo(SQLHDBC ConnectionHandle, SQLSMALLINT InfoType, SQLPOINTER InfoValue, SQLSMALLINT BufferLength, - SQLSMALLINT * StringLength); + SQLSMALLINT *StringLength); SQLRETURN SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, - SQLINTEGER * StringLength); + SQLINTEGER *StringLength); SQLRETURN SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType); SQLRETURN SQLNumResultCols(SQLHSTMT StatementHandle, - SQLINTEGER * ColumnCount); + SQLINTEGER *ColumnCount); SQLRETURN SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER * Value); SQLRETURN SQLPrepare(SQLHSTMT StatementHandle, - SQLCHAR * StatementText, + SQLCHAR *StatementText, SQLSMALLINT StringLength); @@ -668,7 +668,7 @@ SQLRETURN SQLPutData(SQLHSTMT StatementHandle, SQLINTEGER StringLength); SQLRETURN SQLRowCount(SQLHSTMT StatementHandle, - SQLINTEGER * RowCount); + SQLINTEGER *RowCount); SQLRETURN SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER AttributeCursorName, @@ -676,7 +676,7 @@ SQLRETURN SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER StringLength); SQLRETURN SQLSetCursorName(SQLHSTMT StatementHandle, - SQLCHAR * CursorName, + SQLCHAR *CursorName, SQLSMALLINT NameLength); SQLRETURN SQLSetDescField(SQLHDESC DescriptorHandle, @@ -692,8 +692,8 @@ SQLRETURN SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT Precision, SQLSMALLINT Scale, SQLPOINTER Data, - SQLINTEGER * StringLength, - SQLSMALLINT * Indicator); + SQLINTEGER *StringLength, + SQLSMALLINT *Indicator); SQLRETURN SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, diff --git a/src/interfaces/ecpg/include/ecpgerrno.h b/src/interfaces/ecpg/include/ecpgerrno.h index 81d67277fe..49e6269d8a 100644 --- a/src/interfaces/ecpg/include/ecpgerrno.h +++ b/src/interfaces/ecpg/include/ecpgerrno.h @@ -61,4 +61,5 @@ #define ECPG_NOTICE_NO_TRANSACTION -604 /* NOTICE: BlankPortalAssignName: portal * already exists */ #define ECPG_NOTICE_PORTAL_EXISTS -605 + #endif /* !_ECPG_ERROR_H */ diff --git a/src/interfaces/ecpg/include/ecpglib.h b/src/interfaces/ecpg/include/ecpglib.h index 732e70f3ce..acb022aa1b 100644 --- a/src/interfaces/ecpg/include/ecpglib.h +++ b/src/interfaces/ecpg/include/ecpglib.h @@ -70,4 +70,5 @@ extern "C" #ifdef __cplusplus } + #endif diff --git a/src/interfaces/ecpg/include/ecpgtype.h b/src/interfaces/ecpg/include/ecpgtype.h index c2e698b84f..d8e2807bb1 100644 --- a/src/interfaces/ecpg/include/ecpgtype.h +++ b/src/interfaces/ecpg/include/ecpgtype.h @@ -76,4 +76,5 @@ extern "C" #ifdef __cplusplus } + #endif diff --git a/src/interfaces/ecpg/include/sql3types.h b/src/interfaces/ecpg/include/sql3types.h index 02305dd54a..74a6d2192e 100644 --- a/src/interfaces/ecpg/include/sql3types.h +++ b/src/interfaces/ecpg/include/sql3types.h @@ -2,29 +2,29 @@ * * Copyright (c) 2000, Christof Petig <christof.petig@wtal.de> * - * $Header: /cvsroot/pgsql/src/interfaces/ecpg/include/sql3types.h,v 1.6 2001/10/25 05:50:11 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/ecpg/include/sql3types.h,v 1.7 2001/10/28 06:26:11 momjian Exp $ */ /* chapter 13.1 table 2: Codes used for SQL data types in Dynamic SQL */ enum { - SQL3_CHARACTER = 1, - SQL3_NUMERIC, - SQL3_DECIMAL, - SQL3_INTEGER, - SQL3_SMALLINT, - SQL3_FLOAT, - SQL3_REAL, - SQL3_DOUBLE_PRECISION, - SQL3_DATE_TIME_TIMESTAMP, - SQL3_INTERVAL, /* 10 */ - SQL3_CHARACTER_VARYING = 12, - SQL3_ENUMERATED, - SQL3_BIT, - SQL3_BIT_VARYING, - SQL3_BOOLEAN, - SQL3_abstract + SQL3_CHARACTER = 1, + SQL3_NUMERIC, + SQL3_DECIMAL, + SQL3_INTEGER, + SQL3_SMALLINT, + SQL3_FLOAT, + SQL3_REAL, + SQL3_DOUBLE_PRECISION, + SQL3_DATE_TIME_TIMESTAMP, + SQL3_INTERVAL, /* 10 */ + SQL3_CHARACTER_VARYING = 12, + SQL3_ENUMERATED, + SQL3_BIT, + SQL3_BIT_VARYING, + SQL3_BOOLEAN, + SQL3_abstract /* the rest is xLOB stuff */ }; @@ -32,12 +32,12 @@ enum enum { - SQL3_DDT_DATE = 1, - SQL3_DDT_TIME, - SQL3_DDT_TIMESTAMP, - SQL3_DDT_TIME_WITH_TIME_ZONE, - SQL3_DDT_TIMESTAMP_WITH_TIME_ZONE, + SQL3_DDT_DATE = 1, + SQL3_DDT_TIME, + SQL3_DDT_TIMESTAMP, + SQL3_DDT_TIME_WITH_TIME_ZONE, + SQL3_DDT_TIMESTAMP_WITH_TIME_ZONE, - SQL3_DDT_ILLEGAL/* not a datetime data type (not part of + SQL3_DDT_ILLEGAL /* not a datetime data type (not part of * standard) */ }; diff --git a/src/interfaces/ecpg/include/sqlca.h b/src/interfaces/ecpg/include/sqlca.h index 28ab20533d..68e0f00839 100644 --- a/src/interfaces/ecpg/include/sqlca.h +++ b/src/interfaces/ecpg/include/sqlca.h @@ -44,7 +44,7 @@ extern "C" /* * 2: if 'W' a (hopefully) non-fatal notice occured -*//* 3: empty */ + */ /* 3: empty */ /* 4: empty */ /* 5: empty */ /* 6: empty */ @@ -59,4 +59,5 @@ extern "C" #ifdef __cplusplus } #endif + #endif diff --git a/src/interfaces/ecpg/lib/execute.c b/src/interfaces/ecpg/lib/execute.c index e9454ec215..a979b55447 100644 --- a/src/interfaces/ecpg/lib/execute.c +++ b/src/interfaces/ecpg/lib/execute.c @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.29 2001/10/25 05:50:11 momjian Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.30 2001/10/28 06:26:11 momjian Exp $ */ /* * The aim is to get a simpler inteface to the database routines. @@ -32,9 +32,9 @@ struct sqlca sqlca = { { 'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' ' - } , - sizeof(struct sqlca), - 0, + }, + sizeof(struct sqlca), + 0, { 0, { @@ -76,7 +76,7 @@ static struct auto_mem { void *pointer; struct auto_mem *next; -} *auto_allocs = NULL; +} *auto_allocs = NULL; static void add_mem(void *ptr, int lineno) diff --git a/src/interfaces/ecpg/lib/misc.c b/src/interfaces/ecpg/lib/misc.c index a37cd7ceb6..47bb1824c2 100644 --- a/src/interfaces/ecpg/lib/misc.c +++ b/src/interfaces/ecpg/lib/misc.c @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/misc.c,v 1.7 2001/10/25 05:50:12 momjian Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/misc.c,v 1.8 2001/10/28 06:26:11 momjian Exp $ */ #include "postgres_fe.h" @@ -13,9 +13,9 @@ static struct sqlca sqlca_init = { { 'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' ' - } , - sizeof(struct sqlca), - 0, + }, + sizeof(struct sqlca), + 0, { 0, { diff --git a/src/interfaces/ecpg/lib/pg_type.h b/src/interfaces/ecpg/lib/pg_type.h index 5961dc23c6..cd2c5273f4 100644 --- a/src/interfaces/ecpg/lib/pg_type.h +++ b/src/interfaces/ecpg/lib/pg_type.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_type.h,v 1.3 2001/10/25 05:50:12 momjian Exp $ + * $Id: pg_type.h,v 1.4 2001/10/28 06:26:11 momjian Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -68,4 +68,5 @@ #define ZPBITOID 1560 #define VARBITOID 1562 #define NUMERICOID 1700 + #endif /* PG_TYPE_H */ diff --git a/src/interfaces/ecpg/lib/prepare.c b/src/interfaces/ecpg/lib/prepare.c index 4efd31da09..e6898b0be0 100644 --- a/src/interfaces/ecpg/lib/prepare.c +++ b/src/interfaces/ecpg/lib/prepare.c @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/prepare.c,v 1.8 2001/10/05 17:37:07 meskes Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/prepare.c,v 1.9 2001/10/28 06:26:11 momjian Exp $ */ #include "postgres_fe.h" @@ -15,7 +15,7 @@ static struct prepared_statement char *name; struct statement *stmt; struct prepared_statement *next; -} *prep_stmts = NULL; +} *prep_stmts = NULL; static bool isvarchar(unsigned char c) diff --git a/src/interfaces/ecpg/lib/typename.c b/src/interfaces/ecpg/lib/typename.c index 48747e2c71..e4ffcc77d8 100644 --- a/src/interfaces/ecpg/lib/typename.c +++ b/src/interfaces/ecpg/lib/typename.c @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/typename.c,v 1.20 2001/10/25 05:50:12 momjian Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/typename.c,v 1.21 2001/10/28 06:26:11 momjian Exp $ */ #include "postgres_fe.h" @@ -59,11 +59,11 @@ ECPGDynamicType(Oid type) switch (type) { case BOOLOID: - return SQL3_BOOLEAN; /* bool */ + return SQL3_BOOLEAN; /* bool */ case INT2OID: return SQL3_SMALLINT; /* int2 */ case INT4OID: - return SQL3_INTEGER; /* int4 */ + return SQL3_INTEGER; /* int4 */ case TEXTOID: return SQL3_CHARACTER; /* text */ case FLOAT4OID: @@ -81,7 +81,7 @@ ECPGDynamicType(Oid type) case TIMESTAMPOID: return SQL3_DATE_TIME_TIMESTAMP; /* datetime */ case NUMERICOID: - return SQL3_NUMERIC; /* numeric */ + return SQL3_NUMERIC; /* numeric */ default: return -type; } diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index 7b6f33e794..5e80904215 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.50 2001/10/25 05:50:12 momjian Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.51 2001/10/28 06:26:11 momjian Exp $ */ /* New main for ecpg, the PostgreSQL embedded SQL precompiler. */ /* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */ @@ -192,7 +192,7 @@ main(int argc, char *const argv[]) ptr2ext[4] = '\0'; } - if (out_option == 0)/* calculate the output name */ + if (out_option == 0) /* calculate the output name */ { output_filename = strdup(input_filename); diff --git a/src/interfaces/ecpg/preproc/type.h b/src/interfaces/ecpg/preproc/type.h index a44cbec1ca..12e45ab43a 100644 --- a/src/interfaces/ecpg/preproc/type.h +++ b/src/interfaces/ecpg/preproc/type.h @@ -60,13 +60,13 @@ extern const char *ECPGtype_name(enum ECPGttype typ); /* some stuff for whenever statements */ enum WHEN_TYPE { - W_NOTHING, - W_CONTINUE, - W_BREAK, - W_SQLPRINT, - W_GOTO, - W_DO, - W_STOP + W_NOTHING, + W_CONTINUE, + W_BREAK, + W_SQLPRINT, + W_GOTO, + W_DO, + W_STOP }; struct when @@ -155,7 +155,7 @@ struct assignment enum errortype { - ET_NOTICE, ET_ERROR, ET_FATAL + ET_NOTICE, ET_ERROR, ET_FATAL }; struct fetch_desc diff --git a/src/interfaces/libpgtcl/libpgtcl.h b/src/interfaces/libpgtcl/libpgtcl.h index 7d225d03e8..5b72c80c19 100644 --- a/src/interfaces/libpgtcl/libpgtcl.h +++ b/src/interfaces/libpgtcl/libpgtcl.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: libpgtcl.h,v 1.12 2001/10/25 05:50:12 momjian Exp $ + * $Id: libpgtcl.h,v 1.13 2001/10/28 06:26:11 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -20,4 +20,5 @@ extern int Pgtcl_Init(Tcl_Interp *interp); extern int Pgtcl_SafeInit(Tcl_Interp *interp); + #endif /* LIBPGTCL_H */ diff --git a/src/interfaces/libpgtcl/pgtclCmds.h b/src/interfaces/libpgtcl/pgtclCmds.h index 8f90af5aa9..9c53d82a7e 100644 --- a/src/interfaces/libpgtcl/pgtclCmds.h +++ b/src/interfaces/libpgtcl/pgtclCmds.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pgtclCmds.h,v 1.23 2001/10/25 05:50:12 momjian Exp $ + * $Id: pgtclCmds.h,v 1.24 2001/10/28 06:26:11 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -62,13 +62,13 @@ typedef struct Pg_ConnectionId_s int res_copyStatus; /* Copying status */ PGresult **results; /* The results */ - Pg_TclNotifies *notify_list; /* head of list of notify info */ + Pg_TclNotifies *notify_list; /* head of list of notify info */ int notifier_running; /* notify event source is live */ #if TCL_MAJOR_VERSION >= 8 Tcl_Channel notifier_channel; /* Tcl_Channel on which notifier * is listening */ #else - int notifier_socket; /* PQsocket on which notifier is listening */ + int notifier_socket; /* PQsocket on which notifier is listening */ #endif } Pg_ConnectionId; @@ -128,4 +128,5 @@ extern int Pg_lo_export( ClientData cData, Tcl_Interp *interp, int argc, char *argv[]); extern int Pg_listen( ClientData cData, Tcl_Interp *interp, int argc, char *argv[]); + #endif /* PGTCLCMDS_H */ diff --git a/src/interfaces/libpq/fe-auth.h b/src/interfaces/libpq/fe-auth.h index 4d99399cb9..979ac078b5 100644 --- a/src/interfaces/libpq/fe-auth.h +++ b/src/interfaces/libpq/fe-auth.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: fe-auth.h,v 1.13 2001/10/25 05:50:13 momjian Exp $ + * $Id: fe-auth.h,v 1.14 2001/10/28 06:26:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -41,4 +41,5 @@ extern char *fe_getauthname(char *PQerrormsg); #define PG_KRB4_VERSION "PGVER4.1" /* at most KRB_SENDAUTH_VLEN chars */ #define PG_KRB5_VERSION "PGVER5.1" + #endif /* FE_AUTH_H */ diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 69bd5fa591..fa000f3959 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.178 2001/10/25 05:50:13 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.179 2001/10/28 06:26:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -147,7 +147,7 @@ static const struct EnvironmentOptions { const char *envName, *pgName; -} EnvironmentOptions[] = +} EnvironmentOptions[] = { /* common user-interface settings */ diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 2a75ce43d7..2257cbd47b 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -25,7 +25,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.58 2001/10/25 05:50:13 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.59 2001/10/28 06:26:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -894,4 +894,5 @@ WSSE_GOODEXIT: return winsock_strerror_buf; } + #endif diff --git a/src/interfaces/libpq/fe-print.c b/src/interfaces/libpq/fe-print.c index e753e5dd52..97760766f8 100644 --- a/src/interfaces/libpq/fe-print.c +++ b/src/interfaces/libpq/fe-print.c @@ -10,7 +10,7 @@ * didn't really belong there. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.43 2001/10/25 05:50:13 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.44 2001/10/28 06:26:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -572,7 +572,7 @@ PQdisplayTuples(const PGresult *res, FILE *fp, /* where to send the output */ int fillAlign, /* pad the fields with spaces */ const char *fieldSep, /* field separator */ - int printHeader,/* display headers? */ + int printHeader, /* display headers? */ int quiet ) { @@ -662,7 +662,7 @@ PQdisplayTuples(const PGresult *res, void PQprintTuples(const PGresult *res, FILE *fout, /* output stream */ - int PrintAttNames,/* print attribute names or not */ + int PrintAttNames, /* print attribute names or not */ int TerseOutput, /* delimiter bars or not? */ int colWidth /* width of column, if 0, use variable * width */ diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h index de8fa5636e..cdfb575061 100644 --- a/src/interfaces/libpq/libpq-fe.h +++ b/src/interfaces/libpq/libpq-fe.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: libpq-fe.h,v 1.76 2001/10/25 05:50:13 momjian Exp $ + * $Id: libpq-fe.h,v 1.77 2001/10/28 06:26:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -190,12 +190,14 @@ extern "C" /* Asynchronous (non-blocking) */ extern PGconn *PQconnectStart(const char *conninfo); extern PostgresPollingStatusType PQconnectPoll(PGconn *conn); + /* Synchronous (blocking) */ extern PGconn *PQconnectdb(const char *conninfo); extern PGconn *PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions, const char *pgtty, const char *dbName, const char *login, const char *pwd); + #define PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME) \ PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL) @@ -215,6 +217,7 @@ extern "C" /* Asynchronous (non-blocking) */ extern int PQresetStart(PGconn *conn); extern PostgresPollingStatusType PQresetPoll(PGconn *conn); + /* Synchronous (blocking) */ extern void PQreset(PGconn *conn); @@ -235,6 +238,7 @@ extern "C" extern int PQbackendPID(const PGconn *conn); extern int PQclientEncoding(const PGconn *conn); extern int PQsetClientEncoding(PGconn *conn, const char *encoding); + #ifdef USE_SSL /* Get the SSL structure associated with a connection */ extern SSL *PQgetssl(PGconn *conn); @@ -374,4 +378,5 @@ extern "C" #ifdef __cplusplus } #endif + #endif /* LIBPQ_FE_H */ diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index 26acd3ed83..f7f060a152 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: libpq-int.h,v 1.41 2001/10/25 05:50:13 momjian Exp $ + * $Id: libpq-int.h,v 1.42 2001/10/28 06:26:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -139,7 +139,7 @@ struct pg_result */ PQnoticeProcessor noticeHook; /* notice/error message processor */ void *noticeArg; - int client_encoding; /* encoding id */ + int client_encoding; /* encoding id */ char *errMsg; /* error message, or NULL if no error */ @@ -160,26 +160,22 @@ struct pg_result /* PGAsyncStatusType defines the state of the query-execution state machine */ typedef enum { - PGASYNC_IDLE, /* nothing's happening, dude */ - PGASYNC_BUSY, /* query in progress */ - PGASYNC_READY, /* result ready for PQgetResult */ - PGASYNC_COPY_IN,/* Copy In data transfer in progress */ - PGASYNC_COPY_OUT/* Copy Out data transfer in progress */ + PGASYNC_IDLE, /* nothing's happening, dude */ + PGASYNC_BUSY, /* query in progress */ + PGASYNC_READY, /* result ready for PQgetResult */ + PGASYNC_COPY_IN, /* Copy In data transfer in progress */ + PGASYNC_COPY_OUT /* Copy Out data transfer in progress */ } PGAsyncStatusType; /* PGSetenvStatusType defines the state of the PQSetenv state machine */ typedef enum { - SETENV_STATE_OPTION_SEND, /* About to send an - * Environment Option */ - SETENV_STATE_OPTION_WAIT, /* Waiting for above send - * to complete */ + SETENV_STATE_OPTION_SEND, /* About to send an Environment Option */ + SETENV_STATE_OPTION_WAIT, /* Waiting for above send to complete */ /* these next two are only used in MULTIBYTE mode */ - SETENV_STATE_ENCODINGS_SEND, /* About to send an - * "encodings" query */ - SETENV_STATE_ENCODINGS_WAIT, /* Waiting for query to - * complete */ - SETENV_STATE_IDLE + SETENV_STATE_ENCODINGS_SEND, /* About to send an "encodings" query */ + SETENV_STATE_ENCODINGS_WAIT, /* Waiting for query to complete */ + SETENV_STATE_IDLE } PGSetenvStatusType; /* large-object-access data ... allocated only if large-object code is used. */ @@ -282,7 +278,7 @@ struct pg_conn /* Buffer for receiving various parts of messages */ PQExpBufferData workBuffer; /* expansible string */ - int client_encoding; /* encoding id */ + int client_encoding; /* encoding id */ }; /* String descriptions of the ExecStatusTypes. @@ -356,4 +352,5 @@ __attribute__((format_arg(1))); #else #define libpq_gettext(x) (x) #endif + #endif /* LIBPQ_INT_H */ diff --git a/src/interfaces/libpq/pqexpbuffer.h b/src/interfaces/libpq/pqexpbuffer.h index 9e17b314f7..1435b502b7 100644 --- a/src/interfaces/libpq/pqexpbuffer.h +++ b/src/interfaces/libpq/pqexpbuffer.h @@ -18,7 +18,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pqexpbuffer.h,v 1.8 2001/10/25 05:50:13 momjian Exp $ + * $Id: pqexpbuffer.h,v 1.9 2001/10/28 06:26:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -160,4 +160,5 @@ extern void appendPQExpBufferChar(PQExpBuffer str, char ch); */ extern void appendBinaryPQExpBuffer(PQExpBuffer str, const char *data, size_t datalen); + #endif /* PQEXPBUFFER_H */ diff --git a/src/interfaces/libpq/pqsignal.h b/src/interfaces/libpq/pqsignal.h index b6b167c188..d36165b4f7 100644 --- a/src/interfaces/libpq/pqsignal.h +++ b/src/interfaces/libpq/pqsignal.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pqsignal.h,v 1.11 2001/10/25 05:50:13 momjian Exp $ + * $Id: pqsignal.h,v 1.12 2001/10/28 06:26:12 momjian Exp $ * * NOTES * This shouldn't be in libpq, but the monitor and some other @@ -23,4 +23,5 @@ typedef void (*pqsigfunc) (int); extern pqsigfunc pqsignal(int signo, pqsigfunc func); + #endif /* PQSIGNAL_H */ diff --git a/src/interfaces/odbc/bind.c b/src/interfaces/odbc/bind.c index 4bd2c0ce08..d176acee6b 100644 --- a/src/interfaces/odbc/bind.c +++ b/src/interfaces/odbc/bind.c @@ -431,7 +431,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; diff --git a/src/interfaces/odbc/bind.h b/src/interfaces/odbc/bind.h index a792c38951..444d30f2d2 100644 --- a/src/interfaces/odbc/bind.h +++ b/src/interfaces/odbc/bind.h @@ -48,5 +48,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 diff --git a/src/interfaces/odbc/columninfo.c b/src/interfaces/odbc/columninfo.c index d05de1ffb7..d9a22a163a 100644 --- a/src/interfaces/odbc/columninfo.c +++ b/src/interfaces/odbc/columninfo.c @@ -42,7 +42,7 @@ CI_Constructor() void -CI_Destructor(ColumnInfoClass * self) +CI_Destructor(ColumnInfoClass *self) { CI_free_memory(self); @@ -56,7 +56,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; @@ -112,7 +112,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; @@ -148,7 +148,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 */ @@ -164,7 +164,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 */ diff --git a/src/interfaces/odbc/columninfo.h b/src/interfaces/odbc/columninfo.h index 1c805cc977..41e9400dce 100644 --- a/src/interfaces/odbc/columninfo.h +++ b/src/interfaces/odbc/columninfo.h @@ -29,13 +29,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); + #endif diff --git a/src/interfaces/odbc/connection.c b/src/interfaces/odbc/connection.c index 408bef8f80..c5aac61c4a 100644 --- a/src/interfaces/odbc/connection.c +++ b/src/interfaces/odbc/connection.c @@ -297,7 +297,7 @@ CC_Constructor() char -CC_Destructor(ConnectionClass * self) +CC_Destructor(ConnectionClass *self) { mylog("enter CC_Destructor, self=%u\n", self); @@ -349,7 +349,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, @@ -371,7 +371,7 @@ CC_cursor_count(ConnectionClass * self) void -CC_clear_error(ConnectionClass * self) +CC_clear_error(ConnectionClass *self) { self->errornumber = 0; self->errormsg = NULL; @@ -384,7 +384,7 @@ CC_clear_error(ConnectionClass * self) * We are almost always in the middle of a transaction. */ char -CC_abort(ConnectionClass * self) +CC_abort(ConnectionClass *self) { QResultClass *res; @@ -410,7 +410,7 @@ CC_abort(ConnectionClass * self) /* This is called by SQLDisconnect also */ char -CC_cleanup(ConnectionClass * self) +CC_cleanup(ConnectionClass *self) { int i; StatementClass *stmt; @@ -466,7 +466,7 @@ CC_cleanup(ConnectionClass * self) int -CC_set_translation(ConnectionClass * self) +CC_set_translation(ConnectionClass *self) { #ifdef WIN32 @@ -510,7 +510,7 @@ CC_set_translation(ConnectionClass * self) char -CC_connect(ConnectionClass * self, char do_password) +CC_connect(ConnectionClass *self, char do_password) { StartupPacket sp; StartupPacket6_2 sp62; @@ -854,7 +854,7 @@ another_version_retry: char -CC_add_statement(ConnectionClass * self, StatementClass * stmt) +CC_add_statement(ConnectionClass *self, StatementClass *stmt) { int i; @@ -887,7 +887,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; @@ -909,7 +909,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; @@ -936,7 +936,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; @@ -974,7 +974,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 = NULL, *res = NULL, @@ -1335,7 +1335,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, @@ -1487,7 +1487,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); @@ -1596,7 +1596,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; @@ -1648,7 +1648,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); if (PROTOCOL_62(&self->connInfo)) @@ -1678,7 +1678,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; @@ -1744,7 +1744,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)") @@ -1774,7 +1774,7 @@ CC_log_error(char *func, char *desc, ConnectionClass * self) } int -CC_get_max_query_len(const ConnectionClass * conn) +CC_get_max_query_len(const ConnectionClass *conn) { int value; diff --git a/src/interfaces/odbc/connection.h b/src/interfaces/odbc/connection.h index 782fb0e4d1..f2c21604b1 100644 --- a/src/interfaces/odbc/connection.h +++ b/src/interfaces/odbc/connection.h @@ -17,14 +17,13 @@ typedef enum { - CONN_NOT_CONNECTED, /* Connection has not been - * established */ - CONN_CONNECTED, /* Connection is up and has been + CONN_NOT_CONNECTED, /* Connection has not been established */ + CONN_CONNECTED, /* Connection is up and has been * established */ - CONN_DOWN, /* Connection is broken */ - CONN_EXECUTING /* the connection is currently executing a + 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 @@ -124,7 +123,7 @@ typedef struct _StartupPacket6_2 char options[ARGV_SIZE]; char execfile[ARGV_SIZE]; char tty[PATH_SIZE]; -} StartupPacket6_2; +} StartupPacket6_2; /* Structure to hold all the connection attributes for a specific @@ -153,7 +152,7 @@ typedef struct char disallow_premature; char updatable_cursors; GLOBAL_VALUES drivers; /* moved from driver's option */ -} ConnInfo; +} ConnInfo; /* Macro to determine is the connection using 6.2 protocol? */ #define PROTOCOL_62(conninfo_) (strncmp((conninfo_)->protocol, PG62, strlen(PG62)) == 0) @@ -213,27 +212,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_ @@ -290,23 +289,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); -int CC_get_max_query_len(const 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); +int CC_get_max_query_len(const ConnectionClass *self); + #endif diff --git a/src/interfaces/odbc/convert.c b/src/interfaces/odbc/convert.c index aae290970c..871a9c3741 100644 --- a/src/interfaces/odbc/convert.c +++ b/src/interfaces/odbc/convert.c @@ -138,7 +138,7 @@ static 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]); @@ -149,8 +149,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; @@ -756,7 +756,7 @@ copy_and_convert_field(StatementClass * stmt, Int4 field_type, void *value, Int2 */ #define INIT_MIN_ALLOC 4096 static int -enlarge_statement(StatementClass * stmt, unsigned int newsize) +enlarge_statement(StatementClass *stmt, unsigned int newsize) { unsigned int newalsize = INIT_MIN_ALLOC; static char *func = "enlarge_statement"; @@ -952,7 +952,7 @@ table_for_update(const char *stmt, int *endpos) * This function does a dynamic memory allocation to get rid of query size limit! */ int -copy_statement_with_parameters(StatementClass * stmt) +copy_statement_with_parameters(StatementClass *stmt) { static char *func = "copy_statement_with_parameters"; unsigned int opos, @@ -1855,7 +1855,7 @@ convert_money(const char *s, char *sout, size_t soutmax) * 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, @@ -1922,7 +1922,7 @@ parse_datetime(char *buf, SIMPLE_TIME * st) /* Change linefeed to carriage-return/linefeed */ int -convert_linefeeds(const char *si, char *dst, size_t max, BOOL * changed) +convert_linefeeds(const char *si, char *dst, size_t max, BOOL *changed) { size_t i = 0, out = 0; @@ -2221,8 +2221,8 @@ decode(const char *in, char *out) *------- */ int -convert_lo(StatementClass * stmt, const void *value, Int2 fCType, PTR rgbValue, - SDWORD cbValueMax, SDWORD * pcbValue) +convert_lo(StatementClass *stmt, const void *value, Int2 fCType, PTR rgbValue, + SDWORD cbValueMax, SDWORD *pcbValue) { Oid oid; int retval, diff --git a/src/interfaces/odbc/convert.h b/src/interfaces/odbc/convert.h index 9ef3dffa64..dfbd32ce24 100644 --- a/src/interfaces/odbc/convert.h +++ b/src/interfaces/odbc/convert.h @@ -27,17 +27,17 @@ 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); BOOL convert_money(const char *s, char *sout, size_t soutmax); -char parse_datetime(char *buf, SIMPLE_TIME * st); -int convert_linefeeds(const char *s, char *dst, size_t max, BOOL * changed); +char parse_datetime(char *buf, SIMPLE_TIME *st); +int convert_linefeeds(const char *s, char *dst, size_t max, BOOL *changed); int convert_special_chars(const char *si, char *dst, int used); int convert_pgbinary_to_char(const char *value, char *rgbValue, int cbValueMax); @@ -45,6 +45,7 @@ int convert_from_pgbinary(const unsigned char *value, unsigned char *rgbValue, int convert_to_pgbinary(const unsigned char *in, char *out, int len); void encode(const char *in, char *out); void decode(const char *in, char *out); -int convert_lo(StatementClass * stmt, const void *value, Int2 fCType, PTR rgbValue, - SDWORD cbValueMax, SDWORD * pcbValue); +int convert_lo(StatementClass *stmt, const void *value, Int2 fCType, PTR rgbValue, + SDWORD cbValueMax, SDWORD *pcbValue); + #endif diff --git a/src/interfaces/odbc/dlg_specific.c b/src/interfaces/odbc/dlg_specific.c index d395e9a35e..e73c47e314 100644 --- a/src/interfaces/odbc/dlg_specific.c +++ b/src/interfaces/odbc/dlg_specific.c @@ -40,13 +40,13 @@ extern GLOBAL_VALUES globals; #ifdef WIN32 static int driver_optionsDraw(HWND, const ConnInfo *, int src, BOOL enable); -static int driver_options_update(HWND hdlg, ConnInfo * ci, BOOL); -static void updateCommons(const ConnInfo * ci); +static int driver_options_update(HWND hdlg, ConnInfo *ci, BOOL); +static void updateCommons(const ConnInfo *ci); #endif #ifdef WIN32 void -SetDlgStuff(HWND hdlg, const ConnInfo * ci) +SetDlgStuff(HWND hdlg, const ConnInfo *ci) { /* * If driver attribute NOT present, then set the datasource name and @@ -67,7 +67,7 @@ SetDlgStuff(HWND hdlg, const ConnInfo * ci) void -GetDlgStuff(HWND hdlg, ConnInfo * ci) +GetDlgStuff(HWND hdlg, ConnInfo *ci) { GetDlgItemText(hdlg, IDC_DESC, ci->desc, sizeof(ci->desc)); @@ -80,7 +80,7 @@ GetDlgStuff(HWND hdlg, ConnInfo * ci) static int -driver_optionsDraw(HWND hdlg, const ConnInfo * ci, int src, BOOL enable) +driver_optionsDraw(HWND hdlg, const ConnInfo *ci, int src, BOOL enable) { const GLOBAL_VALUES *comval; static BOOL defset = FALSE; @@ -164,7 +164,7 @@ driver_optionsDraw(HWND hdlg, const ConnInfo * ci, int src, BOOL enable) return 0; } static int -driver_options_update(HWND hdlg, ConnInfo * ci, BOOL updateProfile) +driver_options_update(HWND hdlg, ConnInfo *ci, BOOL updateProfile) { GLOBAL_VALUES *comval; @@ -391,7 +391,7 @@ ds_optionsProc(HWND hdlg, * to the ODBCINST.INI portion of the registry */ static void -updateCommons(const ConnInfo * ci) +updateCommons(const ConnInfo *ci) { const char *sectionName; const char *fileName; @@ -498,7 +498,7 @@ updateCommons(const ConnInfo * ci) void -makeConnectString(char *connect_string, const ConnInfo * ci, UWORD len) +makeConnectString(char *connect_string, const ConnInfo *ci, UWORD len) { char got_dsn = (ci->dsn[0] != '\0'); char encoded_conn_settings[LARGE_REGISTRY_LEN]; @@ -576,7 +576,7 @@ makeConnectString(char *connect_string, const ConnInfo * ci, UWORD len) void -copyAttributes(ConnInfo * ci, const char *attribute, const char *value) +copyAttributes(ConnInfo *ci, const char *attribute, const char *value) { if (stricmp(attribute, "DSN") == 0) strcpy(ci->dsn, value); @@ -631,7 +631,7 @@ copyAttributes(ConnInfo * ci, const char *attribute, const char *value) } void -copyCommonAttributes(ConnInfo * ci, const char *attribute, const char *value) +copyCommonAttributes(ConnInfo *ci, const char *attribute, const char *value) { if (stricmp(attribute, INI_FETCH) == 0 || stricmp(attribute, "A7") == 0) ci->drivers.fetch_max = atoi(value); @@ -694,7 +694,7 @@ copyCommonAttributes(ConnInfo * ci, const char *attribute, const char *value) void -getDSNdefaults(ConnInfo * ci) +getDSNdefaults(ConnInfo *ci) { if (ci->port[0] == '\0') strcpy(ci->port, DEFAULT_PORT); @@ -720,7 +720,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], @@ -840,7 +840,7 @@ getDSNinfo(ConnInfo * ci, char overwrite) /* This is for datasource based options only */ void -writeDSNinfo(const ConnInfo * ci) +writeDSNinfo(const ConnInfo *ci) { const char *DSN = ci->dsn; char encoded_conn_settings[LARGE_REGISTRY_LEN], @@ -931,7 +931,7 @@ writeDSNinfo(const ConnInfo * ci) * the registry and gets any driver defaults. */ void -getCommonDefaults(const char *section, const char *filename, ConnInfo * ci) +getCommonDefaults(const char *section, const char *filename, ConnInfo *ci) { char temp[256]; GLOBAL_VALUES *comval; diff --git a/src/interfaces/odbc/dlg_specific.h b/src/interfaces/odbc/dlg_specific.h index b1ec7090c0..5a8c751485 100644 --- a/src/interfaces/odbc/dlg_specific.h +++ b/src/interfaces/odbc/dlg_specific.h @@ -120,11 +120,11 @@ #define DEFAULT_EXTRASYSTABLEPREFIXES "dd_;" /* prototypes */ -void getCommonDefaults(const char *section, const char *filename, ConnInfo * ci); +void getCommonDefaults(const char *section, const char *filename, ConnInfo *ci); #ifdef WIN32 -void SetDlgStuff(HWND hdlg, const ConnInfo * ci); -void GetDlgStuff(HWND hdlg, ConnInfo * ci); +void SetDlgStuff(HWND hdlg, const ConnInfo *ci); +void GetDlgStuff(HWND hdlg, ConnInfo *ci); int CALLBACK driver_optionsProc(HWND hdlg, WORD wMsg, @@ -137,11 +137,11 @@ int CALLBACK ds_optionsProc(HWND hdlg, #endif /* WIN32 */ void updateGlobals(void); -void writeDSNinfo(const ConnInfo * ci); -void getDSNdefaults(ConnInfo * ci); -void getDSNinfo(ConnInfo * ci, char overwrite); -void makeConnectString(char *connect_string, const ConnInfo * ci, UWORD); -void copyAttributes(ConnInfo * ci, const char *attribute, const char *value); -void copyCommonAttributes(ConnInfo * ci, const char *attribute, const char *value); +void writeDSNinfo(const ConnInfo *ci); +void getDSNdefaults(ConnInfo *ci); +void getDSNinfo(ConnInfo *ci, char overwrite); +void makeConnectString(char *connect_string, const ConnInfo *ci, UWORD); +void copyAttributes(ConnInfo *ci, const char *attribute, const char *value); +void copyCommonAttributes(ConnInfo *ci, const char *attribute, const char *value); #endif diff --git a/src/interfaces/odbc/drvconn.c b/src/interfaces/odbc/drvconn.c index ce95296e54..bdcf6af7f0 100644 --- a/src/interfaces/odbc/drvconn.c +++ b/src/interfaces/odbc/drvconn.c @@ -45,14 +45,14 @@ #include "dlg_specific.h" /* prototypes */ -void dconn_get_connect_attributes(const UCHAR FAR * connect_string, ConnInfo * ci); -static void dconn_get_common_attributes(const UCHAR FAR * connect_string, ConnInfo * ci); +void dconn_get_connect_attributes(const UCHAR FAR * connect_string, ConnInfo *ci); +static void dconn_get_common_attributes(const 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. */ +extern HINSTANCE NEAR s_hModule; /* Saved module handle. */ #endif @@ -249,7 +249,7 @@ dialog: #ifdef WIN32 RETCODE -dconn_DoDialog(HWND hwnd, ConnInfo * ci) +dconn_DoDialog(HWND hwnd, ConnInfo *ci) { int dialog_result; @@ -342,7 +342,7 @@ dconn_FDriverConnectProc( void -dconn_get_connect_attributes(const UCHAR FAR * connect_string, ConnInfo * ci) +dconn_get_connect_attributes(const UCHAR FAR * connect_string, ConnInfo *ci) { char *our_connect_string; char *pair, @@ -391,7 +391,7 @@ dconn_get_connect_attributes(const UCHAR FAR * connect_string, ConnInfo * ci) } static void -dconn_get_common_attributes(const UCHAR FAR * connect_string, ConnInfo * ci) +dconn_get_common_attributes(const UCHAR FAR * connect_string, ConnInfo *ci) { char *our_connect_string; char *pair, diff --git a/src/interfaces/odbc/environ.c b/src/interfaces/odbc/environ.c index c36c300caf..9bb9615dea 100644 --- a/src/interfaces/odbc/environ.c +++ b/src/interfaces/odbc/environ.c @@ -494,7 +494,7 @@ EN_Constructor(void) char -EN_Destructor(EnvironmentClass * self) +EN_Destructor(EnvironmentClass *self) { int lf; char rv = 1; @@ -523,7 +523,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) { @@ -539,7 +539,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; @@ -563,7 +563,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; @@ -579,7 +579,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); diff --git a/src/interfaces/odbc/environ.h b/src/interfaces/odbc/environ.h index a99a4e5a28..7b463b3e74 100644 --- a/src/interfaces/odbc/environ.h +++ b/src/interfaces/odbc/environ.h @@ -22,9 +22,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 diff --git a/src/interfaces/odbc/gpps.c b/src/interfaces/odbc/gpps.c index 658829a5fd..3d578c9d77 100644 --- a/src/interfaces/odbc/gpps.c +++ b/src/interfaces/odbc/gpps.c @@ -55,7 +55,7 @@ * ODBCINSTDIR/ODBCINST_INI */ DWORD -GetPrivateProfileString(const char *theSection, /* section name */ +GetPrivateProfileString(const char *theSection, /* section name */ const char *theKey, /* search key name */ const char *theDefault, /* default value if not * found */ diff --git a/src/interfaces/odbc/gpps.h b/src/interfaces/odbc/gpps.h index f44a266f39..eb1b155c8a 100644 --- a/src/interfaces/odbc/gpps.h +++ b/src/interfaces/odbc/gpps.h @@ -18,7 +18,7 @@ extern "C" { #endif - DWORD + DWORD GetPrivateProfileString(const char *theSection, /* section name */ const char *theKey, /* search key name */ const char *theDefault, /* default value if not @@ -30,7 +30,7 @@ extern "C" const char *theIniFileName); /* pathname of ini file * to search */ - DWORD + DWORD WritePrivateProfileString(const char *theSection, /* section name */ const char *theKey, /* write key name */ const char *theBuffer, /* input buffer */ @@ -44,4 +44,5 @@ extern "C" #ifndef WIN32 #undef DWORD #endif + #endif diff --git a/src/interfaces/odbc/info.c b/src/interfaces/odbc/info.c index 0752ab03ab..6ffc7cc51b 100644 --- a/src/interfaces/odbc/info.c +++ b/src/interfaces/odbc/info.c @@ -178,7 +178,7 @@ PGAPI_GetInfo( p = CC_is_onlyread(conn) ? "Y" : "N"; break; - case SQL_DATABASE_NAME:/* Support for old ODBC 1.0 Apps */ + case SQL_DATABASE_NAME: /* Support for old ODBC 1.0 Apps */ /* * Returning the database name causes problems in MS Query. It @@ -789,7 +789,7 @@ PGAPI_GetTypeInfo( 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)); @@ -1387,7 +1387,7 @@ PGAPI_Tables( (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], ""); @@ -1698,7 +1698,7 @@ PGAPI_Columns( /* 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() */ @@ -1727,7 +1727,7 @@ PGAPI_Columns( 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], ""); @@ -1761,7 +1761,7 @@ PGAPI_Columns( if (field_type == PG_TYPE_NUMERIC) { if (mod_length >= 4) - mod_length -= 4; /* the length is in atttypmod - 4 */ + mod_length -= 4; /* the length is in atttypmod - 4 */ if (mod_length >= 0) { @@ -1785,7 +1785,7 @@ PGAPI_Columns( useStaticPrecision = FALSE; if (mod_length >= 4) - mod_length -= 4; /* the length is in atttypmod - 4 */ + mod_length -= 4; /* the length is in atttypmod - 4 */ if (mod_length > ci->drivers.max_varchar_size || mod_length <= 0) mod_length = ci->drivers.max_varchar_size; @@ -1838,7 +1838,7 @@ PGAPI_Columns( 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], ""); @@ -1975,7 +1975,7 @@ PGAPI_SpecialColumns( /* 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"); @@ -1995,7 +1995,7 @@ PGAPI_SpecialColumns( 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"); @@ -2303,7 +2303,7 @@ PGAPI_Statistics( 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], ""); @@ -2347,7 +2347,7 @@ PGAPI_Statistics( while (i < 16 && 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], ""); @@ -2630,7 +2630,7 @@ PGAPI_PrimaryKeys( 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]); @@ -2698,7 +2698,7 @@ isMultibyte(const unsigned char *str) return FALSE; } static char * -getClientTableName(ConnectionClass * conn, char *serverTableName, BOOL * nameAlloced) +getClientTableName(ConnectionClass *conn, char *serverTableName, BOOL *nameAlloced) { char query[1024], saveoid[24], @@ -2778,7 +2778,7 @@ getClientTableName(ConnectionClass * conn, char *serverTableName, BOOL * nameAll return ret; } static char * -getClientColumnName(ConnectionClass * conn, const char *serverTableName, char *serverColumnName, BOOL * nameAlloced) +getClientColumnName(ConnectionClass *conn, const char *serverTableName, char *serverColumnName, BOOL *nameAlloced) { char query[1024], saveattrelid[24], @@ -3277,7 +3277,7 @@ PGAPI_ForeignKeys( 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)); #ifdef MULTIBYTE pkey_text = getClientColumnName(conn, pk_table, pkey_ptr, &pkey_alloced); @@ -3533,7 +3533,7 @@ PGAPI_ForeignKeys( #endif /* MULTIBYTE */ mylog("pkey_ptr = '%s', fk_table = '%s', fkey_ptr = '%s'\n", pkey_text, fkt_text, fkey_text); - 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_text); set_tuplefield_null(&row->tuple[0]); diff --git a/src/interfaces/odbc/iodbc.h b/src/interfaces/odbc/iodbc.h index ca12dd0373..9d826b3e45 100644 --- a/src/interfaces/odbc/iodbc.h +++ b/src/interfaces/odbc/iodbc.h @@ -64,4 +64,5 @@ typedef int BOOL; #ifndef NULL #define NULL ((void FAR*)0UL) #endif + #endif diff --git a/src/interfaces/odbc/isql.h b/src/interfaces/odbc/isql.h index fafb01594b..ba55856096 100644 --- a/src/interfaces/odbc/isql.h +++ b/src/interfaces/odbc/isql.h @@ -236,4 +236,5 @@ extern "C" #ifdef __cplusplus } #endif + #endif diff --git a/src/interfaces/odbc/isqlext.h b/src/interfaces/odbc/isqlext.h index 83e9c83ee2..bb5292e864 100644 --- a/src/interfaces/odbc/isqlext.h +++ b/src/interfaces/odbc/isqlext.h @@ -371,13 +371,13 @@ typedef struct { SQLUINTEGER dwLowWord; SQLUINTEGER dwHighWord; -} SQLUBIGINT; +} SQLUBIGINT; typedef struct { SQLUINTEGER dwLowWord; SQLINTEGER dwHighWord; -} SQLBIGINT; +} SQLBIGINT; #endif /* GCC */ typedef struct tagDATE_STRUCT @@ -385,18 +385,18 @@ typedef struct tagDATE_STRUCT SQLSMALLINT year; SQLUSMALLINT month; SQLUSMALLINT day; -} DATE_STRUCT, +} DATE_STRUCT, - SQL_DATE_STRUCT; +SQL_DATE_STRUCT; typedef struct tagTIME_STRUCT { SQLUSMALLINT hour; SQLUSMALLINT minute; SQLUSMALLINT second; -} TIME_STRUCT, +} TIME_STRUCT, - SQL_TIME_STRUCT; +SQL_TIME_STRUCT; typedef struct tagTIMESTAMP_STRUCT { @@ -407,9 +407,9 @@ typedef struct tagTIMESTAMP_STRUCT SQLUSMALLINT minute; SQLUSMALLINT second; SQLUINTEGER fraction; -} TIMESTAMP_STRUCT, +} TIMESTAMP_STRUCT, - SQL_TIMESTAMP_STRUCT; +SQL_TIMESTAMP_STRUCT; /* postodbc doesn't use these but what the heck */ /* Don't know what SQL_MAX_NUMERIC_LEN should be so I can't include this. It's @@ -430,30 +430,30 @@ typedef struct tagSQLGUID WORD Data2; WORD Data3; BYTE Data4[8]; -} SQLGUID; +} SQLGUID; typedef enum { - SQL_IS_YEAR = 1, - SQL_IS_MONTH = 2, - SQL_IS_DAY = 3, - SQL_IS_HOUR = 4, - SQL_IS_MINUTE = 5, - SQL_IS_SECOND = 6, - SQL_IS_YEAR_TO_MONTH = 7, - SQL_IS_DAY_TO_HOUR = 8, - SQL_IS_DAY_TO_MINUTE = 9, - SQL_IS_DAY_TO_SECOND = 10, - SQL_IS_HOUR_TO_MINUTE = 11, - SQL_IS_HOUR_TO_SECOND = 12, - SQL_IS_MINUTE_TO_SECOND = 13 -} SQLINTERVAL; + SQL_IS_YEAR = 1, + SQL_IS_MONTH = 2, + SQL_IS_DAY = 3, + SQL_IS_HOUR = 4, + SQL_IS_MINUTE = 5, + SQL_IS_SECOND = 6, + SQL_IS_YEAR_TO_MONTH = 7, + SQL_IS_DAY_TO_HOUR = 8, + SQL_IS_DAY_TO_MINUTE = 9, + SQL_IS_DAY_TO_SECOND = 10, + SQL_IS_HOUR_TO_MINUTE = 11, + SQL_IS_HOUR_TO_SECOND = 12, + SQL_IS_MINUTE_TO_SECOND = 13 +} SQLINTERVAL; typedef struct tagSQL_YEAR_MONTH { SQLUINTEGER year; SQLUINTEGER month; -} SQL_YEAR_MONTH_STRUCT; +} SQL_YEAR_MONTH_STRUCT; typedef struct tagSQL_DAY_SECOND { @@ -462,7 +462,7 @@ typedef struct tagSQL_DAY_SECOND SQLUINTEGER minute; SQLUINTEGER second; SQLUINTEGER fraction; -} SQL_DAY_SECOND_STRUCT; +} SQL_DAY_SECOND_STRUCT; typedef struct tagSQL_INTERVAL_STRUCT { @@ -473,7 +473,7 @@ typedef struct tagSQL_INTERVAL_STRUCT SQL_YEAR_MONTH_STRUCT year_month; SQL_DAY_SECOND_STRUCT day_second; } intval; -} SQL_INTERVAL_STRUCT; +} SQL_INTERVAL_STRUCT; #define SQL_MAX_OPTION_STRING_LENGTH 256 #define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST - SQL_EXT_API_START + 1) @@ -1556,4 +1556,5 @@ extern "C" #ifdef __cplusplus } #endif + #endif diff --git a/src/interfaces/odbc/lobj.c b/src/interfaces/odbc/lobj.c index ab9c287e6a..6b55b82d54 100644 --- a/src/interfaces/odbc/lobj.c +++ b/src/interfaces/odbc/lobj.c @@ -18,7 +18,7 @@ Oid -lo_creat(ConnectionClass * conn, int mode) +lo_creat(ConnectionClass *conn, int mode) { LO_ARG argv[1]; int retval, @@ -36,7 +36,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; @@ -61,7 +61,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, @@ -79,7 +79,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; @@ -100,7 +100,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, @@ -125,7 +125,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, @@ -151,7 +151,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, @@ -169,7 +169,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, diff --git a/src/interfaces/odbc/lobj.h b/src/interfaces/odbc/lobj.h index f245411c2c..4d720488a0 100644 --- a/src/interfaces/odbc/lobj.h +++ b/src/interfaces/odbc/lobj.h @@ -35,12 +35,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 diff --git a/src/interfaces/odbc/misc.h b/src/interfaces/odbc/misc.h index 5237af6bbe..5cedd4c147 100644 --- a/src/interfaces/odbc/misc.h +++ b/src/interfaces/odbc/misc.h @@ -94,4 +94,5 @@ char *my_strcat(char *buf, const char *fmt, const char *s, int len); #define STRCPY_NULL (-2) int my_strcpy(char *dst, int dst_len, const char *src, int src_len); + #endif diff --git a/src/interfaces/odbc/odbcapi.c b/src/interfaces/odbc/odbcapi.c index 3b1b1a0fc3..4604c14157 100644 --- a/src/interfaces/odbc/odbcapi.c +++ b/src/interfaces/odbc/odbcapi.c @@ -37,7 +37,7 @@ #include "connection.h" #include "statement.h" -RETCODE SQL_API +RETCODE SQL_API SQLAllocConnect(HENV EnvironmentHandle, HDBC FAR * ConnectionHandle) { @@ -45,45 +45,45 @@ SQLAllocConnect(HENV EnvironmentHandle, return PGAPI_AllocConnect(EnvironmentHandle, ConnectionHandle); } -RETCODE SQL_API +RETCODE SQL_API SQLAllocEnv(HENV FAR * EnvironmentHandle) { mylog("[SQLAllocEnv]"); return PGAPI_AllocEnv(EnvironmentHandle); } -RETCODE SQL_API +RETCODE SQL_API SQLAllocStmt(HDBC ConnectionHandle, - HSTMT * StatementHandle) + HSTMT *StatementHandle) { mylog("[SQLAllocStmt]"); return PGAPI_AllocStmt(ConnectionHandle, StatementHandle); } -RETCODE SQL_API +RETCODE SQL_API SQLBindCol(HSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, PTR TargetValue, SQLINTEGER BufferLength, - SQLINTEGER * StrLen_or_Ind) + SQLINTEGER *StrLen_or_Ind) { mylog("[SQLBindCol]"); return PGAPI_BindCol(StatementHandle, ColumnNumber, TargetType, TargetValue, BufferLength, StrLen_or_Ind); } -RETCODE SQL_API +RETCODE SQL_API SQLCancel(HSTMT StatementHandle) { mylog("[SQLCancel]"); return PGAPI_Cancel(StatementHandle); } -RETCODE SQL_API +RETCODE SQL_API SQLColumns(HSTMT StatementHandle, - SQLCHAR * CatalogName, SQLSMALLINT NameLength1, - SQLCHAR * SchemaName, SQLSMALLINT NameLength2, - SQLCHAR * TableName, SQLSMALLINT NameLength3, - SQLCHAR * ColumnName, SQLSMALLINT NameLength4) + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, + SQLCHAR *ColumnName, SQLSMALLINT NameLength4) { mylog("[SQLColumns]"); return PGAPI_Columns(StatementHandle, CatalogName, NameLength1, @@ -92,18 +92,18 @@ SQLColumns(HSTMT StatementHandle, } -RETCODE SQL_API +RETCODE SQL_API SQLConnect(HDBC ConnectionHandle, - SQLCHAR * ServerName, SQLSMALLINT NameLength1, - SQLCHAR * UserName, SQLSMALLINT NameLength2, - SQLCHAR * Authentication, SQLSMALLINT NameLength3) + SQLCHAR *ServerName, SQLSMALLINT NameLength1, + SQLCHAR *UserName, SQLSMALLINT NameLength2, + SQLCHAR *Authentication, SQLSMALLINT NameLength3) { mylog("[SQLConnect]"); return PGAPI_Connect(ConnectionHandle, ServerName, NameLength1, UserName, NameLength2, Authentication, NameLength3); } -RETCODE SQL_API +RETCODE SQL_API SQLDriverConnect(HDBC hdbc, HWND hwnd, UCHAR FAR * szConnStrIn, @@ -117,26 +117,26 @@ SQLDriverConnect(HDBC hdbc, return PGAPI_DriverConnect(hdbc, hwnd, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut, fDriverCompletion); } -RETCODE SQL_API +RETCODE SQL_API SQLBrowseConnect( HDBC hdbc, - SQLCHAR * szConnStrIn, + SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, - SQLCHAR * szConnStrOut, + SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, - SQLSMALLINT * pcbConnStrOut) + SQLSMALLINT *pcbConnStrOut) { mylog("[SQLBrowseConnect]"); return PGAPI_BrowseConnect(hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut); } -RETCODE SQL_API +RETCODE SQL_API SQLDataSources(HENV EnvironmentHandle, - SQLUSMALLINT Direction, SQLCHAR * ServerName, - SQLSMALLINT BufferLength1, SQLSMALLINT * NameLength1, - SQLCHAR * Description, SQLSMALLINT BufferLength2, - SQLSMALLINT * NameLength2) + SQLUSMALLINT Direction, SQLCHAR *ServerName, + SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, + SQLCHAR *Description, SQLSMALLINT BufferLength2, + SQLSMALLINT *NameLength2) { mylog("[SQLDataSources]"); @@ -148,12 +148,12 @@ SQLDataSources(HENV EnvironmentHandle, return SQL_ERROR; } -RETCODE SQL_API +RETCODE SQL_API SQLDescribeCol(HSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLCHAR * ColumnName, - SQLSMALLINT BufferLength, SQLSMALLINT * NameLength, - SQLSMALLINT * DataType, SQLUINTEGER * ColumnSize, - SQLSMALLINT * DecimalDigits, SQLSMALLINT * Nullable) + SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, + SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize, + SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) { mylog("[SQLDescribeCol]"); return PGAPI_DescribeCol(StatementHandle, ColumnNumber, @@ -161,41 +161,41 @@ SQLDescribeCol(HSTMT StatementHandle, DataType, ColumnSize, DecimalDigits, Nullable); } -RETCODE SQL_API +RETCODE SQL_API SQLDisconnect(HDBC ConnectionHandle) { mylog("[SQLDisconnect]"); return PGAPI_Disconnect(ConnectionHandle); } -RETCODE SQL_API +RETCODE SQL_API SQLError(HENV EnvironmentHandle, HDBC ConnectionHandle, HSTMT StatementHandle, - SQLCHAR * Sqlstate, SQLINTEGER * NativeError, - SQLCHAR * MessageText, SQLSMALLINT BufferLength, - SQLSMALLINT * TextLength) + SQLCHAR *Sqlstate, SQLINTEGER *NativeError, + SQLCHAR *MessageText, SQLSMALLINT BufferLength, + SQLSMALLINT *TextLength) { mylog("[SQLError]"); return PGAPI_Error(EnvironmentHandle, ConnectionHandle, StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength); } -RETCODE SQL_API +RETCODE SQL_API SQLExecDirect(HSTMT StatementHandle, - SQLCHAR * StatementText, SQLINTEGER TextLength) + SQLCHAR *StatementText, SQLINTEGER TextLength) { mylog("[SQLExecDirect]"); return PGAPI_ExecDirect(StatementHandle, StatementText, TextLength); } -RETCODE SQL_API +RETCODE SQL_API SQLExecute(HSTMT StatementHandle) { mylog("[SQLExecute]"); return PGAPI_Execute(StatementHandle); } -RETCODE SQL_API +RETCODE SQL_API SQLFetch(HSTMT StatementHandle) { static char *func = "SQLFetch"; @@ -218,21 +218,21 @@ SQLFetch(HSTMT StatementHandle) return PGAPI_Fetch(StatementHandle); } -RETCODE SQL_API +RETCODE SQL_API SQLFreeConnect(HDBC ConnectionHandle) { mylog("[SQLFreeStmt]"); return PGAPI_FreeConnect(ConnectionHandle); } -RETCODE SQL_API +RETCODE SQL_API SQLFreeEnv(HENV EnvironmentHandle) { mylog("[SQLFreeEnv]"); return PGAPI_FreeEnv(EnvironmentHandle); } -RETCODE SQL_API +RETCODE SQL_API SQLFreeStmt(HSTMT StatementHandle, SQLUSMALLINT Option) { @@ -240,37 +240,37 @@ SQLFreeStmt(HSTMT StatementHandle, return PGAPI_FreeStmt(StatementHandle, Option); } -RETCODE SQL_API +RETCODE SQL_API SQLGetConnectOption(HDBC ConnectionHandle, SQLUSMALLINT Option, PTR Value) { mylog("[SQLGetConnectOption]"); return PGAPI_GetConnectOption(ConnectionHandle, Option, Value); } -RETCODE SQL_API +RETCODE SQL_API SQLGetCursorName(HSTMT StatementHandle, - SQLCHAR * CursorName, SQLSMALLINT BufferLength, - SQLSMALLINT * NameLength) + SQLCHAR *CursorName, SQLSMALLINT BufferLength, + SQLSMALLINT *NameLength) { mylog("[SQLGetCursorName]"); return PGAPI_GetCursorName(StatementHandle, CursorName, BufferLength, NameLength); } -RETCODE SQL_API +RETCODE SQL_API SQLGetData(HSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, PTR TargetValue, SQLINTEGER BufferLength, - SQLINTEGER * StrLen_or_Ind) + SQLINTEGER *StrLen_or_Ind) { mylog("[SQLGetData]"); return PGAPI_GetData(StatementHandle, ColumnNumber, TargetType, TargetValue, BufferLength, StrLen_or_Ind); } -RETCODE SQL_API +RETCODE SQL_API SQLGetFunctions(HDBC ConnectionHandle, - SQLUSMALLINT FunctionId, SQLUSMALLINT * Supported) + SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported) { mylog("[SQLGetFunctions]"); #if (ODBCVER >= 0x3000) @@ -279,10 +279,10 @@ SQLGetFunctions(HDBC ConnectionHandle, #endif return PGAPI_GetFunctions(ConnectionHandle, FunctionId, Supported); } -RETCODE SQL_API +RETCODE SQL_API SQLGetInfo(HDBC ConnectionHandle, SQLUSMALLINT InfoType, PTR InfoValue, - SQLSMALLINT BufferLength, SQLSMALLINT * StringLength) + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) { #if (ODBCVER >= 0x3000) RETCODE ret; @@ -303,7 +303,7 @@ SQLGetInfo(HDBC ConnectionHandle, #endif } -RETCODE SQL_API +RETCODE SQL_API SQLGetStmtOption(HSTMT StatementHandle, SQLUSMALLINT Option, PTR Value) { @@ -311,7 +311,7 @@ SQLGetStmtOption(HSTMT StatementHandle, return PGAPI_GetStmtOption(StatementHandle, Option, Value); } -RETCODE SQL_API +RETCODE SQL_API SQLGetTypeInfo(HSTMT StatementHandle, SQLSMALLINT DataType) { @@ -319,31 +319,31 @@ SQLGetTypeInfo(HSTMT StatementHandle, return PGAPI_GetTypeInfo(StatementHandle, DataType); } -RETCODE SQL_API +RETCODE SQL_API SQLNumResultCols(HSTMT StatementHandle, - SQLSMALLINT * ColumnCount) + SQLSMALLINT *ColumnCount) { mylog("[SQLNumResultCols]"); return PGAPI_NumResultCols(StatementHandle, ColumnCount); } -RETCODE SQL_API +RETCODE SQL_API SQLParamData(HSTMT StatementHandle, - PTR * Value) + PTR *Value) { mylog("[SQLParamData]"); return PGAPI_ParamData(StatementHandle, Value); } -RETCODE SQL_API +RETCODE SQL_API SQLPrepare(HSTMT StatementHandle, - SQLCHAR * StatementText, SQLINTEGER TextLength) + SQLCHAR *StatementText, SQLINTEGER TextLength) { mylog("[SQLPrepare]"); return PGAPI_Prepare(StatementHandle, StatementText, TextLength); } -RETCODE SQL_API +RETCODE SQL_API SQLPutData(HSTMT StatementHandle, PTR Data, SQLINTEGER StrLen_or_Ind) { @@ -351,15 +351,15 @@ SQLPutData(HSTMT StatementHandle, return PGAPI_PutData(StatementHandle, Data, StrLen_or_Ind); } -RETCODE SQL_API +RETCODE SQL_API SQLRowCount(HSTMT StatementHandle, - SQLINTEGER * RowCount) + SQLINTEGER *RowCount) { mylog("[SQLRowCount]"); return PGAPI_RowCount(StatementHandle, RowCount); } -RETCODE SQL_API +RETCODE SQL_API SQLSetConnectOption(HDBC ConnectionHandle, SQLUSMALLINT Option, SQLUINTEGER Value) { @@ -367,20 +367,20 @@ SQLSetConnectOption(HDBC ConnectionHandle, return PGAPI_SetConnectOption(ConnectionHandle, Option, Value); } -RETCODE SQL_API +RETCODE SQL_API SQLSetCursorName(HSTMT StatementHandle, - SQLCHAR * CursorName, SQLSMALLINT NameLength) + SQLCHAR *CursorName, SQLSMALLINT NameLength) { mylog("[SQLSetCursorName]"); return PGAPI_SetCursorName(StatementHandle, CursorName, NameLength); } -RETCODE SQL_API +RETCODE SQL_API SQLSetParam(HSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, SQLSMALLINT ParameterScale, PTR ParameterValue, - SQLINTEGER * StrLen_or_Ind) + SQLINTEGER *StrLen_or_Ind) { mylog("[SQLSetParam]"); @@ -392,7 +392,7 @@ SQLSetParam(HSTMT StatementHandle, return SQL_ERROR; } -RETCODE SQL_API +RETCODE SQL_API SQLSetStmtOption(HSTMT StatementHandle, SQLUSMALLINT Option, SQLUINTEGER Value) { @@ -400,11 +400,11 @@ SQLSetStmtOption(HSTMT StatementHandle, return PGAPI_SetStmtOption(StatementHandle, Option, Value); } -RETCODE SQL_API +RETCODE SQL_API SQLSpecialColumns(HSTMT StatementHandle, - SQLUSMALLINT IdentifierType, SQLCHAR * CatalogName, - SQLSMALLINT NameLength1, SQLCHAR * SchemaName, - SQLSMALLINT NameLength2, SQLCHAR * TableName, + SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, + SQLSMALLINT NameLength1, SQLCHAR *SchemaName, + SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, SQLUSMALLINT Nullable) { @@ -414,11 +414,11 @@ SQLSpecialColumns(HSTMT StatementHandle, Scope, Nullable); } -RETCODE SQL_API +RETCODE SQL_API SQLStatistics(HSTMT StatementHandle, - SQLCHAR * CatalogName, SQLSMALLINT NameLength1, - SQLCHAR * SchemaName, SQLSMALLINT NameLength2, - SQLCHAR * TableName, SQLSMALLINT NameLength3, + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved) { mylog("[SQLStatistics]"); @@ -427,12 +427,12 @@ SQLStatistics(HSTMT StatementHandle, Reserved); } -RETCODE SQL_API +RETCODE SQL_API SQLTables(HSTMT StatementHandle, - SQLCHAR * CatalogName, SQLSMALLINT NameLength1, - SQLCHAR * SchemaName, SQLSMALLINT NameLength2, - SQLCHAR * TableName, SQLSMALLINT NameLength3, - SQLCHAR * TableType, SQLSMALLINT NameLength4) + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, + SQLCHAR *TableType, SQLSMALLINT NameLength4) { mylog("[SQLTables]"); return PGAPI_Tables(StatementHandle, CatalogName, NameLength1, @@ -440,7 +440,7 @@ SQLTables(HSTMT StatementHandle, TableType, NameLength4); } -RETCODE SQL_API +RETCODE SQL_API SQLTransact(HENV EnvironmentHandle, HDBC ConnectionHandle, SQLUSMALLINT CompletionType) { @@ -448,31 +448,31 @@ SQLTransact(HENV EnvironmentHandle, return PGAPI_Transact(EnvironmentHandle, ConnectionHandle, CompletionType); } -RETCODE SQL_API +RETCODE SQL_API SQLColAttributes( HSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, PTR rgbDesc, SQLSMALLINT cbDescMax, - SQLSMALLINT * pcbDesc, - SQLINTEGER * pfDesc) + SQLSMALLINT *pcbDesc, + SQLINTEGER *pfDesc) { mylog("[SQLColAttributes]"); return PGAPI_ColAttributes(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); } -RETCODE SQL_API +RETCODE SQL_API SQLColumnPrivileges( HSTMT hstmt, - SQLCHAR * szCatalogName, + SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, - SQLCHAR * szSchemaName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, - SQLCHAR * szTableName, + SQLCHAR *szTableName, SQLSMALLINT cbTableName, - SQLCHAR * szColumnName, + SQLCHAR *szColumnName, SQLSMALLINT cbColumnName) { mylog("[SQLColumnPrivileges]"); @@ -481,46 +481,46 @@ SQLColumnPrivileges( szColumnName, cbColumnName); } -RETCODE SQL_API +RETCODE SQL_API SQLDescribeParam( HSTMT hstmt, SQLUSMALLINT ipar, - SQLSMALLINT * pfSqlType, - SQLUINTEGER * pcbParamDef, - SQLSMALLINT * pibScale, - SQLSMALLINT * pfNullable) + SQLSMALLINT *pfSqlType, + SQLUINTEGER *pcbParamDef, + SQLSMALLINT *pibScale, + SQLSMALLINT *pfNullable) { mylog("[SQLDescribeParam]"); return PGAPI_DescribeParam(hstmt, ipar, pfSqlType, pcbParamDef, pibScale, pfNullable); } -RETCODE SQL_API +RETCODE SQL_API SQLExtendedFetch( HSTMT hstmt, SQLUSMALLINT fFetchType, SQLINTEGER irow, - SQLUINTEGER * pcrow, - SQLUSMALLINT * rgfRowStatus) + SQLUINTEGER *pcrow, + SQLUSMALLINT *rgfRowStatus) { mylog("[SQLExtendedFetch]"); return PGAPI_ExtendedFetch(hstmt, fFetchType, irow, pcrow, rgfRowStatus); } -RETCODE SQL_API +RETCODE SQL_API SQLForeignKeys( HSTMT hstmt, - SQLCHAR * szPkCatalogName, + SQLCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, - SQLCHAR * szPkSchemaName, + SQLCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, - SQLCHAR * szPkTableName, + SQLCHAR *szPkTableName, SQLSMALLINT cbPkTableName, - SQLCHAR * szFkCatalogName, + SQLCHAR *szFkCatalogName, SQLSMALLINT cbFkCatalogName, - SQLCHAR * szFkSchemaName, + SQLCHAR *szFkSchemaName, SQLSMALLINT cbFkSchemaName, - SQLCHAR * szFkTableName, + SQLCHAR *szFkTableName, SQLSMALLINT cbFkTableName) { mylog("[SQLForeignKeys]"); @@ -530,54 +530,54 @@ SQLForeignKeys( szFkSchemaName, cbFkSchemaName, szFkTableName, cbFkTableName); } -RETCODE SQL_API +RETCODE SQL_API SQLMoreResults(HSTMT hstmt) { mylog("[SQLMoreResults]"); return PGAPI_MoreResults(hstmt); } -RETCODE SQL_API +RETCODE SQL_API SQLNativeSql( HDBC hdbc, - SQLCHAR * szSqlStrIn, + SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, - SQLCHAR * szSqlStr, + SQLCHAR *szSqlStr, SQLINTEGER cbSqlStrMax, - SQLINTEGER * pcbSqlStr) + SQLINTEGER *pcbSqlStr) { mylog("[SQLNativeSql]"); return PGAPI_NativeSql(hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); } -RETCODE SQL_API +RETCODE SQL_API SQLNumParams( HSTMT hstmt, - SQLSMALLINT * pcpar) + SQLSMALLINT *pcpar) { mylog("[SQLNumParams]"); return PGAPI_NumParams(hstmt, pcpar); } -RETCODE SQL_API +RETCODE SQL_API SQLParamOptions( HSTMT hstmt, SQLUINTEGER crow, - SQLUINTEGER * pirow) + SQLUINTEGER *pirow) { mylog("[SQLParamOptions]"); return PGAPI_ParamOptions(hstmt, crow, pirow); } -RETCODE SQL_API +RETCODE SQL_API SQLPrimaryKeys( HSTMT hstmt, - SQLCHAR * szCatalogName, + SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, - SQLCHAR * szSchemaName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, - SQLCHAR * szTableName, + SQLCHAR *szTableName, SQLSMALLINT cbTableName) { mylog("[SQLPrimaryKeys]"); @@ -585,16 +585,16 @@ SQLPrimaryKeys( szSchemaName, cbSchemaName, szTableName, cbTableName); } -RETCODE SQL_API +RETCODE SQL_API SQLProcedureColumns( HSTMT hstmt, - SQLCHAR * szCatalogName, + SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, - SQLCHAR * szSchemaName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, - SQLCHAR * szProcName, + SQLCHAR *szProcName, SQLSMALLINT cbProcName, - SQLCHAR * szColumnName, + SQLCHAR *szColumnName, SQLSMALLINT cbColumnName) { mylog("[SQLProcedureColumns]"); @@ -603,14 +603,14 @@ SQLProcedureColumns( szColumnName, cbColumnName); } -RETCODE SQL_API +RETCODE SQL_API SQLProcedures( HSTMT hstmt, - SQLCHAR * szCatalogName, + SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, - SQLCHAR * szSchemaName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, - SQLCHAR * szProcName, + SQLCHAR *szProcName, SQLSMALLINT cbProcName) { mylog("[SQLProcedures]"); @@ -618,7 +618,7 @@ SQLProcedures( szSchemaName, cbSchemaName, szProcName, cbProcName); } -RETCODE SQL_API +RETCODE SQL_API SQLSetPos( HSTMT hstmt, SQLUSMALLINT irow, @@ -629,14 +629,14 @@ SQLSetPos( return PGAPI_SetPos(hstmt, irow, fOption, fLock); } -RETCODE SQL_API +RETCODE SQL_API SQLTablePrivileges( HSTMT hstmt, - SQLCHAR * szCatalogName, + SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, - SQLCHAR * szSchemaName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, - SQLCHAR * szTableName, + SQLCHAR *szTableName, SQLSMALLINT cbTableName) { mylog("[SQLTablePrivileges]"); @@ -644,7 +644,7 @@ SQLTablePrivileges( szSchemaName, cbSchemaName, szTableName, cbTableName); } -RETCODE SQL_API +RETCODE SQL_API SQLBindParameter( HSTMT hstmt, SQLUSMALLINT ipar, @@ -655,7 +655,7 @@ SQLBindParameter( SQLSMALLINT ibScale, PTR rgbValue, SQLINTEGER cbValueMax, - SQLINTEGER * pcbValue) + SQLINTEGER *pcbValue) { mylog("[SQLBindParameter]"); return PGAPI_BindParameter(hstmt, ipar, fParamType, fCType, diff --git a/src/interfaces/odbc/odbcapi30.c b/src/interfaces/odbc/odbcapi30.c index ccd214a69d..161940aed8 100644 --- a/src/interfaces/odbc/odbcapi30.c +++ b/src/interfaces/odbc/odbcapi30.c @@ -29,7 +29,7 @@ #include "pgapifunc.h" /* SQLAllocConnect/SQLAllocEnv/SQLAllocStmt -> SQLAllocHandle */ -RETCODE SQL_API +RETCODE SQL_API SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE * OutputHandle) { @@ -49,12 +49,12 @@ SQLAllocHandle(SQLSMALLINT HandleType, } /* SQLBindParameter/SQLSetParam -> SQLBindParam */ -RETCODE SQL_API +RETCODE SQL_API SQLBindParam(HSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, SQLSMALLINT ParameterScale, PTR ParameterValue, - SQLINTEGER * StrLen_or_Ind) + SQLINTEGER *StrLen_or_Ind) { int BufferLength = 512; /* Is it OK ? */ @@ -63,7 +63,7 @@ SQLBindParam(HSTMT StatementHandle, } /* New function */ -RETCODE SQL_API +RETCODE SQL_API SQLCloseCursor(HSTMT StatementHandle) { mylog("[[SQLCloseCursor]]"); @@ -71,11 +71,11 @@ SQLCloseCursor(HSTMT StatementHandle) } /* SQLColAttributes -> SQLColAttribute */ -RETCODE SQL_API +RETCODE SQL_API SQLColAttribute(HSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, PTR CharacterAttribute, SQLSMALLINT BufferLength, - SQLSMALLINT * StringLength, PTR NumericAttribute) + SQLSMALLINT *StringLength, PTR NumericAttribute) { mylog("[[SQLColAttribute]]"); return PGAPI_ColAttributes(StatementHandle, ColumnNumber, @@ -84,7 +84,7 @@ SQLColAttribute(HSTMT StatementHandle, } /* new function */ -RETCODE SQL_API +RETCODE SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle) { @@ -93,7 +93,7 @@ SQLCopyDesc(SQLHDESC SourceDescHandle, } /* SQLTransact -> SQLEndTran */ -RETCODE SQL_API +RETCODE SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType) { @@ -113,7 +113,7 @@ SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, } /* SQLExtendedFetch -> SQLFetchScroll */ -RETCODE SQL_API +RETCODE SQL_API SQLFetchScroll(HSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLINTEGER FetchOffset) { @@ -144,7 +144,7 @@ SQLFetchScroll(HSTMT StatementHandle, } /* SQLFree(Connect/Env/Stmt) -> SQLFreeHandle */ -RETCODE SQL_API +RETCODE SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) { mylog("[[SQLFreeHandle]]"); @@ -163,46 +163,46 @@ SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) } /* new function */ -RETCODE SQL_API +RETCODE SQL_API SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, PTR Value, SQLINTEGER BufferLength, - SQLINTEGER * StringLength) + SQLINTEGER *StringLength) { mylog("[[SQLGetDescField]]\n"); return SQL_ERROR; } /* new function */ -RETCODE SQL_API +RETCODE SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLCHAR * Name, - SQLSMALLINT BufferLength, SQLSMALLINT * StringLength, - SQLSMALLINT * Type, SQLSMALLINT * SubType, - SQLINTEGER * Length, SQLSMALLINT * Precision, - SQLSMALLINT * Scale, SQLSMALLINT * Nullable) + SQLSMALLINT RecNumber, SQLCHAR *Name, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, + SQLSMALLINT *Type, SQLSMALLINT *SubType, + SQLINTEGER *Length, SQLSMALLINT *Precision, + SQLSMALLINT *Scale, SQLSMALLINT *Nullable) { mylog("[[SQLGetDescRec]]\n"); return SQL_ERROR; } /* new function */ -RETCODE SQL_API +RETCODE SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, PTR DiagInfo, SQLSMALLINT BufferLength, - SQLSMALLINT * StringLength) + SQLSMALLINT *StringLength) { mylog("[[SQLGetDiagField]]\n"); return SQL_ERROR; } /* SQLError -> SQLDiagRec */ -RETCODE SQL_API +RETCODE SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, - SQLSMALLINT RecNumber, SQLCHAR * Sqlstate, - SQLINTEGER * NativeError, SQLCHAR * MessageText, - SQLSMALLINT BufferLength, SQLSMALLINT * TextLength) + SQLSMALLINT RecNumber, SQLCHAR *Sqlstate, + SQLINTEGER *NativeError, SQLCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) { RETCODE ret; @@ -240,10 +240,10 @@ SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, } /* new function */ -RETCODE SQL_API +RETCODE SQL_API SQLGetEnvAttr(HENV EnvironmentHandle, SQLINTEGER Attribute, PTR Value, - SQLINTEGER BufferLength, SQLINTEGER * StringLength) + SQLINTEGER BufferLength, SQLINTEGER *StringLength) { EnvironmentClass *env = (EnvironmentClass *) EnvironmentHandle; @@ -270,10 +270,10 @@ SQLGetEnvAttr(HENV EnvironmentHandle, } /* SQLGetConnectOption -> SQLGetconnectAttr */ -RETCODE SQL_API +RETCODE SQL_API SQLGetConnectAttr(HDBC ConnectionHandle, SQLINTEGER Attribute, PTR Value, - SQLINTEGER BufferLength, SQLINTEGER * StringLength) + SQLINTEGER BufferLength, SQLINTEGER *StringLength) { ConnectionClass *conn = (ConnectionClass *) ConnectionHandle; @@ -293,10 +293,10 @@ SQLGetConnectAttr(HDBC ConnectionHandle, } /* SQLGetStmtOption -> SQLGetStmtAttr */ -RETCODE SQL_API +RETCODE SQL_API SQLGetStmtAttr(HSTMT StatementHandle, SQLINTEGER Attribute, PTR Value, - SQLINTEGER BufferLength, SQLINTEGER * StringLength) + SQLINTEGER BufferLength, SQLINTEGER *StringLength) { static char *func = "SQLGetStmtAttr"; StatementClass *stmt = (StatementClass *) StatementHandle; @@ -341,7 +341,7 @@ SQLGetStmtAttr(HSTMT StatementHandle, *((HSTMT *) Value) = StatementHandle; /* this is useless */ len = 4; break; - case SQL_ATTR_AUTO_IPD:/* 10001 */ + case SQL_ATTR_AUTO_IPD: /* 10001 */ case SQL_ATTR_ROW_BIND_TYPE: /* == SQL_BIND_TYPE */ case SQL_ATTR_PARAMSET_SIZE: /* 22 */ case SQL_ATTR_PARAM_STATUS_PTR: /* 20 */ @@ -376,7 +376,7 @@ SQLGetStmtAttr(HSTMT StatementHandle, } /* SQLSetConnectOption -> SQLSetConnectAttr */ -RETCODE SQL_API +RETCODE SQL_API SQLSetConnectAttr(HDBC ConnectionHandle, SQLINTEGER Attribute, PTR Value, SQLINTEGER StringLength) @@ -399,7 +399,7 @@ SQLSetConnectAttr(HDBC ConnectionHandle, } /* new function */ -RETCODE SQL_API +RETCODE SQL_API SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, PTR Value, SQLINTEGER BufferLength) @@ -409,20 +409,20 @@ SQLSetDescField(SQLHDESC DescriptorHandle, } /* new fucntion */ -RETCODE SQL_API +RETCODE SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT Type, SQLSMALLINT SubType, SQLINTEGER Length, SQLSMALLINT Precision, SQLSMALLINT Scale, - PTR Data, SQLINTEGER * StringLength, - SQLINTEGER * Indicator) + PTR Data, SQLINTEGER *StringLength, + SQLINTEGER *Indicator) { mylog("[[SQLsetDescRec]]\n"); return SQL_ERROR; } /* new function */ -RETCODE SQL_API +RETCODE SQL_API SQLSetEnvAttr(HENV EnvironmentHandle, SQLINTEGER Attribute, PTR Value, SQLINTEGER StringLength) @@ -457,7 +457,7 @@ SQLSetEnvAttr(HENV EnvironmentHandle, } /* SQLSet(Param/Scroll/Stmt)Option -> SQLSetStmtAttr */ -RETCODE SQL_API +RETCODE SQL_API SQLSetStmtAttr(HSTMT StatementHandle, SQLINTEGER Attribute, PTR Value, SQLINTEGER StringLength) @@ -481,8 +481,8 @@ SQLSetStmtAttr(HSTMT StatementHandle, case SQL_ATTR_APP_ROW_DESC: /* 10010 */ case SQL_ATTR_APP_PARAM_DESC: /* 10011 */ - case SQL_ATTR_AUTO_IPD:/* 10001 */ - /* case SQL_ATTR_ROW_BIND_TYPE: *//* == SQL_BIND_TYPE */ + case SQL_ATTR_AUTO_IPD: /* 10001 */ + /* case SQL_ATTR_ROW_BIND_TYPE: */ /* == SQL_BIND_TYPE */ case SQL_ATTR_IMP_ROW_DESC: /* 10012 */ case SQL_ATTR_IMP_PARAM_DESC: /* 10013 */ case SQL_ATTR_METADATA_ID: /* 10014 */ @@ -607,7 +607,7 @@ PGAPI_GetFunctions30(HDBC hdbc, UWORD fFunction, UWORD FAR * pfExists) SQL_FUNC_ESET(pfExists, SQL_API_SQLSETPOS); /* 68 */ SQL_FUNC_ESET(pfExists, SQL_API_SQLSETSCROLLOPTIONS); /* 69 deprecated */ SQL_FUNC_ESET(pfExists, SQL_API_SQLTABLEPRIVILEGES); /* 70 */ - /* SQL_FUNC_ESET(pfExists, SQL_API_SQLDRIVERS); *//* 71 */ + /* SQL_FUNC_ESET(pfExists, SQL_API_SQLDRIVERS); */ /* 71 */ SQL_FUNC_ESET(pfExists, SQL_API_SQLBINDPARAMETER); /* 72 */ SQL_FUNC_ESET(pfExists, SQL_API_SQLALLOCHANDLE); /* 1001 */ diff --git a/src/interfaces/odbc/options.c b/src/interfaces/odbc/options.c index 5668d8f2d1..04331456c9 100644 --- a/src/interfaces/odbc/options.c +++ b/src/interfaces/odbc/options.c @@ -24,15 +24,15 @@ -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) { @@ -173,12 +173,12 @@ set_statement_option(ConnectionClass * conn, mylog("SetStmtOption: SQL_NOSCAN, vParam = %d\n", vParam); break; - case SQL_QUERY_TIMEOUT:/* ignored */ + case SQL_QUERY_TIMEOUT: /* ignored */ mylog("SetStmtOption: SQL_QUERY_TIMEOUT, vParam = %d\n", vParam); /* "0" returned in SQLGetStmtOption */ break; - case SQL_RETRIEVE_DATA:/* ignored, but saved */ + case SQL_RETRIEVE_DATA: /* ignored, but saved */ mylog("SetStmtOption(): SQL_RETRIEVE_DATA, vParam = %d\n", vParam); if (conn) conn->stmtOptions.retrieve_data = vParam; @@ -373,7 +373,7 @@ PGAPI_SetConnectOption( case SQL_CURRENT_QUALIFIER: /* ignored */ break; - case SQL_LOGIN_TIMEOUT:/* ignored */ + case SQL_LOGIN_TIMEOUT: /* ignored */ break; case SQL_PACKET_SIZE: /* ignored */ @@ -382,7 +382,7 @@ PGAPI_SetConnectOption( case SQL_QUIET_MODE: /* ignored */ break; - case SQL_TXN_ISOLATION:/* ignored */ + case SQL_TXN_ISOLATION: /* ignored */ break; /* These options should be handled by driver manager */ @@ -462,7 +462,7 @@ PGAPI_GetConnectOption( break; - case SQL_LOGIN_TIMEOUT:/* NOT SUPPORTED */ + case SQL_LOGIN_TIMEOUT: /* NOT SUPPORTED */ *((UDWORD *) pvParam) = 0; break; @@ -474,7 +474,7 @@ PGAPI_GetConnectOption( *((UDWORD *) pvParam) = (UDWORD) NULL; break; - case SQL_TXN_ISOLATION:/* NOT SUPPORTED */ + case SQL_TXN_ISOLATION: /* NOT SUPPORTED */ *((UDWORD *) pvParam) = SQL_TXN_SERIALIZABLE; break; @@ -632,11 +632,11 @@ PGAPI_GetStmtOption( *((SDWORD *) pvParam) = SQL_NOSCAN_ON; break; - case SQL_QUERY_TIMEOUT:/* NOT SUPPORTED */ + case SQL_QUERY_TIMEOUT: /* NOT SUPPORTED */ *((SDWORD *) pvParam) = 0; break; - case SQL_RETRIEVE_DATA:/* NOT SUPPORTED, but saved */ + case SQL_RETRIEVE_DATA: /* NOT SUPPORTED, but saved */ *((SDWORD *) pvParam) = stmt->options.retrieve_data; break; diff --git a/src/interfaces/odbc/parse.c b/src/interfaces/odbc/parse.c index 60d16d5c1c..8a90cce35a 100644 --- a/src/interfaces/odbc/parse.c +++ b/src/interfaces/odbc/parse.c @@ -43,8 +43,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 * @@ -216,7 +216,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) { char *str; @@ -236,7 +236,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, cmp; @@ -265,7 +265,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]; diff --git a/src/interfaces/odbc/pgapifunc.h b/src/interfaces/odbc/pgapifunc.h index 465808f0ea..dadabe1fac 100644 --- a/src/interfaces/odbc/pgapifunc.h +++ b/src/interfaces/odbc/pgapifunc.h @@ -15,47 +15,47 @@ RETCODE SQL_API PGAPI_AllocConnect(HENV EnvironmentHandle, HDBC FAR * ConnectionHandle); RETCODE SQL_API PGAPI_AllocEnv(HENV FAR * EnvironmentHandle); RETCODE SQL_API PGAPI_AllocStmt(HDBC ConnectionHandle, - HSTMT * StatementHandle); + HSTMT *StatementHandle); RETCODE SQL_API PGAPI_BindCol(HSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, PTR TargetValue, SQLINTEGER BufferLength, - SQLINTEGER * StrLen_or_Ind); + SQLINTEGER *StrLen_or_Ind); RETCODE SQL_API PGAPI_Cancel(HSTMT StatementHandle); RETCODE SQL_API PGAPI_Columns(HSTMT StatementHandle, - SQLCHAR * CatalogName, SQLSMALLINT NameLength1, - SQLCHAR * SchemaName, SQLSMALLINT NameLength2, - SQLCHAR * TableName, SQLSMALLINT NameLength3, - SQLCHAR * ColumnName, SQLSMALLINT NameLength4); + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, + SQLCHAR *ColumnName, SQLSMALLINT NameLength4); RETCODE SQL_API PGAPI_Connect(HDBC ConnectionHandle, - SQLCHAR * ServerName, SQLSMALLINT NameLength1, - SQLCHAR * UserName, SQLSMALLINT NameLength2, - SQLCHAR * Authentication, SQLSMALLINT NameLength3); + SQLCHAR *ServerName, SQLSMALLINT NameLength1, + SQLCHAR *UserName, SQLSMALLINT NameLength2, + SQLCHAR *Authentication, SQLSMALLINT NameLength3); RETCODE SQL_API PGAPI_DriverConnect(HDBC hdbc, HWND hwnd, UCHAR FAR * szConnStrIn, SWORD cbConnStrIn, UCHAR FAR * szConnStrOut, SWORD cbConnStrOutMax, SWORD FAR * pcbConnStrOut, UWORD fDriverCompletion); RETCODE SQL_API PGAPI_BrowseConnect(HDBC hdbc, - SQLCHAR * szConnStrIn, SQLSMALLINT cbConnStrIn, - SQLCHAR * szConnStrOut, SQLSMALLINT cbConnStrOutMax, - SQLSMALLINT * pcbConnStrOut); + SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, + SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT *pcbConnStrOut); RETCODE SQL_API PGAPI_DataSources(HENV EnvironmentHandle, - SQLUSMALLINT Direction, SQLCHAR * ServerName, - SQLSMALLINT BufferLength1, SQLSMALLINT * NameLength1, - SQLCHAR * Description, SQLSMALLINT BufferLength2, - SQLSMALLINT * NameLength2); + SQLUSMALLINT Direction, SQLCHAR *ServerName, + SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, + SQLCHAR *Description, SQLSMALLINT BufferLength2, + SQLSMALLINT *NameLength2); RETCODE SQL_API PGAPI_DescribeCol(HSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLCHAR * ColumnName, - SQLSMALLINT BufferLength, SQLSMALLINT * NameLength, - SQLSMALLINT * DataType, SQLUINTEGER * ColumnSize, - SQLSMALLINT * DecimalDigits, SQLSMALLINT * Nullable); + SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, + SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize, + SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable); RETCODE SQL_API PGAPI_Disconnect(HDBC ConnectionHandle); RETCODE SQL_API PGAPI_Error(HENV EnvironmentHandle, HDBC ConnectionHandle, HSTMT StatementHandle, - SQLCHAR * Sqlstate, SQLINTEGER * NativeError, - SQLCHAR * MessageText, SQLSMALLINT BufferLength, - SQLSMALLINT * TextLength); + SQLCHAR *Sqlstate, SQLINTEGER *NativeError, + SQLCHAR *MessageText, SQLSMALLINT BufferLength, + SQLSMALLINT *TextLength); RETCODE SQL_API PGAPI_ExecDirect(HSTMT StatementHandle, - SQLCHAR * StatementText, SQLINTEGER TextLength); + SQLCHAR *StatementText, SQLINTEGER TextLength); RETCODE SQL_API PGAPI_Execute(HSTMT StatementHandle); RETCODE SQL_API PGAPI_Fetch(HSTMT StatementHandle); RETCODE SQL_API PGAPI_FreeConnect(HDBC ConnectionHandle); @@ -65,63 +65,63 @@ RETCODE SQL_API PGAPI_FreeStmt(HSTMT StatementHandle, RETCODE SQL_API PGAPI_GetConnectOption(HDBC ConnectionHandle, SQLUSMALLINT Option, PTR Value); RETCODE SQL_API PGAPI_GetCursorName(HSTMT StatementHandle, - SQLCHAR * CursorName, SQLSMALLINT BufferLength, - SQLSMALLINT * NameLength); + SQLCHAR *CursorName, SQLSMALLINT BufferLength, + SQLSMALLINT *NameLength); RETCODE SQL_API PGAPI_GetData(HSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, PTR TargetValue, SQLINTEGER BufferLength, - SQLINTEGER * StrLen_or_Ind); + SQLINTEGER *StrLen_or_Ind); RETCODE SQL_API PGAPI_GetFunctions(HDBC ConnectionHandle, - SQLUSMALLINT FunctionId, SQLUSMALLINT * Supported); + SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); RETCODE SQL_API PGAPI_GetFunctions30(HDBC ConnectionHandle, - SQLUSMALLINT FunctionId, SQLUSMALLINT * Supported); + SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); RETCODE SQL_API PGAPI_GetInfo(HDBC ConnectionHandle, SQLUSMALLINT InfoType, PTR InfoValue, - SQLSMALLINT BufferLength, SQLSMALLINT * StringLength); + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength); RETCODE SQL_API PGAPI_GetInfo30(HDBC ConnectionHandle, SQLUSMALLINT InfoType, PTR InfoValue, - SQLSMALLINT BufferLength, SQLSMALLINT * StringLength); + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength); RETCODE SQL_API PGAPI_GetStmtOption(HSTMT StatementHandle, SQLUSMALLINT Option, PTR Value); RETCODE SQL_API PGAPI_GetTypeInfo(HSTMT StatementHandle, SQLSMALLINT DataType); RETCODE SQL_API PGAPI_NumResultCols(HSTMT StatementHandle, - SQLSMALLINT * ColumnCount); + SQLSMALLINT *ColumnCount); RETCODE SQL_API PGAPI_ParamData(HSTMT StatementHandle, - PTR * Value); + PTR *Value); RETCODE SQL_API PGAPI_Prepare(HSTMT StatementHandle, - SQLCHAR * StatementText, SQLINTEGER TextLength); + SQLCHAR *StatementText, SQLINTEGER TextLength); RETCODE SQL_API PGAPI_PutData(HSTMT StatementHandle, PTR Data, SQLINTEGER StrLen_or_Ind); RETCODE SQL_API PGAPI_RowCount(HSTMT StatementHandle, - SQLINTEGER * RowCount); + SQLINTEGER *RowCount); RETCODE SQL_API PGAPI_SetConnectOption(HDBC ConnectionHandle, SQLUSMALLINT Option, SQLUINTEGER Value); RETCODE SQL_API PGAPI_SetCursorName(HSTMT StatementHandle, - SQLCHAR * CursorName, SQLSMALLINT NameLength); + SQLCHAR *CursorName, SQLSMALLINT NameLength); RETCODE SQL_API PGAPI_SetParam(HSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, SQLSMALLINT ParameterScale, PTR ParameterValue, - SQLINTEGER * StrLen_or_Ind); + SQLINTEGER *StrLen_or_Ind); RETCODE SQL_API PGAPI_SetStmtOption(HSTMT StatementHandle, SQLUSMALLINT Option, SQLUINTEGER Value); RETCODE SQL_API PGAPI_SpecialColumns(HSTMT StatementHandle, - SQLUSMALLINT IdentifierType, SQLCHAR * CatalogName, - SQLSMALLINT NameLength1, SQLCHAR * SchemaName, - SQLSMALLINT NameLength2, SQLCHAR * TableName, + SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, + SQLSMALLINT NameLength1, SQLCHAR *SchemaName, + SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, SQLUSMALLINT Nullable); RETCODE SQL_API PGAPI_Statistics(HSTMT StatementHandle, - SQLCHAR * CatalogName, SQLSMALLINT NameLength1, - SQLCHAR * SchemaName, SQLSMALLINT NameLength2, - SQLCHAR * TableName, SQLSMALLINT NameLength3, + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved); RETCODE SQL_API PGAPI_Tables(HSTMT StatementHandle, - SQLCHAR * CatalogName, SQLSMALLINT NameLength1, - SQLCHAR * SchemaName, SQLSMALLINT NameLength2, - SQLCHAR * TableName, SQLSMALLINT NameLength3, - SQLCHAR * TableType, SQLSMALLINT NameLength4); + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, + SQLCHAR *TableType, SQLSMALLINT NameLength4); RETCODE SQL_API PGAPI_Transact(HENV EnvironmentHandle, HDBC ConnectionHandle, SQLUSMALLINT CompletionType); RETCODE SQL_API PGAPI_ColAttributes( @@ -130,86 +130,86 @@ RETCODE SQL_API PGAPI_ColAttributes( SQLUSMALLINT fDescType, PTR rgbDesc, SQLSMALLINT cbDescMax, - SQLSMALLINT * pcbDesc, - SQLINTEGER * pfDesc); + SQLSMALLINT *pcbDesc, + SQLINTEGER *pfDesc); RETCODE SQL_API PGAPI_ColumnPrivileges( HSTMT hstmt, - SQLCHAR * szCatalogName, + SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, - SQLCHAR * szSchemaName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, - SQLCHAR * szTableName, + SQLCHAR *szTableName, SQLSMALLINT cbTableName, - SQLCHAR * szColumnName, + SQLCHAR *szColumnName, SQLSMALLINT cbColumnName); RETCODE SQL_API PGAPI_DescribeParam( HSTMT hstmt, SQLUSMALLINT ipar, - SQLSMALLINT * pfSqlType, - SQLUINTEGER * pcbParamDef, - SQLSMALLINT * pibScale, - SQLSMALLINT * pfNullable); + SQLSMALLINT *pfSqlType, + SQLUINTEGER *pcbParamDef, + SQLSMALLINT *pibScale, + SQLSMALLINT *pfNullable); RETCODE SQL_API PGAPI_ExtendedFetch( HSTMT hstmt, SQLUSMALLINT fFetchType, SQLINTEGER irow, - SQLUINTEGER * pcrow, - SQLUSMALLINT * rgfRowStatus); + SQLUINTEGER *pcrow, + SQLUSMALLINT *rgfRowStatus); RETCODE SQL_API PGAPI_ForeignKeys( HSTMT hstmt, - SQLCHAR * szPkCatalogName, + SQLCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, - SQLCHAR * szPkSchemaName, + SQLCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, - SQLCHAR * szPkTableName, + SQLCHAR *szPkTableName, SQLSMALLINT cbPkTableName, - SQLCHAR * szFkCatalogName, + SQLCHAR *szFkCatalogName, SQLSMALLINT cbFkCatalogName, - SQLCHAR * szFkSchemaName, + SQLCHAR *szFkSchemaName, SQLSMALLINT cbFkSchemaName, - SQLCHAR * szFkTableName, + SQLCHAR *szFkTableName, SQLSMALLINT cbFkTableName); RETCODE SQL_API PGAPI_MoreResults( HSTMT hstmt); RETCODE SQL_API PGAPI_NativeSql( HDBC hdbc, - SQLCHAR * szSqlStrIn, + SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, - SQLCHAR * szSqlStr, + SQLCHAR *szSqlStr, SQLINTEGER cbSqlStrMax, - SQLINTEGER * pcbSqlStr); + SQLINTEGER *pcbSqlStr); RETCODE SQL_API PGAPI_NumParams( HSTMT hstmt, - SQLSMALLINT * pcpar); + SQLSMALLINT *pcpar); RETCODE SQL_API PGAPI_ParamOptions( HSTMT hstmt, SQLUINTEGER crow, - SQLUINTEGER * pirow); + SQLUINTEGER *pirow); RETCODE SQL_API PGAPI_PrimaryKeys( HSTMT hstmt, - SQLCHAR * szCatalogName, + SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, - SQLCHAR * szSchemaName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, - SQLCHAR * szTableName, + SQLCHAR *szTableName, SQLSMALLINT cbTableName); RETCODE SQL_API PGAPI_ProcedureColumns( HSTMT hstmt, - SQLCHAR * szCatalogName, + SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, - SQLCHAR * szSchemaName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, - SQLCHAR * szProcName, + SQLCHAR *szProcName, SQLSMALLINT cbProcName, - SQLCHAR * szColumnName, + SQLCHAR *szColumnName, SQLSMALLINT cbColumnName); RETCODE SQL_API PGAPI_Procedures( HSTMT hstmt, - SQLCHAR * szCatalogName, + SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, - SQLCHAR * szSchemaName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, - SQLCHAR * szProcName, + SQLCHAR *szProcName, SQLSMALLINT cbProcName); RETCODE SQL_API PGAPI_SetPos( HSTMT hstmt, @@ -218,11 +218,11 @@ RETCODE SQL_API PGAPI_SetPos( SQLUSMALLINT fLock); RETCODE SQL_API PGAPI_TablePrivileges( HSTMT hstmt, - SQLCHAR * szCatalogName, + SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, - SQLCHAR * szSchemaName, + SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, - SQLCHAR * szTableName, + SQLCHAR *szTableName, SQLSMALLINT cbTableName); RETCODE SQL_API PGAPI_BindParameter( HSTMT hstmt, @@ -234,10 +234,11 @@ RETCODE SQL_API PGAPI_BindParameter( SQLSMALLINT ibScale, PTR rgbValue, SQLINTEGER cbValueMax, - SQLINTEGER * pcbValue); + SQLINTEGER *pcbValue); RETCODE SQL_API PGAPI_SetScrollOptions( HSTMT hstmt, UWORD fConcurrency, SDWORD crowKeyset, UWORD crowRowset); + #endif /* define_PG_API_FUNC_H__ */ diff --git a/src/interfaces/odbc/pgtypes.c b/src/interfaces/odbc/pgtypes.c index 6f1282a36c..1f177a10c4 100644 --- a/src/interfaces/odbc/pgtypes.c +++ b/src/interfaces/odbc/pgtypes.c @@ -25,7 +25,7 @@ -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 @@ -94,7 +94,7 @@ Int2 sqlTypes[] = { Int4 -sqltype_to_pgtype(StatementClass * stmt, SWORD fSqlType) +sqltype_to_pgtype(StatementClass *stmt, SWORD fSqlType) { Int4 pgType; ConnInfo *ci = &(SC_get_conn(stmt)->connInfo); @@ -190,7 +190,7 @@ sqltype_to_pgtype(StatementClass * stmt, 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) { ConnInfo *ci = &(SC_get_conn(stmt)->connInfo); @@ -266,7 +266,7 @@ pgtype_to_sqltype(StatementClass * stmt, Int4 type) Int2 -pgtype_to_ctype(StatementClass * stmt, Int4 type) +pgtype_to_ctype(StatementClass *stmt, Int4 type) { ConnInfo *ci = &(SC_get_conn(stmt)->connInfo); @@ -315,7 +315,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) { @@ -384,7 +384,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; @@ -421,7 +421,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; @@ -458,7 +458,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; @@ -545,7 +545,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) { @@ -612,7 +612,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) { @@ -653,7 +653,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) { @@ -706,7 +706,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) { @@ -740,7 +740,7 @@ pgtype_scale(StatementClass * stmt, Int4 type, int col) Int2 -pgtype_radix(StatementClass * stmt, Int4 type) +pgtype_radix(StatementClass *stmt, Int4 type) { switch (type) { @@ -760,14 +760,14 @@ 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) { @@ -796,7 +796,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) { @@ -819,7 +819,7 @@ pgtype_case_sensitive(StatementClass * stmt, Int4 type) Int2 -pgtype_money(StatementClass * stmt, Int4 type) +pgtype_money(StatementClass *stmt, Int4 type) { switch (type) { @@ -832,7 +832,7 @@ pgtype_money(StatementClass * stmt, Int4 type) Int2 -pgtype_searchable(StatementClass * stmt, Int4 type) +pgtype_searchable(StatementClass *stmt, Int4 type) { switch (type) { @@ -854,7 +854,7 @@ pgtype_searchable(StatementClass * stmt, Int4 type) Int2 -pgtype_unsigned(StatementClass * stmt, Int4 type) +pgtype_unsigned(StatementClass *stmt, Int4 type) { switch (type) { @@ -878,7 +878,7 @@ pgtype_unsigned(StatementClass * stmt, Int4 type) char * -pgtype_literal_prefix(StatementClass * stmt, Int4 type) +pgtype_literal_prefix(StatementClass *stmt, Int4 type) { switch (type) { @@ -900,7 +900,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) { @@ -922,7 +922,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) { diff --git a/src/interfaces/odbc/pgtypes.h b/src/interfaces/odbc/pgtypes.h index 6761ec319e..7bd33cf751 100644 --- a/src/interfaces/odbc/pgtypes.h +++ b/src/interfaces/odbc/pgtypes.h @@ -68,29 +68,30 @@ extern Int2 sqlTypes[]; /* Defines for pgtype_precision */ #define PG_STATIC (-1) -Int4 sqltype_to_pgtype(StatementClass * stmt, Int2 fSqlType); +Int4 sqltype_to_pgtype(StatementClass *stmt, 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); Int4 ctype_length(Int2 ctype); + #endif diff --git a/src/interfaces/odbc/psqlodbc.h b/src/interfaces/odbc/psqlodbc.h index 514922036b..540e295d56 100644 --- a/src/interfaces/odbc/psqlodbc.h +++ b/src/interfaces/odbc/psqlodbc.h @@ -5,7 +5,7 @@ * * Comments: See "notice.txt" for copyright and license information. * - * $Id: psqlodbc.h,v 1.52 2001/10/25 05:50:15 momjian Exp $ + * $Id: psqlodbc.h,v 1.53 2001/10/28 06:26:14 momjian Exp $ * */ @@ -185,7 +185,7 @@ typedef struct GlobalValues_ char extra_systable_prefixes[MEDIUM_REGISTRY_LEN]; char conn_settings[LARGE_REGISTRY_LEN]; char protocol[SMALL_REGISTRY_LEN]; -} GLOBAL_VALUES; +} GLOBAL_VALUES; typedef struct StatementOptions_ { @@ -202,7 +202,7 @@ typedef struct StatementOptions_ UInt4 *rowsFetched; UInt2 *rowStatusArray; void *bookmark_ptr; -} StatementOptions; +} StatementOptions; /* Used to pass extra query info to send_query */ typedef struct QueryInfo_ @@ -210,7 +210,7 @@ typedef struct QueryInfo_ int row_size; QResultClass *result_in; char *cursor; -} QueryInfo; +} QueryInfo; void logs_on_off(int cnopen, int, int); @@ -249,4 +249,5 @@ void debug_memory_check(void); #define strdup debug_strdup #define free debug_free #endif /* _MEMORY_DEBUG_ */ + #endif diff --git a/src/interfaces/odbc/qresult.c b/src/interfaces/odbc/qresult.c index b9f088227f..ca7a6dee9e 100644 --- a/src/interfaces/odbc/qresult.c +++ b/src/interfaces/odbc/qresult.c @@ -39,7 +39,7 @@ * 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"); @@ -54,28 +54,28 @@ 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; } @@ -128,7 +128,7 @@ QR_Constructor() void -QR_Destructor(QResultClass * self) +QR_Destructor(QResultClass *self) { mylog("QResult: in DESTRUCTOR\n"); @@ -168,7 +168,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); @@ -178,7 +178,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); @@ -188,7 +188,7 @@ QR_set_notice(QResultClass * self, char *msg) void -QR_free_memory(QResultClass * self) +QR_free_memory(QResultClass *self) { register int lf, row; @@ -211,7 +211,7 @@ QR_free_memory(QResultClass * self) free(tuple[lf].value); } } - tuple += num_fields; /* next row */ + tuple += num_fields; /* next row */ } free(self->backend_tuples); @@ -226,7 +226,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; @@ -327,7 +327,7 @@ QR_fetch_tuples(QResultClass * self, ConnectionClass * conn, char *cursor) * We only close cursor/end the transaction if a cursor was used. */ int -QR_close(QResultClass * self) +QR_close(QResultClass *self) { QResultClass *res; @@ -379,7 +379,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; @@ -620,7 +620,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; diff --git a/src/interfaces/odbc/qresult.h b/src/interfaces/odbc/qresult.h index 23e125247c..251bc449c1 100644 --- a/src/interfaces/odbc/qresult.h +++ b/src/interfaces/odbc/qresult.h @@ -19,23 +19,22 @@ enum QueryResultCode_ { - PGRES_EMPTY_QUERY = 0, - PGRES_COMMAND_OK, /* a query command that doesn't - * return */ + PGRES_EMPTY_QUERY = 0, + PGRES_COMMAND_OK, /* a query command that doesn't return */ /* anything was executed properly by the backend */ - PGRES_TUPLES_OK,/* a query command that returns tuples */ + PGRES_TUPLES_OK, /* a query command that returns tuples */ /* was executed properly by the backend, PGresult */ /* contains the resulttuples */ - PGRES_COPY_OUT, - PGRES_COPY_IN, - PGRES_BAD_RESPONSE, /* an unexpected response was - * recv'd from the backend */ - PGRES_NONFATAL_ERROR, - PGRES_FATAL_ERROR, - PGRES_FIELDS_OK,/* field information from a query was + PGRES_COPY_OUT, + PGRES_COPY_IN, + PGRES_BAD_RESPONSE, /* an unexpected response was recv'd from + * the backend */ + PGRES_NONFATAL_ERROR, + PGRES_FATAL_ERROR, + PGRES_FIELDS_OK, /* field information from a query was * successful */ - PGRES_END_TUPLES, - PGRES_INTERNAL_ERROR + PGRES_END_TUPLES, + PGRES_INTERNAL_ERROR }; typedef enum QueryResultCode_ QueryResultCode; @@ -48,7 +47,7 @@ struct QResultClass_ * (backend) */ /* Stuff for declare/fetch tuples */ - int count_allocated; /* m(re)alloced count */ + int count_allocated; /* m(re)alloced count */ int fetch_count; /* logical rows read so far */ int fcount; /* actual rows read in the fetch */ int currTuple; @@ -113,19 +112,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 diff --git a/src/interfaces/odbc/resource.h b/src/interfaces/odbc/resource.h index 688ff7a6b9..b60d0dfd4b 100644 --- a/src/interfaces/odbc/resource.h +++ b/src/interfaces/odbc/resource.h @@ -62,4 +62,5 @@ #define _APS_NEXT_CONTROL_VALUE 1062
#define _APS_NEXT_SYMED_VALUE 101
#endif /*
*/ + #endif /*
*/ diff --git a/src/interfaces/odbc/results.c b/src/interfaces/odbc/results.c index 3565e3f8d5..7d9ce4c92f 100644 --- a/src/interfaces/odbc/results.c +++ b/src/interfaces/odbc/results.c @@ -1220,7 +1220,7 @@ PGAPI_MoreResults( * Stuff for updatable cursors. */ static QResultClass * -positioned_load(StatementClass * stmt, BOOL latest, int res_cols, UInt4 oid, const char *tidval) +positioned_load(StatementClass *stmt, BOOL latest, int res_cols, UInt4 oid, const char *tidval) { int i; QResultClass *qres; @@ -1250,7 +1250,7 @@ positioned_load(StatementClass * stmt, BOOL latest, int res_cols, UInt4 oid, con } RETCODE SQL_API -SC_pos_reload(StatementClass * stmt, UWORD irow, UWORD * count) +SC_pos_reload(StatementClass *stmt, UWORD irow, UWORD *count) { int i, res_cols; @@ -1328,7 +1328,7 @@ SC_pos_reload(StatementClass * stmt, UWORD irow, UWORD * count) } RETCODE SQL_API -SC_pos_newload(StatementClass * stmt, UInt4 oid, const char *tidval) +SC_pos_newload(StatementClass *stmt, UInt4 oid, const char *tidval) { int i; QResultClass *res, @@ -1399,7 +1399,7 @@ SC_pos_newload(StatementClass * stmt, UInt4 oid, const char *tidval) } RETCODE SQL_API -SC_pos_update(StatementClass * stmt, +SC_pos_update(StatementClass *stmt, UWORD irow) { int i, @@ -1472,7 +1472,7 @@ SC_pos_update(StatementClass * stmt, mylog("%d used=%d\n", i, *bindings[i].used); if (*bindings[i].used != SQL_IGNORE) { - PGAPI_BindParameter(hstmt, (SQLUSMALLINT)++ j, + PGAPI_BindParameter(hstmt, (SQLUSMALLINT) ++j, SQL_PARAM_INPUT, bindings[i].returntype, pgtype_to_sqltype(stmt, QR_get_field_type(res, i)), QR_get_fieldsize(res, i), @@ -1533,7 +1533,7 @@ SC_pos_update(StatementClass * stmt, return ret; } RETCODE SQL_API -SC_pos_delete(StatementClass * stmt, +SC_pos_delete(StatementClass *stmt, UWORD irow) { int res_cols; @@ -1606,7 +1606,7 @@ SC_pos_delete(StatementClass * stmt, return ret; } RETCODE SQL_API -SC_pos_add(StatementClass * stmt, +SC_pos_add(StatementClass *stmt, UWORD irow) { int num_cols, @@ -1643,7 +1643,7 @@ SC_pos_add(StatementClass * stmt, sprintf(addstr, "%s, \"%s\"", addstr, stmt->fi[i]->name); else sprintf(addstr, "%s\"%s\"", addstr, stmt->fi[i]->name); - PGAPI_BindParameter(hstmt, (SQLUSMALLINT)++ add_cols, + PGAPI_BindParameter(hstmt, (SQLUSMALLINT) ++add_cols, SQL_PARAM_INPUT, bindings[i].returntype, pgtype_to_sqltype(stmt, QR_get_field_type(res, i)), QR_get_fieldsize(res, i), diff --git a/src/interfaces/odbc/setup.c b/src/interfaces/odbc/setup.c index c4562ab90d..9db803a834 100644 --- a/src/interfaces/odbc/setup.c +++ b/src/interfaces/odbc/setup.c @@ -25,7 +25,7 @@ #define INTFUNC __stdcall -extern HINSTANCE NEAR s_hModule; /* Saved module handle. */ +extern HINSTANCE NEAR s_hModule; /* Saved module handle. */ /* Constants */ #define MIN(x,y) ((x) < (y) ? (x) : (y)) @@ -303,14 +303,14 @@ ConfigDlgProc(HWND hdlg, case IDC_DRIVER: lpsetupdlg = (LPSETUPDLG) GetWindowLong(hdlg, DWL_USER); DialogBoxParam(s_hModule, MAKEINTRESOURCE(DLG_OPTIONS_DRV), - hdlg, driver_optionsProc, (LPARAM) & lpsetupdlg->ci); + hdlg, driver_optionsProc, (LPARAM) &lpsetupdlg->ci); return TRUE; case IDC_DATASOURCE: 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; } diff --git a/src/interfaces/odbc/socket.c b/src/interfaces/odbc/socket.c index 8250fc8738..031a6779cb 100644 --- a/src/interfaces/odbc/socket.c +++ b/src/interfaces/odbc/socket.c @@ -35,7 +35,7 @@ extern GLOBAL_VALUES globals; void -SOCK_clear_error(SocketClass * self) +SOCK_clear_error(SocketClass *self) { self->errornumber = 0; self->errormsg = NULL; @@ -43,7 +43,7 @@ SOCK_clear_error(SocketClass * self) SocketClass * -SOCK_Constructor(const ConnectionClass * conn) +SOCK_Constructor(const ConnectionClass *conn) { SocketClass *rv; @@ -83,7 +83,7 @@ SOCK_Constructor(const ConnectionClass * conn) void -SOCK_Destructor(SocketClass * self) +SOCK_Destructor(SocketClass *self) { mylog("SOCK_Destructor\n"); if (self->socket != -1) @@ -104,7 +104,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; @@ -162,7 +162,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; @@ -179,7 +179,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; @@ -201,7 +201,7 @@ SOCK_put_n_char(SocketClass * self, char *buffer, int len) * returns TRUE if truncation occurs. */ BOOL -SOCK_get_string(SocketClass * self, char *buffer, int bufsize) +SOCK_get_string(SocketClass *self, char *buffer, int bufsize) { register int lf = 0; @@ -215,7 +215,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; @@ -228,7 +228,7 @@ SOCK_put_string(SocketClass * self, char *string) int -SOCK_get_int(SocketClass * self, short len) +SOCK_get_int(SocketClass *self, short len) { switch (len) { @@ -263,7 +263,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; @@ -288,7 +288,7 @@ SOCK_put_int(SocketClass * self, int value, short len) void -SOCK_flush_output(SocketClass * self) +SOCK_flush_output(SocketClass *self) { int written; @@ -303,7 +303,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) { @@ -335,7 +335,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; diff --git a/src/interfaces/odbc/socket.h b/src/interfaces/odbc/socket.h index 828372d5cb..c49d9fe88d 100644 --- a/src/interfaces/odbc/socket.h +++ b/src/interfaces/odbc/socket.h @@ -77,17 +77,18 @@ struct SocketClass_ /* Socket prototypes */ -SocketClass *SOCK_Constructor(const ConnectionClass * conn); -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); -BOOL 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); +SocketClass *SOCK_Constructor(const ConnectionClass *conn); +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); +BOOL 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 diff --git a/src/interfaces/odbc/statement.c b/src/interfaces/odbc/statement.c index f313f926f3..b4e33d0592 100644 --- a/src/interfaces/odbc/statement.c +++ b/src/interfaces/odbc/statement.c @@ -35,7 +35,7 @@ static struct { int type; char *s; -} Statement_Type[] = +} Statement_Type[] = { { @@ -202,7 +202,7 @@ PGAPI_FreeStmt(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 */ @@ -284,7 +284,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); SC_clear_error(self); @@ -356,7 +356,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; @@ -421,7 +421,7 @@ statement_type(char *statement) * from SQLFreeStmt(SQL_CLOSE) */ char -SC_recycle_statement(StatementClass * self) +SC_recycle_statement(StatementClass *self) { ConnectionClass *conn; @@ -507,7 +507,7 @@ SC_recycle_statement(StatementClass * self) * Reset only parameters that have anything to do with results */ self->status = STMT_READY; - self->manual_result = FALSE; /* very important */ + self->manual_result = FALSE; /* very important */ self->currTuple = -1; self->rowset_start = -1; @@ -537,7 +537,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); @@ -576,7 +576,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; @@ -597,7 +597,7 @@ SC_unbind_cols(StatementClass * self) void -SC_clear_error(StatementClass * self) +SC_clear_error(StatementClass *self) { if (self->errormsg_malloced && self->errormsg) free(self->errormsg); @@ -613,7 +613,7 @@ SC_clear_error(StatementClass * self) * 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; @@ -652,7 +652,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; @@ -684,14 +684,14 @@ 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; @@ -741,7 +741,7 @@ SC_fetch(StatementClass * self) return SQL_NO_DATA_FOUND; } else if (retval > 0) - (self->currTuple)++; /* all is well */ + (self->currTuple)++; /* all is well */ else { mylog("SC_fetch: error\n"); @@ -876,7 +876,7 @@ SC_fetch(StatementClass * self) RETCODE -SC_execute(StatementClass * self) +SC_execute(StatementClass *self) { static char *func = "SC_execute"; ConnectionClass *conn; @@ -1107,7 +1107,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)") diff --git a/src/interfaces/odbc/statement.h b/src/interfaces/odbc/statement.h index 801c334bf3..9b52f25694 100644 --- a/src/interfaces/odbc/statement.h +++ b/src/interfaces/odbc/statement.h @@ -23,10 +23,10 @@ typedef enum { - STMT_ALLOCATED, /* The statement handle is allocated, but + STMT_ALLOCATED, /* The statement handle is allocated, but * not used so far */ - STMT_READY, /* the statement is waiting to be executed */ - STMT_PREMATURE, /* ODBC states that it is legal to call + STMT_READY, /* the statement is waiting to be executed */ + STMT_PREMATURE, /* ODBC states that it is legal to call * e.g. SQLDescribeCol before a call to * SQLExecute, but after SQLPrepare. To * get all the necessary information in @@ -34,9 +34,9 @@ typedef enum * query _before_ the actual call to * SQLExecute, so that statement is * considered to be "premature". */ - STMT_FINISHED, /* statement execution has finished */ - STMT_EXECUTING /* statement execution is still going on */ -} STMT_Status; + STMT_FINISHED, /* statement execution has finished */ + STMT_EXECUTING /* statement execution is still going on */ +} STMT_Status; #define STMT_ROW_VERSION_CHANGED (-4) #define STMT_POS_BEFORE_RECORDSET (-3) @@ -79,18 +79,18 @@ typedef enum /* statement types */ enum { - STMT_TYPE_UNKNOWN = -2, - STMT_TYPE_OTHER = -1, - STMT_TYPE_SELECT = 0, - STMT_TYPE_INSERT, - STMT_TYPE_UPDATE, - STMT_TYPE_DELETE, - STMT_TYPE_CREATE, - STMT_TYPE_ALTER, - STMT_TYPE_DROP, - STMT_TYPE_GRANT, - STMT_TYPE_REVOKE, - STMT_TYPE_PROCCALL + STMT_TYPE_UNKNOWN = -2, + STMT_TYPE_OTHER = -1, + STMT_TYPE_SELECT = 0, + STMT_TYPE_INSERT, + STMT_TYPE_UPDATE, + STMT_TYPE_DELETE, + STMT_TYPE_CREATE, + STMT_TYPE_ALTER, + STMT_TYPE_DROP, + STMT_TYPE_GRANT, + STMT_TYPE_REVOKE, + STMT_TYPE_PROCCALL }; #define STMT_UPDATE(stmt) (stmt->statement_type > STMT_TYPE_SELECT) @@ -99,18 +99,18 @@ enum /* Parsing status */ enum { - STMT_PARSE_NONE = 0, - STMT_PARSE_COMPLETE, - STMT_PARSE_INCOMPLETE, - STMT_PARSE_FATAL, + STMT_PARSE_NONE = 0, + STMT_PARSE_COMPLETE, + STMT_PARSE_INCOMPLETE, + STMT_PARSE_FATAL, }; /* Result style */ enum { - STMT_FETCH_NONE = 0, - STMT_FETCH_NORMAL, - STMT_FETCH_EXTENDED, + STMT_FETCH_NONE = 0, + STMT_FETCH_NORMAL, + STMT_FETCH_EXTENDED, }; typedef struct @@ -118,7 +118,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 { @@ -137,7 +137,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 ***********/ @@ -234,21 +234,21 @@ 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 diff --git a/src/interfaces/odbc/tuple.c b/src/interfaces/odbc/tuple.c index 94d0bc17d3..512f36d2b2 100644 --- a/src/interfaces/odbc/tuple.c +++ b/src/interfaces/odbc/tuple.c @@ -24,7 +24,7 @@ void -set_tuplefield_null(TupleField * tuple_field) +set_tuplefield_null(TupleField *tuple_field) { tuple_field->len = 0; tuple_field->value = NULL; /* strdup(""); */ @@ -32,7 +32,7 @@ set_tuplefield_null(TupleField * tuple_field) 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); @@ -41,7 +41,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]; @@ -54,7 +54,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]; diff --git a/src/interfaces/odbc/tuple.h b/src/interfaces/odbc/tuple.h index 6cd87cb9db..fdc1a5f9ea 100644 --- a/src/interfaces/odbc/tuple.h +++ b/src/interfaces/odbc/tuple.h @@ -38,8 +38,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 diff --git a/src/interfaces/odbc/tuplelist.c b/src/interfaces/odbc/tuplelist.c index e00ab43006..0ae2130bff 100644 --- a/src/interfaces/odbc/tuplelist.c +++ b/src/interfaces/odbc/tuplelist.c @@ -44,7 +44,7 @@ TL_Constructor(UInt4 fieldcnt) void -TL_Destructor(TupleListClass * self) +TL_Destructor(TupleListClass *self) { int lf; TupleNode *node, @@ -70,7 +70,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, @@ -181,7 +181,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) { /* * we append the tuple at the end of the doubly linked list of the diff --git a/src/interfaces/odbc/tuplelist.h b/src/interfaces/odbc/tuplelist.h index 5ce2613e86..3dc98dd78f 100644 --- a/src/interfaces/odbc/tuplelist.h +++ b/src/interfaces/odbc/tuplelist.h @@ -28,7 +28,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 diff --git a/src/interfaces/python/pgmodule.c b/src/interfaces/python/pgmodule.c index 38fc4f2d7c..7b959e9429 100644 --- a/src/interfaces/python/pgmodule.c +++ b/src/interfaces/python/pgmodule.c @@ -94,8 +94,8 @@ const char *__movename[5] = static PyObject *pg_default_host; /* default database host */ static PyObject *pg_default_base; /* default database name */ -static PyObject *pg_default_opt; /* default connection options */ -static PyObject *pg_default_tty; /* default debug tty */ +static PyObject *pg_default_opt; /* default connection options */ +static PyObject *pg_default_tty; /* default debug tty */ static PyObject *pg_default_port; /* default connection port */ static PyObject *pg_default_user; /* default username */ static PyObject *pg_default_passwd; /* default password */ @@ -111,7 +111,7 @@ int *get_type_array(PGresult *result, int nfields); typedef struct { - PyObject_HEAD + PyObject_HEAD int valid; /* validity flag */ PGconn *cnx; /* PostGres connection handle */ PGresult *last_result; /* last result content */ @@ -139,7 +139,7 @@ pgobject_New(void) typedef struct { - PyObject_HEAD + PyObject_HEAD PGresult *last_result; /* last result content */ int result_type; /* type of previous result */ long current_pos; /* current position in last result */ @@ -154,7 +154,7 @@ staticforward PyTypeObject PgQueryType; typedef struct { - PyObject_HEAD + PyObject_HEAD int valid; /* validity flag */ pgobject *pgcnx; /* parent connection object */ PGresult *last_result; /* last result content */ @@ -175,8 +175,8 @@ staticforward PyTypeObject PgSourceType; typedef struct { - PyObject_HEAD - pgobject * pgcnx; /* parent connection object */ + PyObject_HEAD + pgobject * pgcnx; /* parent connection object */ Oid lo_oid; /* large object oid */ int lo_fd; /* large object fd */ } pglargeobject; |