Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 12ceb11

Browse files
committed
ODBC source code cleanup. Mostly alignment of #define constants.
1 parent ff71301 commit 12ceb11

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1070
-1082
lines changed

src/interfaces/odbc/bind.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* Module: bind.c
32
*
43
* Description: This module contains routines related to binding

src/interfaces/odbc/bind.h

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* File: bind.h
32
*
43
* Description: See "bind.c"

src/interfaces/odbc/columninfo.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* Module: columninfo.c
32
*
43
* Description: This module contains routines related to

src/interfaces/odbc/columninfo.h

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* File: columninfo.h
32
*
43
* Description: See "columninfo.c"
@@ -40,5 +39,4 @@ void CI_set_num_fields(ColumnInfoClass *self, int new_num_fields);
4039
void CI_set_field_info(ColumnInfoClass *self, int field_num, char *new_name,
4140
Oid new_adtid, Int2 new_adtsize, Int4 atttypmod);
4241

43-
4442
#endif

src/interfaces/odbc/connection.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* Module: connection.c
32
*
43
* Description: This module contains routines related to

src/interfaces/odbc/connection.h

+50-51
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* File: connection.h
32
*
43
* Description: See "connection.c"
@@ -38,41 +37,41 @@ typedef enum
3837
} CONN_Status;
3938

4039
/* These errors have general sql error state */
41-
#define CONNECTION_SERVER_NOT_REACHED 101
42-
#define CONNECTION_MSG_TOO_LONG 103
43-
#define CONNECTION_COULD_NOT_SEND 104
44-
#define CONNECTION_NO_SUCH_DATABASE 105
45-
#define CONNECTION_BACKEND_CRAZY 106
46-
#define CONNECTION_NO_RESPONSE 107
47-
#define CONNECTION_SERVER_REPORTED_ERROR 108
48-
#define CONNECTION_COULD_NOT_RECEIVE 109
49-
#define CONNECTION_SERVER_REPORTED_WARNING 110
50-
#define CONNECTION_NEED_PASSWORD 112
40+
#define CONNECTION_SERVER_NOT_REACHED 101
41+
#define CONNECTION_MSG_TOO_LONG 103
42+
#define CONNECTION_COULD_NOT_SEND 104
43+
#define CONNECTION_NO_SUCH_DATABASE 105
44+
#define CONNECTION_BACKEND_CRAZY 106
45+
#define CONNECTION_NO_RESPONSE 107
46+
#define CONNECTION_SERVER_REPORTED_ERROR 108
47+
#define CONNECTION_COULD_NOT_RECEIVE 109
48+
#define CONNECTION_SERVER_REPORTED_WARNING 110
49+
#define CONNECTION_NEED_PASSWORD 112
5150

5251
/* These errors correspond to specific SQL states */
53-
#define CONN_INIREAD_ERROR 201
54-
#define CONN_OPENDB_ERROR 202
55-
#define CONN_STMT_ALLOC_ERROR 203
56-
#define CONN_IN_USE 204
57-
#define CONN_UNSUPPORTED_OPTION 205
52+
#define CONN_INIREAD_ERROR 201
53+
#define CONN_OPENDB_ERROR 202
54+
#define CONN_STMT_ALLOC_ERROR 203
55+
#define CONN_IN_USE 204
56+
#define CONN_UNSUPPORTED_OPTION 205
5857
/* Used by SetConnectoption to indicate unsupported options */
59-
#define CONN_INVALID_ARGUMENT_NO 206
58+
#define CONN_INVALID_ARGUMENT_NO 206
6059
/* SetConnectOption: corresponds to ODBC--"S1009" */
61-
#define CONN_TRANSACT_IN_PROGRES 207
62-
#define CONN_NO_MEMORY_ERROR 208
63-
#define CONN_NOT_IMPLEMENTED_ERROR 209
64-
#define CONN_INVALID_AUTHENTICATION 210
65-
#define CONN_AUTH_TYPE_UNSUPPORTED 211
66-
#define CONN_UNABLE_TO_LOAD_DLL 212
60+
#define CONN_TRANSACT_IN_PROGRES 207
61+
#define CONN_NO_MEMORY_ERROR 208
62+
#define CONN_NOT_IMPLEMENTED_ERROR 209
63+
#define CONN_INVALID_AUTHENTICATION 210
64+
#define CONN_AUTH_TYPE_UNSUPPORTED 211
65+
#define CONN_UNABLE_TO_LOAD_DLL 212
6766

68-
#define CONN_OPTION_VALUE_CHANGED 213
69-
#define CONN_VALUE_OUT_OF_RANGE 214
67+
#define CONN_OPTION_VALUE_CHANGED 213
68+
#define CONN_VALUE_OUT_OF_RANGE 214
7069

71-
#define CONN_TRUNCATED 215
70+
#define CONN_TRUNCATED 215
7271

7372
/* Conn_status defines */
74-
#define CONN_IN_AUTOCOMMIT 0x01
75-
#define CONN_IN_TRANSACTION 0x02
73+
#define CONN_IN_AUTOCOMMIT 0x01
74+
#define CONN_IN_TRANSACTION 0x02
7675

7776
/* AutoCommit functions */
7877
#define CC_set_autocommit_off(x) (x->transact_status &= ~CONN_IN_AUTOCOMMIT)
@@ -86,31 +85,31 @@ typedef enum
8685

8786

8887
/* Authentication types */
89-
#define AUTH_REQ_OK 0
90-
#define AUTH_REQ_KRB4 1
91-
#define AUTH_REQ_KRB5 2
92-
#define AUTH_REQ_PASSWORD 3
93-
#define AUTH_REQ_CRYPT 4
88+
#define AUTH_REQ_OK 0
89+
#define AUTH_REQ_KRB4 1
90+
#define AUTH_REQ_KRB5 2
91+
#define AUTH_REQ_PASSWORD 3
92+
#define AUTH_REQ_CRYPT 4
9493

9594
/* Startup Packet sizes */
96-
#define SM_DATABASE 64
97-
#define SM_USER 32
98-
#define SM_OPTIONS 64
99-
#define SM_UNUSED 64
100-
#define SM_TTY 64
95+
#define SM_DATABASE 64
96+
#define SM_USER 32
97+
#define SM_OPTIONS 64
98+
#define SM_UNUSED 64
99+
#define SM_TTY 64
101100

102101
/* Old 6.2 protocol defines */
103-
#define NO_AUTHENTICATION 7
104-
#define PATH_SIZE 64
105-
#define ARGV_SIZE 64
106-
#define NAMEDATALEN 16
102+
#define NO_AUTHENTICATION 7
103+
#define PATH_SIZE 64
104+
#define ARGV_SIZE 64
105+
#define NAMEDATALEN 16
107106

108107
typedef unsigned int ProtocolVersion;
109108

110109
#define PG_PROTOCOL(major, minor) (((major) << 16) | (minor))
111-
#define PG_PROTOCOL_LATEST PG_PROTOCOL(2, 0)
112-
#define PG_PROTOCOL_63 PG_PROTOCOL(1, 0)
113-
#define PG_PROTOCOL_62 PG_PROTOCOL(0, 0)
110+
#define PG_PROTOCOL_LATEST PG_PROTOCOL(2, 0)
111+
#define PG_PROTOCOL_63 PG_PROTOCOL(1, 0)
112+
#define PG_PROTOCOL_62 PG_PROTOCOL(0, 0)
114113

115114
/* This startup packet is to support latest Postgres protocol (6.4, 6.3) */
116115
typedef struct _StartupPacket
@@ -275,12 +274,12 @@ struct ConnectionClass_
275274

276275

277276
/* Accessor functions */
278-
#define CC_get_socket(x) (x->sock)
279-
#define CC_get_database(x) (x->connInfo.database)
280-
#define CC_get_server(x) (x->connInfo.server)
281-
#define CC_get_DSN(x) (x->connInfo.dsn)
282-
#define CC_get_username(x) (x->connInfo.username)
283-
#define CC_is_onlyread(x) (x->connInfo.onlyread[0] == '1')
277+
#define CC_get_socket(x) (x->sock)
278+
#define CC_get_database(x) (x->connInfo.database)
279+
#define CC_get_server(x) (x->connInfo.server)
280+
#define CC_get_DSN(x) (x->connInfo.dsn)
281+
#define CC_get_username(x) (x->connInfo.username)
282+
#define CC_is_onlyread(x) (x->connInfo.onlyread[0] == '1')
284283

285284

286285
/* for CC_DSN_info */

src/interfaces/odbc/convert.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* Module: convert.c
32
*
43
* Description: This module contains routines related to

src/interfaces/odbc/convert.h

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* File: convert.h
32
*
43
* Description: See "convert.c"
@@ -13,12 +12,12 @@
1312
#include "psqlodbc.h"
1413

1514
/* copy_and_convert results */
16-
#define COPY_OK 0
17-
#define COPY_UNSUPPORTED_TYPE 1
18-
#define COPY_UNSUPPORTED_CONVERSION 2
19-
#define COPY_RESULT_TRUNCATED 3
20-
#define COPY_GENERAL_ERROR 4
21-
#define COPY_NO_DATA_FOUND 5
15+
#define COPY_OK 0
16+
#define COPY_UNSUPPORTED_TYPE 1
17+
#define COPY_UNSUPPORTED_CONVERSION 2
18+
#define COPY_RESULT_TRUNCATED 3
19+
#define COPY_GENERAL_ERROR 4
20+
#define COPY_NO_DATA_FOUND 5
2221

2322
typedef struct
2423
{

src/interfaces/odbc/dlg_specific.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* Module: dlg_specific.c
32
*
43
* Description: This module contains any specific code for handling

src/interfaces/odbc/dlg_specific.h

+63-56
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* File: dlg_specific.h
32
*
43
* Description: See "dlg_specific.c"
@@ -25,73 +24,81 @@
2524
#endif
2625

2726
/* Unknown data type sizes */
28-
#define UNKNOWNS_AS_MAX 0
29-
#define UNKNOWNS_AS_DONTKNOW 1
30-
#define UNKNOWNS_AS_LONGEST 2
27+
#define UNKNOWNS_AS_MAX 0
28+
#define UNKNOWNS_AS_DONTKNOW 1
29+
#define UNKNOWNS_AS_LONGEST 2
3130

3231
/* INI File Stuff */
3332
#ifndef WIN32
34-
#define ODBC_INI ".odbc.ini"
33+
#define ODBC_INI ".odbc.ini"
3534
#ifdef ODBCINSTDIR
36-
#define ODBCINST_INI ODBCINSTDIR "/odbcinst.ini"
35+
#define ODBCINST_INI ODBCINSTDIR "/odbcinst.ini"
3736
#else
38-
#define ODBCINST_INI "/etc/odbcinst.ini"
37+
#define ODBCINST_INI "/etc/odbcinst.ini"
3938
#endif
4039
#else /* WIN32 */
41-
#define ODBC_INI "ODBC.INI" /* ODBC initialization file */
42-
#define ODBCINST_INI "ODBCINST.INI" /* ODBC Installation file */
40+
#define ODBC_INI "ODBC.INI" /* ODBC initialization
41+
* file */
42+
#define ODBCINST_INI "ODBCINST.INI" /* ODBC Installation
43+
* file */
4344
#endif /* WIN32 */
4445

4546

46-
#define INI_DSN DBMS_NAME /* Name of default Datasource in
47-
* ini file (not used?) */
48-
#define INI_KDESC "Description" /* Data source description */
49-
#define INI_SERVER "Servername" /* Name of Server running the
50-
* Postgres service */
51-
#define INI_PORT "Port"/* Port on which the Postmaster is
52-
* listening */
53-
#define INI_DATABASE "Database" /* Database Name */
54-
#define INI_USER "Username" /* Default User Name */
55-
#define INI_PASSWORD "Password" /* Default Password */
56-
#define INI_DEBUG "Debug" /* Debug flag */
57-
#define INI_FETCH "Fetch" /* Fetch Max Count */
58-
#define INI_SOCKET "Socket" /* Socket buffer size */
59-
#define INI_READONLY "ReadOnly" /* Database is read only */
60-
#define INI_COMMLOG "CommLog" /* Communication to backend
61-
* logging */
62-
#define INI_PROTOCOL "Protocol" /* What protocol (6.2) */
63-
#define INI_OPTIMIZER "Optimizer" /* Use backend genetic optimizer */
64-
#define INI_KSQO "Ksqo"/* Keyset query optimization */
65-
#define INI_CONNSETTINGS "ConnSettings" /* Anything to send to
66-
* backend on successful
67-
* connection */
68-
#define INI_UNIQUEINDEX "UniqueIndex" /* Recognize unique indexes */
69-
#define INI_UNKNOWNSIZES "UnknownSizes" /* How to handle unknown
70-
* result set sizes */
71-
72-
#define INI_CANCELASFREESTMT "CancelAsFreeStmt"
73-
74-
#define INI_USEDECLAREFETCH "UseDeclareFetch" /* Use Declare/Fetch
75-
* cursors */
47+
#define INI_DSN DBMS_NAME /* Name of default
48+
* Datasource in ini
49+
* file (not used?) */
50+
#define INI_KDESC "Description" /* Data source
51+
* description */
52+
#define INI_SERVER "Servername" /* Name of Server
53+
* running the Postgres
54+
* service */
55+
#define INI_PORT "Port" /* Port on which the
56+
* Postmaster is listening */
57+
#define INI_DATABASE "Database" /* Database Name */
58+
#define INI_USER "Username" /* Default User Name */
59+
#define INI_PASSWORD "Password" /* Default Password */
60+
#define INI_DEBUG "Debug" /* Debug flag */
61+
#define INI_FETCH "Fetch" /* Fetch Max Count */
62+
#define INI_SOCKET "Socket" /* Socket buffer size */
63+
#define INI_READONLY "ReadOnly" /* Database is read only */
64+
#define INI_COMMLOG "CommLog" /* Communication to
65+
* backend logging */
66+
#define INI_PROTOCOL "Protocol" /* What protocol (6.2) */
67+
#define INI_OPTIMIZER "Optimizer" /* Use backend genetic
68+
* optimizer */
69+
#define INI_KSQO "Ksqo" /* Keyset query
70+
* optimization */
71+
#define INI_CONNSETTINGS "ConnSettings" /* Anything to send to
72+
* backend on successful
73+
* connection */
74+
#define INI_UNIQUEINDEX "UniqueIndex" /* Recognize unique
75+
* indexes */
76+
#define INI_UNKNOWNSIZES "UnknownSizes" /* How to handle unknown
77+
* result set sizes */
78+
79+
#define INI_CANCELASFREESTMT "CancelAsFreeStmt"
80+
81+
#define INI_USEDECLAREFETCH "UseDeclareFetch" /* Use Declare/Fetch
82+
* cursors */
7683

7784
/* More ini stuff */
78-
#define INI_TEXTASLONGVARCHAR "TextAsLongVarchar"
79-
#define INI_UNKNOWNSASLONGVARCHAR "UnknownsAsLongVarchar"
80-
#define INI_BOOLSASCHAR "BoolsAsChar"
81-
#define INI_MAXVARCHARSIZE "MaxVarcharSize"
82-
#define INI_MAXLONGVARCHARSIZE "MaxLongVarcharSize"
83-
84-
#define INI_FAKEOIDINDEX "FakeOidIndex"
85-
#define INI_SHOWOIDCOLUMN "ShowOidColumn"
86-
#define INI_ROWVERSIONING "RowVersioning"
87-
#define INI_SHOWSYSTEMTABLES "ShowSystemTables"
88-
#define INI_LIE "Lie"
89-
#define INI_PARSE "Parse"
90-
#define INI_EXTRASYSTABLEPREFIXES "ExtraSysTablePrefixes"
91-
92-
#define INI_TRANSLATIONNAME "TranslationName"
93-
#define INI_TRANSLATIONDLL "TranslationDLL"
94-
#define INI_TRANSLATIONOPTION "TranslationOption"
85+
#define INI_TEXTASLONGVARCHAR "TextAsLongVarchar"
86+
#define INI_UNKNOWNSASLONGVARCHAR "UnknownsAsLongVarchar"
87+
#define INI_BOOLSASCHAR "BoolsAsChar"
88+
#define INI_MAXVARCHARSIZE "MaxVarcharSize"
89+
#define INI_MAXLONGVARCHARSIZE "MaxLongVarcharSize"
90+
91+
#define INI_FAKEOIDINDEX "FakeOidIndex"
92+
#define INI_SHOWOIDCOLUMN "ShowOidColumn"
93+
#define INI_ROWVERSIONING "RowVersioning"
94+
#define INI_SHOWSYSTEMTABLES "ShowSystemTables"
95+
#define INI_LIE "Lie"
96+
#define INI_PARSE "Parse"
97+
#define INI_EXTRASYSTABLEPREFIXES "ExtraSysTablePrefixes"
98+
99+
#define INI_TRANSLATIONNAME "TranslationName"
100+
#define INI_TRANSLATIONDLL "TranslationDLL"
101+
#define INI_TRANSLATIONOPTION "TranslationOption"
95102

96103

97104
/* Connection Defaults */

src/interfaces/odbc/drvconn.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* Module: drvconn.c
32
*
43
* Description: This module contains only routines related to

src/interfaces/odbc/environ.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* Module: environ.c
32
*
43
* Description: This module contains routines related to

src/interfaces/odbc/environ.h

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* File: environ.h
32
*
43
* Description: See "environ.c"

src/interfaces/odbc/execute.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* Module: execute.c
32
*
43
* Description: This module contains routines related to

0 commit comments

Comments
 (0)