]> granicus.if.org Git - postgresql/commitdiff
Rename readonly to onlyread in odbc. Use varargs properly.
authorBruce Momjian <bruce@momjian.us>
Tue, 30 Nov 1999 02:44:09 +0000 (02:44 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 30 Nov 1999 02:44:09 +0000 (02:44 +0000)
src/interfaces/odbc/connection.h
src/interfaces/odbc/dlg_specific.c
src/interfaces/odbc/execute.c
src/interfaces/odbc/info.c
src/interfaces/odbc/misc.c
src/interfaces/odbc/psqlodbc.h

index d07fd60362a3b9bca1ce269da6272bc8b3da1aae..99841f33f0c2e2424b0682b3072c9e43af76ee0c 100644 (file)
@@ -147,7 +147,7 @@ typedef struct {
        char    conn_settings[LARGE_REGISTRY_LEN];
        char    protocol[SMALL_REGISTRY_LEN];
        char    port[SMALL_REGISTRY_LEN];
-       char    readonly[SMALL_REGISTRY_LEN];   
+       char    onlyread[SMALL_REGISTRY_LEN];   
        char    fake_oid_index[SMALL_REGISTRY_LEN];
        char    show_oid_column[SMALL_REGISTRY_LEN];
        char    row_versioning[SMALL_REGISTRY_LEN];
@@ -230,7 +230,7 @@ struct ConnectionClass_ {
 #define CC_get_server(x)       (x->connInfo.server)
 #define CC_get_DSN(x)          (x->connInfo.dsn)
 #define CC_get_username(x)     (x->connInfo.username)
-#define CC_is_readonly(x)      (x->connInfo.readonly[0] == '1')
+#define CC_is_onlyread(x)      (x->connInfo.onlyread[0] == '1')
 
 
 /*  for CC_DSN_info */
index 6e23bef3dfab7d35a691077433e50b4448f2f8ce..6675c5ba70e17e7b069d6a00569eecf2f8274a64 100644 (file)
@@ -89,7 +89,7 @@ int CALLBACK driver_optionsProc(HWND   hdlg,
                CheckDlgButton(hdlg, DRV_OPTIMIZER, globals.disable_optimizer);
                CheckDlgButton(hdlg, DRV_KSQO, globals.ksqo);
                CheckDlgButton(hdlg, DRV_UNIQUEINDEX, globals.unique_index);
-               CheckDlgButton(hdlg, DRV_READONLY, globals.readonly);
+               CheckDlgButton(hdlg, DRV_READONLY, globals.onlyread);
                CheckDlgButton(hdlg, DRV_USEDECLAREFETCH, globals.use_declarefetch);
 
                /*      Unknown (Default) Data Type sizes */
@@ -133,7 +133,7 @@ int CALLBACK driver_optionsProc(HWND   hdlg,
                        globals.disable_optimizer = IsDlgButtonChecked(hdlg, DRV_OPTIMIZER);
                        globals.ksqo = IsDlgButtonChecked(hdlg, DRV_KSQO);
                        globals.unique_index = IsDlgButtonChecked(hdlg, DRV_UNIQUEINDEX);
-                       globals.readonly = IsDlgButtonChecked(hdlg, DRV_READONLY);
+                       globals.onlyread = IsDlgButtonChecked(hdlg, DRV_READONLY);
                        globals.use_declarefetch = IsDlgButtonChecked(hdlg, DRV_USEDECLAREFETCH);
 
                        /*      Unknown (Default) Data Type sizes */
@@ -241,7 +241,7 @@ char buf[128];
                }
 
                /*      Readonly */
-               CheckDlgButton(hdlg, DS_READONLY, atoi(ci->readonly));
+               CheckDlgButton(hdlg, DS_READONLY, atoi(ci->onlyread));
 
                /*      Protocol */
                if (strncmp(ci->protocol, PG62, strlen(PG62)) == 0)
@@ -279,7 +279,7 @@ char buf[128];
                        mylog("IDOK: got ci = %u\n", ci);
 
                        /*      Readonly */
-                       sprintf(ci->readonly, "%d", IsDlgButtonChecked(hdlg, DS_READONLY));
+                       sprintf(ci->onlyread, "%d", IsDlgButtonChecked(hdlg, DS_READONLY));
 
                        /*      Protocol */
                        if ( IsDlgButtonChecked(hdlg, DS_PG62))
@@ -335,7 +335,7 @@ char encoded_conn_settings[LARGE_REGISTRY_LEN];
        /*      extra info */
        sprintf(&connect_string[strlen(connect_string)], 
                ";READONLY=%s;PROTOCOL=%s;FAKEOIDINDEX=%s;SHOWOIDCOLUMN=%s;ROWVERSIONING=%s;SHOWSYSTEMTABLES=%s;CONNSETTINGS=%s", 
-               ci->readonly,
+               ci->onlyread,
                ci->protocol,
                ci->fake_oid_index,
                ci->show_oid_column,
@@ -370,7 +370,7 @@ copyAttributes(ConnInfo *ci, char *attribute, char *value)
                strcpy(ci->port, value);
 
        else if (stricmp(attribute, INI_READONLY) == 0)
-               strcpy(ci->readonly, value);
+               strcpy(ci->onlyread, value);
 
        else if (stricmp(attribute, INI_PROTOCOL) == 0)
                strcpy(ci->protocol, value);
@@ -392,7 +392,7 @@ copyAttributes(ConnInfo *ci, char *attribute, char *value)
                // strcpy(ci->conn_settings, value);
        }
 
-       mylog("copyAttributes: DSN='%s',server='%s',dbase='%s',user='%s',passwd='%s',port='%s',readonly='%s',protocol='%s', conn_settings='%s')\n", ci->dsn, ci->server,ci->database,ci->username,ci->password,ci->port,ci->readonly,ci->protocol,ci->conn_settings);
+       mylog("copyAttributes: DSN='%s',server='%s',dbase='%s',user='%s',passwd='%s',port='%s',onlyread='%s',protocol='%s', conn_settings='%s')\n", ci->dsn, ci->server,ci->database,ci->username,ci->password,ci->port,ci->onlyread,ci->protocol,ci->conn_settings);
 
 }
 
@@ -402,8 +402,8 @@ getDSNdefaults(ConnInfo *ci)
        if (ci->port[0] == '\0')
                strcpy(ci->port, DEFAULT_PORT);
 
-       if (ci->readonly[0] == '\0')
-               sprintf(ci->readonly, "%d", globals.readonly);
+       if (ci->onlyread[0] == '\0')
+               sprintf(ci->onlyread, "%d", globals.onlyread);
 
        if (ci->protocol[0] == '\0')
                strcpy(ci->protocol, globals.protocol);
@@ -460,8 +460,8 @@ char encoded_conn_settings[LARGE_REGISTRY_LEN];
        if ( ci->port[0] == '\0' || overwrite)
                SQLGetPrivateProfileString(DSN, INI_PORT, "", ci->port, sizeof(ci->port), ODBC_INI);
 
-       if ( ci->readonly[0] == '\0' || overwrite)
-               SQLGetPrivateProfileString(DSN, INI_READONLY, "", ci->readonly, sizeof(ci->readonly), ODBC_INI);
+       if ( ci->onlyread[0] == '\0' || overwrite)
+               SQLGetPrivateProfileString(DSN, INI_READONLY, "", ci->onlyread, sizeof(ci->onlyread), ODBC_INI);
 
        if ( ci->show_oid_column[0] == '\0' || overwrite)
                SQLGetPrivateProfileString(DSN, INI_SHOWOIDCOLUMN, "", ci->show_oid_column, sizeof(ci->show_oid_column), ODBC_INI);
@@ -501,8 +501,8 @@ char encoded_conn_settings[LARGE_REGISTRY_LEN];
                ci->database,
                ci->username,
                ci->password);
-       qlog("          readonly='%s',protocol='%s',showoid='%s',fakeoidindex='%s',showsystable='%s'\n",
-               ci->readonly,
+       qlog("          onlyread='%s',protocol='%s',showoid='%s',fakeoidindex='%s',showsystable='%s'\n",
+               ci->onlyread,
                ci->protocol,
                ci->show_oid_column,
                ci->fake_oid_index,
@@ -557,7 +557,7 @@ char encoded_conn_settings[LARGE_REGISTRY_LEN];
 
                SQLWritePrivateProfileString(DSN,
                        INI_READONLY,
-                       ci->readonly,
+                       ci->onlyread,
                        ODBC_INI);
 
                SQLWritePrivateProfileString(DSN,
@@ -772,9 +772,9 @@ char temp[256];
                SQLGetPrivateProfileString(section, INI_READONLY, "", 
                                        temp, sizeof(temp), filename);
                if ( temp[0] ) 
-                       globals.readonly = atoi(temp);
+                       globals.onlyread = atoi(temp);
                else
-                       globals.readonly = DEFAULT_READONLY;
+                       globals.onlyread = DEFAULT_READONLY;
 
                /*      Default state for future DSN's protocol attribute
                        This isn't a real driver option YET.  This is more
@@ -818,7 +818,7 @@ char tmp[128];
        SQLWritePrivateProfileString(DBMS_NAME,
                INI_UNIQUEINDEX, tmp, ODBCINST_INI);
 
-       sprintf(tmp, "%d", globals.readonly);
+       sprintf(tmp, "%d", globals.onlyread);
        SQLWritePrivateProfileString(DBMS_NAME,
                INI_READONLY, tmp, ODBCINST_INI);
 
index 87b6a31162f380c3b75ce38c487e1759a67e63bd..13d979a01ffcabd3d5e235846a23275056c3d975 100644 (file)
@@ -108,8 +108,8 @@ StatementClass *self = (StatementClass *) hstmt;
        self->prepare = TRUE;
        self->statement_type = statement_type(self->statement);
 
-       //      Check if connection is readonly (only selects are allowed)
-       if ( CC_is_readonly(self->hdbc) && STMT_UPDATE(self)) {
+       //      Check if connection is onlyread (only selects are allowed)
+       if ( CC_is_onlyread(self->hdbc) && STMT_UPDATE(self)) {
                self->errornumber = STMT_EXEC_ERROR;
                self->errormsg = "Connection is readonly, only select statements are allowed.";
                SC_log_error(func, "", self);
@@ -159,8 +159,8 @@ static char *func = "SQLExecDirect";
        stmt->prepare = FALSE;
        stmt->statement_type = statement_type(stmt->statement);
 
-       //      Check if connection is readonly (only selects are allowed)
-       if ( CC_is_readonly(stmt->hdbc) && STMT_UPDATE(stmt)) {
+       //      Check if connection is onlyread (only selects are allowed)
+       if ( CC_is_onlyread(stmt->hdbc) && STMT_UPDATE(stmt)) {
                stmt->errornumber = STMT_EXEC_ERROR;
                stmt->errormsg = "Connection is readonly, only select statements are allowed.";
                SC_log_error(func, "", stmt);
@@ -727,5 +727,3 @@ char *buffer;
 
        return SQL_SUCCESS;
 }
-
-
index 4550a8b92c6b64b78f1c75e6e6dc7aa186d7ec82..84092b98afa2bdcaf54dbcc2492ef9b34312446b 100644 (file)
@@ -173,7 +173,7 @@ RETCODE result;
         break;
 
     case SQL_DATA_SOURCE_READ_ONLY: /* ODBC 1.0 */
-               p = CC_is_readonly(conn) ? "Y" : "N";
+               p = CC_is_onlyread(conn) ? "Y" : "N";
         break;
 
     case SQL_DATABASE_NAME: /* Support for old ODBC 1.0 Apps */
index cc31c3bdf83aa223a6e4d25de2a9d27cedb8d88b..7c0a18f96584c4814ab31a00c1828eac7692988e 100644 (file)
@@ -61,7 +61,7 @@ mylog(va_alist)
 va_dcl
 {
 char *fmt;
-char *args;
+va_list args;
 char filebuf[80];
        FILE* LOGFP = globals.mylogFP;
 
@@ -95,7 +95,7 @@ void qlog(va_alist)
 va_dcl
 {
 char *fmt;
-char *args;
+va_list args;
 char filebuf[80];
 FILE* LOGFP = globals.qlogFP;
 
index e46c187e4846a9df54ad9f07abf019dd7af1575f..c8d4923436ebdffbf244d32f7f0e84843e8a3d08 100644 (file)
@@ -113,7 +113,7 @@ typedef struct GlobalValues_
        char                            disable_optimizer;
        char                            ksqo;
        char                            unique_index;
-       char                            readonly;
+       char                            onlyread; /* readonly is reserved on Digital C++ compiler */
        char                            use_declarefetch;
        char                            text_as_longvarchar;
        char                            unknowns_as_longvarchar;