diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-08-04 00:43:34 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-08-04 00:43:34 +0000 |
commit | 089003fb462fcce46c02bf47322b429f73c33c50 (patch) | |
tree | 77d78bc3a149df06f5603f60200a6ab363336624 /src/backend/utils/misc | |
parent | 63354a0228a1dbc4a0d5ddc8ecdd8326349d2100 (diff) | |
download | postgresql-089003fb462fcce46c02bf47322b429f73c33c50.tar.gz postgresql-089003fb462fcce46c02bf47322b429f73c33c50.zip |
pgindent run.
Diffstat (limited to 'src/backend/utils/misc')
-rw-r--r-- | src/backend/utils/misc/guc.c | 135 | ||||
-rw-r--r-- | src/backend/utils/misc/help_config.c | 24 |
2 files changed, 84 insertions, 75 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index d26cefa5d0c..da4a508717a 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -10,7 +10,7 @@ * Written by Peter Eisentraut <peter_e@gmx.net>. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.146 2003/08/01 01:23:11 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.147 2003/08/04 00:43:27 momjian Exp $ * *-------------------------------------------------------------------- */ @@ -200,34 +200,34 @@ static char *XactIsoLevel_string; * * Note: these strings are deliberately not localized. */ -const char * const GucContext_Names[] = +const char *const GucContext_Names[] = { - /* PGC_INTERNAL */ "internal", - /* PGC_POSTMASTER */ "postmaster", - /* PGC_SIGHUP */ "sighup", - /* PGC_BACKEND */ "backend", - /* PGC_SUSET */ "superuser", - /* PGC_USERLIMIT */ "userlimit", - /* PGC_USERSET */ "user" + /* PGC_INTERNAL */ "internal", + /* PGC_POSTMASTER */ "postmaster", + /* PGC_SIGHUP */ "sighup", + /* PGC_BACKEND */ "backend", + /* PGC_SUSET */ "superuser", + /* PGC_USERLIMIT */ "userlimit", + /* PGC_USERSET */ "user" }; /* * Displayable names for source types (enum GucSource) * * Note: these strings are deliberately not localized. - */ -const char * const GucSource_Names[] = + */ +const char *const GucSource_Names[] = { - /* PGC_S_DEFAULT */ "default", - /* PGC_S_ENV_VAR */ "environment variable", - /* PGC_S_FILE */ "configuration file", - /* PGC_S_ARGV */ "command line", - /* PGC_S_UNPRIVILEGED */ "unprivileged", - /* PGC_S_DATABASE */ "database", - /* PGC_S_USER */ "user", - /* PGC_S_CLIENT */ "client", - /* PGC_S_OVERRIDE */ "override", - /* PGC_S_SESSION */ "session" + /* PGC_S_DEFAULT */ "default", + /* PGC_S_ENV_VAR */ "environment variable", + /* PGC_S_FILE */ "configuration file", + /* PGC_S_ARGV */ "command line", + /* PGC_S_UNPRIVILEGED */ "unprivileged", + /* PGC_S_DATABASE */ "database", + /* PGC_S_USER */ "user", + /* PGC_S_CLIENT */ "client", + /* PGC_S_OVERRIDE */ "override", + /* PGC_S_SESSION */ "session" }; /* @@ -308,12 +308,12 @@ const char *const config_group_names[] = * * Note: these strings are deliberately not localized. */ -const char * const config_type_names[] = +const char *const config_type_names[] = { - /* PGC_BOOL */ "bool", - /* PGC_INT */ "integer", - /* PGC_REAL */ "real", - /* PGC_STRING */ "string" + /* PGC_BOOL */ "bool", + /* PGC_INT */ "integer", + /* PGC_REAL */ "real", + /* PGC_STRING */ "string" }; @@ -1351,7 +1351,7 @@ static struct config_string ConfigureNamesString[] = {"default_transaction_isolation", PGC_USERSET, CLIENT_CONN_STATEMENT, gettext_noop("The default isolation level of each new transaction"), gettext_noop("Each SQL transaction has an isolation level, which " - "can be either \"read committed\" or \"serializable\".") + "can be either \"read committed\" or \"serializable\".") }, &default_iso_level_string, "read committed", assign_defaultxactisolevel, NULL @@ -1800,7 +1800,11 @@ InitializeGUCOptions(void) Assert(conf->reset_val >= conf->min); Assert(conf->reset_val <= conf->max); - /* Check to make sure we only have valid PGC_USERLIMITs */ + + /* + * Check to make sure we only have valid + * PGC_USERLIMITs + */ Assert(conf->gen.context != PGC_USERLIMIT || strcmp(conf->gen.name, "log_min_duration_statement") == 0); if (conf->assign_hook) @@ -1831,11 +1835,14 @@ InitializeGUCOptions(void) struct config_string *conf = (struct config_string *) gconf; char *str; - /* Check to make sure we only have valid PGC_USERLIMITs */ + /* + * Check to make sure we only have valid + * PGC_USERLIMITs + */ Assert(conf->gen.context != PGC_USERLIMIT || conf->assign_hook == assign_log_min_messages || - conf->assign_hook == assign_client_min_messages || - conf->assign_hook == assign_min_error_statement); + conf->assign_hook == assign_client_min_messages || + conf->assign_hook == assign_min_error_statement); *conf->variable = NULL; conf->reset_val = NULL; conf->session_val = NULL; @@ -2434,8 +2441,8 @@ set_config_option(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("\"%s\" cannot be changed after server start", - name))); + errmsg("\"%s\" cannot be changed after server start", + name))); return false; } break; @@ -2474,8 +2481,8 @@ set_config_option(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), - errmsg("\"%s\" cannot be set after connection start", - name))); + errmsg("\"%s\" cannot be set after connection start", + name))); return false; } break; @@ -2514,7 +2521,7 @@ set_config_option(const char *name, const char *value, * 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 */ + DoIt_orig = DoIt; /* we might have to reverse this later */ if (record->source > source) { if (DoIt && !makeDefault) @@ -2554,8 +2561,8 @@ set_config_option(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set option \"%s\"", - name), + errmsg("permission denied to set option \"%s\"", + name), errhint("Must be superuser to change this value to false."))); return false; } @@ -2565,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; + DoIt = DoIt_orig; } else { @@ -2630,8 +2637,8 @@ set_config_option(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("\"%s\" requires an integer value", - name))); + errmsg("\"%s\" requires an integer value", + name))); return false; } if (newval < conf->min || newval > conf->max) @@ -2639,7 +2646,7 @@ set_config_option(const char *name, const char *value, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("%d is outside the valid range for \"%s\" (%d .. %d)", - newval, name, conf->min, conf->max))); + newval, name, conf->min, conf->max))); return false; } /* Limit non-superuser changes */ @@ -2651,8 +2658,8 @@ set_config_option(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set option \"%s\"", - name), + errmsg("permission denied to set option \"%s\"", + name), errhint("Must be superuser to increase this value or set it to zero."))); return false; } @@ -2662,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; + DoIt = DoIt_orig; } else { @@ -2736,7 +2743,7 @@ set_config_option(const char *name, const char *value, ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("%g is outside the valid range for \"%s\" (%g .. %g)", - newval, name, conf->min, conf->max))); + newval, name, conf->min, conf->max))); return false; } /* Limit non-superuser changes */ @@ -2747,8 +2754,8 @@ set_config_option(const char *name, const char *value, { ereport(elevel, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set option \"%s\"", - name), + errmsg("permission denied to set option \"%s\"", + name), errhint("Must be superuser to increase this value."))); return false; } @@ -2758,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; + DoIt = DoIt_orig; } else { @@ -2831,7 +2838,8 @@ set_config_option(const char *name, const char *value, if (record->context == PGC_USERLIMIT && *conf->variable) { - int old_int_value, new_int_value; + int old_int_value, + new_int_value; /* all USERLIMIT strings are message levels */ assign_msglvl(&old_int_value, conf->reset_val, @@ -2844,10 +2852,10 @@ set_config_option(const char *name, const char *value, !superuser()) { ereport(elevel, - (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("permission denied to set option \"%s\"", - name), - errhint("Must be superuser to increase this value."))); + (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), + errmsg("permission denied to set option \"%s\"", + name), + errhint("Must be superuser to increase this value."))); return false; } /* Allow admin to override non-superuser setting */ @@ -2855,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; + DoIt = DoIt_orig; } } else if (conf->reset_val) @@ -2901,8 +2909,8 @@ set_config_option(const char *name, const char *value, free(newval); ereport(elevel, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid value for \"%s\": \"%s\"", - name, value ? value : ""))); + errmsg("invalid value for \"%s\": \"%s\"", + name, value ? value : ""))); return false; } else if (hookresult != newval) @@ -3408,8 +3416,8 @@ GetConfigOptionByName(const char *name, const char **varname) void GetConfigOptionByNum(int varnum, const char **values, bool *noshow) { - char buffer[256]; - struct config_generic *conf; + char buffer[256]; + struct config_generic *conf; /* check requested variable number valid */ Assert((varnum >= 0) && (varnum < num_guc_variables)); @@ -3490,7 +3498,8 @@ GetConfigOptionByNum(int varnum, const char **values, bool *noshow) default: { /* - * should never get here, but in case we do, set 'em to NULL + * should never get here, but in case we do, set 'em to + * NULL */ /* min_val */ @@ -3566,8 +3575,8 @@ show_all_settings(PG_FUNCTION_ARGS) oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); /* - * need a tuple descriptor representing NUM_PG_SETTINGS_ATTS columns - * of the appropriate types + * need a tuple descriptor representing NUM_PG_SETTINGS_ATTS + * columns of the appropriate types */ tupdesc = CreateTemplateTupleDesc(NUM_PG_SETTINGS_ATTS, false); TupleDescInitEntry(tupdesc, (AttrNumber) 1, "name", @@ -4371,7 +4380,7 @@ assign_phony_autocommit(bool newval, bool doit, bool interactive) if (doit && interactive) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("SET AUTOCOMMIT TO OFF is no longer supported"))); + errmsg("SET AUTOCOMMIT TO OFF is no longer supported"))); return false; } return true; diff --git a/src/backend/utils/misc/help_config.c b/src/backend/utils/misc/help_config.c index d5d9736e593..ed117bef18d 100644 --- a/src/backend/utils/misc/help_config.c +++ b/src/backend/utils/misc/help_config.c @@ -25,7 +25,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/misc/help_config.c,v 1.3 2003/07/28 19:31:32 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/misc/help_config.c,v 1.4 2003/08/04 00:43:27 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -58,35 +58,35 @@ enum outputFormat MACHINE_OUTPUT }; -static const char * const GENERIC_FORMAT[] = { +static const char *const GENERIC_FORMAT[] = { gettext_noop("Name : %-20s \nContext : %-20s \nGroup : %-20s\n"), gettext_noop("%s\t%s\t%s\t") }; -static const char * const GENERIC_DESC[] = { +static const char *const GENERIC_DESC[] = { gettext_noop("Description: %s\n%s\n"), gettext_noop("%s %s\n") }; -static const char * const BOOL_FORMAT[] = { +static const char *const BOOL_FORMAT[] = { gettext_noop("Type : BOOL\nReset Value: %-s \n"), gettext_noop("BOOL\t%s\t\t\t") }; -static const char * const INT_FORMAT[] = { +static const char *const INT_FORMAT[] = { gettext_noop("Type : INT\nReset Value: %-20d \nMin Value : %-20d \nMax Value : %-20d \n"), gettext_noop("INT\t%d\t%d\t%d\t") }; -static const char * const REAL_FORMAT[] = { +static const char *const REAL_FORMAT[] = { gettext_noop("Type : REAL\nReset Value: %-20g \nMin Value : %-20g \nMax Value : %-20g \n"), gettext_noop("REAL\t%g\t%g\t%g\t") }; -static const char * const STRING_FORMAT[] = { +static const char *const STRING_FORMAT[] = { gettext_noop("Type : STRING\nReset Value: %-s \n"), gettext_noop("STRING\t%s\t\t\t") }; -static const char * const COLUMN_HEADER[] = { +static const char *const COLUMN_HEADER[] = { "", gettext_noop("NAME\tCONTEXT\tGROUP\tTYPE\tRESET_VALUE\tMIN\tMAX\tSHORT_DESCRIPTION\tLONG_DESCRIPTION\n") }; -static const char * const ROW_SEPARATOR[] = { +static const char *const ROW_SEPARATOR[] = { "------------------------------------------------------------\n", "" }; @@ -101,8 +101,8 @@ static char *groupString = NULL; /* The var group pattern to match */ static bool groupRegexBool = false; /* Match the group pattern as a * regex */ static enum outputFormat outFormat = HUMAN_OUTPUT; -static bool suppressAllHeaders = false; /* MACHINE_OUTPUT output, no column - * headers */ +static bool suppressAllHeaders = false; /* MACHINE_OUTPUT output, no + * column headers */ static bool groupResults = true; /* sort result list by groups */ @@ -444,5 +444,5 @@ helpMessage(void) " -m Machine friendly format: tab separated fields\n" " -M Same as m, except header with column names is suppressed\n"), usageErrMsg() - ); + ); } |