Commit 12ceb111 authored by Bruce Momjian's avatar Bruce Momjian

ODBC source code cleanup. Mostly alignment of #define constants.

parent ff713018
/* Module: bind.c
*
* Description: This module contains routines related to binding
......
/* File: bind.h
*
* Description: See "bind.c"
......
/* Module: columninfo.c
*
* Description: This module contains routines related to
......
/* File: columninfo.h
*
* Description: See "columninfo.c"
......@@ -40,5 +39,4 @@ 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
/* Module: connection.c
*
* Description: This module contains routines related to
......
/* File: connection.h
*
* Description: See "connection.c"
......
/* Module: convert.c
*
* Description: This module contains routines related to
......
/* File: convert.h
*
* Description: See "convert.c"
......
/* Module: dlg_specific.c
*
* Description: This module contains any specific code for handling
......
/* File: dlg_specific.h
*
* Description: See "dlg_specific.c"
......@@ -38,18 +37,23 @@
#define ODBCINST_INI "/etc/odbcinst.ini"
#endif
#else /* WIN32 */
#define ODBC_INI "ODBC.INI" /* ODBC initialization file */
#define ODBCINST_INI "ODBCINST.INI" /* ODBC Installation file */
#define ODBC_INI "ODBC.INI" /* ODBC initialization
* file */
#define ODBCINST_INI "ODBCINST.INI" /* ODBC Installation
* file */
#endif /* WIN32 */
#define INI_DSN DBMS_NAME /* Name of default Datasource in
* ini file (not used?) */
#define INI_KDESC "Description" /* Data source description */
#define INI_SERVER "Servername" /* Name of Server running the
* Postgres service */
#define INI_PORT "Port"/* Port on which the Postmaster is
* listening */
#define INI_DSN DBMS_NAME /* Name of default
* Datasource in ini
* file (not used?) */
#define INI_KDESC "Description" /* Data source
* description */
#define INI_SERVER "Servername" /* Name of Server
* running the Postgres
* service */
#define INI_PORT "Port" /* Port on which the
* Postmaster is listening */
#define INI_DATABASE "Database" /* Database Name */
#define INI_USER "Username" /* Default User Name */
#define INI_PASSWORD "Password" /* Default Password */
......@@ -57,15 +61,18 @@
#define INI_FETCH "Fetch" /* Fetch Max Count */
#define INI_SOCKET "Socket" /* Socket buffer size */
#define INI_READONLY "ReadOnly" /* Database is read only */
#define INI_COMMLOG "CommLog" /* Communication to backend
* logging */
#define INI_COMMLOG "CommLog" /* Communication to
* backend logging */
#define INI_PROTOCOL "Protocol" /* What protocol (6.2) */
#define INI_OPTIMIZER "Optimizer" /* Use backend genetic optimizer */
#define INI_KSQO "Ksqo"/* Keyset query optimization */
#define INI_OPTIMIZER "Optimizer" /* Use backend genetic
* optimizer */
#define INI_KSQO "Ksqo" /* Keyset query
* optimization */
#define INI_CONNSETTINGS "ConnSettings" /* Anything to send to
* backend on successful
* connection */
#define INI_UNIQUEINDEX "UniqueIndex" /* Recognize unique indexes */
#define INI_UNIQUEINDEX "UniqueIndex" /* Recognize unique
* indexes */
#define INI_UNKNOWNSIZES "UnknownSizes" /* How to handle unknown
* result set sizes */
......
/* Module: drvconn.c
*
* Description: This module contains only routines related to
......
/* Module: environ.c
*
* Description: This module contains routines related to
......
/* File: environ.h
*
* Description: See "environ.c"
......
/* Module: execute.c
*
* Description: This module contains routines related to
......
/* GetPrivateProfileString() -- approximate implementation of */
/* Windows NT System Services version of GetPrivateProfileString() */
/* probably doesn't handle the NULL key for section name or value key */
/* correctly also, doesn't provide Microsoft backwards compatability */
/* wrt TAB characters in the value string -- Microsoft terminates value */
/* at the first TAB, but I couldn't discover what the behavior should */
/* be regarding TABS in quoted strings so, I treat tabs like any other */
/* characters -- NO comments following value string separated by a TAB */
/* are allowed (that is an anachronism anyway) */
/* Added code to search for ODBC_INI file in users home directory on */
/* Unix */
/* GetPrivateProfileString()
*
* approximate implementation of
* Windows NT System Services version of GetPrivateProfileString()
* probably doesn't handle the NULL key for section name or value key
* correctly also, doesn't provide Microsoft backwards compatability
* wrt TAB characters in the value string
*
* Microsoft terminates value
* at the first TAB, but I couldn't discover what the behavior should
* be regarding TABS in quoted strings so, I treat tabs like any other
* characters
*
* NO comments following value string separated by a TAB
* are allowed (that is an anachronism anyway)
* Added code to search for ODBC_INI file in users home directory on
* Unix
*/
#ifndef WIN32
......
/* GetPrivateProfileString */
/* for UNIX use */
/* GetPrivateProfileString
* for UNIX use
*/
#ifndef GPPS_H
#define GPPS_H
......
/* Module: info.c
*
* Description: This module contains routines related to
......
/* Modified isql.h file from iodbc. This file should be placed in the
* include path to be used to create ODBC compliant applications.
*/
/*
* Modified isql.h file from iodbc. This file should be placed in the
* include path to be used to create ODBC compliant applications.
*/
#ifndef _INTRINSIC_SQL_H
#define _INTRINSIC_SQL_H
......
/* This file has been modified from the original isqlext.h to add the
* missing function prototypes and appropriate #defines. It is designed
* to be a drop in replacement for isqlext.h from iodbc.
*/
/*
* This file has been modified from the original isqlext.h to add the
* missing function prototypes and appropriate #defines. It is designed
* to be a drop in replacement for isqlext.h from iodbc.
*/
#ifndef _INTRINSIC_SQLEXT_H
#define _INTRINSIC_SQLEXT_H
......@@ -1275,7 +1277,8 @@ typedef struct tagSQL_INTERVAL_STRUCT
*/
#define SQL_UB_OFF 0UL
#define SQL_UB_ON 1UL
#define SQL_UB_FIXED SQL_UB_ON /* Deprecated in ODBC 3.0 */
#define SQL_UB_FIXED SQL_UB_ON /* Deprecated in ODBC
* 3.0 */
#define SQL_UB_VARIABLE 2UL /* Added in ODBC 3.0 */
#define SQL_UB_DEFAULT SQL_UB_OFF
......
/* Module: lobj.c
*
* Description: This module contains routines related to manipulating
......
/* File: lobj.h
*
* Description: See "lobj.c"
......
/* Module: misc.c
*
* Description: This module contains miscellaneous routines
......
/* File: misc.h
*
* Description: See "misc.c"
......@@ -98,8 +97,8 @@ char *my_strcat(char *buf, char *fmt, char *s, int len);
/* defines for return value of my_strcpy */
#define STRCPY_SUCCESS 1
#define STRCPY_FAIL 0
#define STRCPY_TRUNCATED -1
#define STRCPY_NULL -2
#define STRCPY_TRUNCATED (-1)
#define STRCPY_NULL (-2)
int my_strcpy(char *dst, int dst_len, char *src, int src_len);
......
......@@ -6,6 +6,7 @@
* Create 2001-03-03 Eiji Tokuya
*
*/
#include <string.h>
#include "multibyte.h"
......
......@@ -2,7 +2,6 @@
*
* Multibyte library header ( psqlODBC Only )
*
*
*/
/* PostgreSQL client encoding */
......
/* Module: options.c
*
* Description: This module contains routines for getting/setting
......
/* Module: parse.c
*
* Description: This module contains routines related to parsing SQL statements.
......
/* Module: pgtypes.c
*
* Description: This module contains routines for getting information
......
/* File: pgtypes.h
*
* Description: See "pgtypes.c"
......@@ -17,7 +16,7 @@
#if 0
#define PG_TYPE_LO ????/* waiting for permanent type */
#define PG_TYPE_LO ???? /* waiting for permanent type */
#endif
#define PG_TYPE_BOOL 16
......@@ -67,7 +66,7 @@
extern Int2 sqlTypes[];
/* Defines for pgtype_precision */
#define PG_STATIC -1
#define PG_STATIC (-1)
Int4 sqltype_to_pgtype(Int2 fSqlType);
......
/* Module: psqlodbc.c
*
* Description: This module contains the main entry point (DllMain) for the library.
......
/* File: psqlodbc.h
*
* Description: This file contains defines and declarations that are related to
......@@ -6,7 +5,8 @@
*
* Comments: See "notice.txt" for copyright and license information.
*
* $Id: psqlodbc.h,v 1.40 2001/03/22 04:01:35 momjian Exp $
* $Id: psqlodbc.h,v 1.41 2001/03/27 04:00:54 momjian Exp $
*
*/
#ifndef __PSQLODBC_H__
......@@ -91,18 +91,19 @@ typedef UInt4 Oid;
#define MAX_KEYPARTS 20
#define MAX_KEYLEN 512 /* max key of the form
* "date+outlet+invoice" */
#define MAX_ROW_SIZE 0 /* Unlimited rowsize with the Tuple
* Toaster */
#define MAX_STATEMENT_LEN 0 /* Unlimited statement size with 7.0 */
#define MAX_ROW_SIZE 0 /* Unlimited rowsize with the
* Tuple Toaster */
#define MAX_STATEMENT_LEN 0 /* Unlimited statement size with
* 7.0 */
/* Previously, numerous query strings were defined of length MAX_STATEMENT_LEN */
/* Now that's 0, lets use this instead. DJP 24-1-2001 */
#define STD_STATEMENT_LEN MAX_MESSAGE_LEN
#define PG62 "6.2" /* "Protocol" key setting to force
* Postgres 6.2 */
#define PG63 "6.3" /* "Protocol" key setting to force
* postgres 6.3 */
#define PG62 "6.2" /* "Protocol" key setting
* to force Postgres 6.2 */
#define PG63 "6.3" /* "Protocol" key setting
* to force postgres 6.3 */
#define PG64 "6.4"
typedef struct ConnectionClass_ ConnectionClass;
......@@ -173,15 +174,16 @@ typedef struct QueryInfo_
} QueryInfo;
#define PG_TYPE_LO -999 /* hack until permanent type
* available */
#define PG_TYPE_LO (-999) /* hack until permanent
* type available */
#define PG_TYPE_LO_NAME "lo"
#define OID_ATTNUM -2 /* the attnum in pg_index of the
* oid */
#define OID_ATTNUM (-2) /* the attnum in pg_index
* of the oid */
/* sizes */
#define TEXT_FIELD_SIZE 8190 /* size of text fields (not
* including null term) */
#define TEXT_FIELD_SIZE 8190 /* size of text fields
* (not including null
* term) */
#define NAME_FIELD_SIZE 32 /* size of name fields */
#define MAX_VARCHAR_SIZE 254 /* maximum size of a varchar (not
* including null term) */
......
/* Module: qresult.c
*
* Description: This module contains functions related to
......
/* File: qresult.h
*
* Description: See "qresult.c"
......
/* Module: results.c
*
* Description: This module contains functions related to
......
/* Module: setup.c
*
* Description: This module contains the setup functions for
......@@ -11,7 +10,7 @@
*
* Comments: See "notice.txt" for copyright and license information.
*
*************************************************************************************/
*/
#include "psqlodbc.h"
#include "connection.h"
......
/* Module: socket.c
*
* Description: This module contains functions for low level socket
......
/* File: socket.h
*
* Description: See "socket.c"
......
/* Module: statement.c
*
* Description: This module contains functions related to creating
......
/* File: statement.h
*
* Description: See "statement.c"
......@@ -50,11 +49,13 @@ typedef enum
STMT_EXECUTING /* statement execution is still going on */
} STMT_Status;
#define STMT_TRUNCATED -2
#define STMT_INFO_ONLY -1 /* not an error message, just a
* notification to be returned by SQLError */
#define STMT_OK 0 /* will be interpreted as "no error
* pending" */
#define STMT_TRUNCATED (-2)
#define STMT_INFO_ONLY (-1) /* not an error message,
* just a notification
* to be returned by
* SQLError */
#define STMT_OK 0 /* will be interpreted
* as "no error pending" */
#define STMT_EXEC_ERROR 1
#define STMT_STATUS_ERROR 2
#define STMT_SEQUENCE_ERROR 3
......
/* Module: tuple.c
*
* Description: This module contains functions for setting the data for individual
......
/* File: tuple.h
*
* Description: See "tuple.c"
......
/* Module: tuplelist.c
*
* Description: This module contains functions for creating a manual result set
......
/* File: tuplelist.h
*
* Description: See "tuplelist.c"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment