Rename DoIt to changeVar, for clarity.
authorBruce Momjian
Mon, 1 Sep 2003 04:15:51 +0000 (04:15 +0000)
committerBruce Momjian
Mon, 1 Sep 2003 04:15:51 +0000 (04:15 +0000)
src/backend/utils/misc/guc.c
src/include/utils/guc.h

index 0a4fd218109b064aa8777c30b72dd0e688004acb..2f8226e5d3037d235498f7f33dfa06f92cda8cd5 100644 (file)
@@ -10,7 +10,7 @@
  * Written by Peter Eisentraut .
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.151 2003/08/26 15:38:25 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.152 2003/09/01 04:15:50 momjian Exp $
  *
  *--------------------------------------------------------------------
  */
@@ -2373,7 +2373,7 @@ parse_real(const char *value, double *result)
  * properly.
  *
  * If value is NULL, set the option to its default value. If the
- * parameter DoIt is false then don't really set the option but do all
+ * parameter changeVal is false then don't really set the option but do all
  * the checks to see if it would work.
  *
  * If there is an error (non-existing option, invalid value) then an
@@ -2390,13 +2390,13 @@ parse_real(const char *value, double *result)
 bool
 set_config_option(const char *name, const char *value,
                  GucContext context, GucSource source,
-                 bool isLocal, bool DoIt)
+                 bool isLocal, bool changeVal)
 {
    struct config_generic *record;
    int         elevel;
    bool        interactive;
    bool        makeDefault;
-   bool        DoIt_orig;
+   bool        changeVal_orig;
 
    if (context == PGC_SIGHUP || source == PGC_S_DEFAULT)
        elevel = DEBUG2;
@@ -2511,26 +2511,26 @@ set_config_option(const char *name, const char *value,
     * Should we set reset/session values?  (If so, the behavior is not
     * transactional.)
     */
-   makeDefault = DoIt && (source <= PGC_S_OVERRIDE) && (value != NULL);
+   makeDefault = changeVal && (source <= PGC_S_OVERRIDE) && (value != NULL);
 
    /*
     * Ignore attempted set if overridden by previously processed setting.
-    * However, if DoIt is false then plow ahead anyway since we are
+    * However, if changeVal is false then plow ahead anyway since we are
     * trying to find out if the value is potentially good, not actually
     * use it. Also keep going if makeDefault is true, since we may want
     * to set the reset/session values even if we can't set the variable
     * itself.
     */
-   DoIt_orig = DoIt;           /* we might have to reverse this later */
+   changeVal_orig = changeVal;         /* we might have to reverse this later */
    if (record->source > source)
    {
-       if (DoIt && !makeDefault)
+       if (changeVal && !makeDefault)
        {
            elog(DEBUG3, "\"%s\": setting ignored because previous source is higher priority",
                 name);
            return true;
        }
-       DoIt = false;           /* we won't change the variable itself */
+       changeVal = false;          /* we won't change the variable itself */
    }
 
    /*
@@ -2572,7 +2572,7 @@ set_config_option(const char *name, const char *value,
                        record->session_source > PGC_S_UNPRIVILEGED &&
                        newval > conf->session_val &&
                        !superuser())
-                       DoIt = DoIt_orig;
+                       changeVal = changeVal_orig;
                }
                else
                {
@@ -2581,7 +2581,7 @@ set_config_option(const char *name, const char *value,
                }
 
                if (conf->assign_hook)
-                   if (!(*conf->assign_hook) (newval, DoIt, interactive))
+                   if (!(*conf->assign_hook) (newval, changeVal, interactive))
                    {
                        ereport(elevel,
                                (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
@@ -2590,9 +2590,9 @@ set_config_option(const char *name, const char *value,
                        return false;
                    }
 
-               if (DoIt || makeDefault)
+               if (changeVal || makeDefault)
                {
-                   if (DoIt)
+                   if (changeVal)
                    {
                        *conf->variable = newval;
                        conf->gen.source = source;
@@ -2669,7 +2669,7 @@ set_config_option(const char *name, const char *value,
                        record->session_source > PGC_S_UNPRIVILEGED &&
                        newval < conf->session_val &&
                        !superuser())
-                       DoIt = DoIt_orig;
+                       changeVal = changeVal_orig;
                }
                else
                {
@@ -2678,7 +2678,7 @@ set_config_option(const char *name, const char *value,
                }
 
                if (conf->assign_hook)
-                   if (!(*conf->assign_hook) (newval, DoIt, interactive))
+                   if (!(*conf->assign_hook) (newval, changeVal, interactive))
                    {
                        ereport(elevel,
                                (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
@@ -2687,9 +2687,9 @@ set_config_option(const char *name, const char *value,
                        return false;
                    }
 
-               if (DoIt || makeDefault)
+               if (changeVal || makeDefault)
                {
-                   if (DoIt)
+                   if (changeVal)
                    {
                        *conf->variable = newval;
                        conf->gen.source = source;
@@ -2765,7 +2765,7 @@ set_config_option(const char *name, const char *value,
                        record->session_source > PGC_S_UNPRIVILEGED &&
                        newval < conf->session_val &&
                        !superuser())
-                       DoIt = DoIt_orig;
+                       changeVal = changeVal_orig;
                }
                else
                {
@@ -2774,7 +2774,7 @@ set_config_option(const char *name, const char *value,
                }
 
                if (conf->assign_hook)
-                   if (!(*conf->assign_hook) (newval, DoIt, interactive))
+                   if (!(*conf->assign_hook) (newval, changeVal, interactive))
                    {
                        ereport(elevel,
                                (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
@@ -2783,9 +2783,9 @@ set_config_option(const char *name, const char *value,
                        return false;
                    }
 
-               if (DoIt || makeDefault)
+               if (changeVal || makeDefault)
                {
-                   if (DoIt)
+                   if (changeVal)
                    {
                        *conf->variable = newval;
                        conf->gen.source = source;
@@ -2863,7 +2863,7 @@ set_config_option(const char *name, const char *value,
                            record->session_source > PGC_S_UNPRIVILEGED &&
                            newval < conf->session_val &&
                            !superuser())
-                           DoIt = DoIt_orig;
+                           changeVal = changeVal_orig;
                    }
                }
                else if (conf->reset_val)
@@ -2902,7 +2902,7 @@ set_config_option(const char *name, const char *value,
                    const char *hookresult;
 
                    hookresult = (*conf->assign_hook) (newval,
-                                                      DoIt, interactive);
+                                                      changeVal, interactive);
                    guc_string_workspace = NULL;
                    if (hookresult == NULL)
                    {
@@ -2932,9 +2932,9 @@ set_config_option(const char *name, const char *value,
 
                guc_string_workspace = NULL;
 
-               if (DoIt || makeDefault)
+               if (changeVal || makeDefault)
                {
-                   if (DoIt)
+                   if (changeVal)
                    {
                        SET_STRING_VARIABLE(conf, newval);
                        conf->gen.source = source;
@@ -2976,7 +2976,7 @@ set_config_option(const char *name, const char *value,
            }
    }
 
-   if (DoIt && (record->flags & GUC_REPORT))
+   if (changeVal && (record->flags & GUC_REPORT))
        ReportGUCOption(record);
 
    return true;
index 80ad3b3aa66439d01b44981be1d0b1f628849b0e..75288ac43c2aaa185e2e6a08876c4036fe3b9a58 100644 (file)
@@ -7,7 +7,7 @@
  * Copyright (c) 2000-2003, PostgreSQL Global Development Group
  * Written by Peter Eisentraut .
  *
- * $Id: guc.h,v 1.40 2003/08/04 23:59:41 tgl Exp $
+ * $Id: guc.h,v 1.41 2003/09/01 04:15:51 momjian Exp $
  *--------------------------------------------------------------------
  */
 #ifndef GUC_H
@@ -127,7 +127,7 @@ extern void BeginReportingGUCOptions(void);
 extern void ParseLongOption(const char *string, char **name, char **value);
 extern bool set_config_option(const char *name, const char *value,
                  GucContext context, GucSource source,
-                 bool isLocal, bool DoIt);
+                 bool isLocal, bool changeVal);
 extern void ShowGUCConfigOption(const char *name, DestReceiver *dest);
 extern void ShowAllGUCConfig(DestReceiver *dest);
 extern char *GetConfigOptionByName(const char *name, const char **varname);