Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd672ea6

Browse files
committed
Turn xmlbinary and xmloption GUC variables into enumsTurn xmlbinary and
xmloption GUC variables into enums..
1 parent55f6e5f commitd672ea6

File tree

3 files changed

+37
-66
lines changed

3 files changed

+37
-66
lines changed

‎src/backend/utils/adt/xml.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.71 2008/03/25 22:42:44 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.72 2008/04/04 08:33:15 mha Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -86,8 +86,8 @@
8686

8787

8888
/* GUC variables */
89-
XmlBinaryTypexmlbinary;
90-
XmlOptionTypexmloption;
89+
intxmlbinary;
90+
intxmloption;
9191

9292
#ifdefUSE_LIBXML
9393

‎src/backend/utils/misc/guc.c

Lines changed: 31 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.443 2008/04/03 13:25:02 mha Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.444 2008/04/04 08:33:15 mha Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -155,8 +155,6 @@ static bool assign_transaction_read_only(bool newval, bool doit, GucSource sourc
155155
staticconstchar*assign_canonical_path(constchar*newval,booldoit,GucSourcesource);
156156
staticconstchar*assign_backslash_quote(constchar*newval,booldoit,GucSourcesource);
157157
staticconstchar*assign_timezone_abbreviations(constchar*newval,booldoit,GucSourcesource);
158-
staticconstchar*assign_xmlbinary(constchar*newval,booldoit,GucSourcesource);
159-
staticconstchar*assign_xmloption(constchar*newval,booldoit,GucSourcesource);
160158
staticconstchar*show_archive_command(void);
161159
staticboolassign_tcp_keepalives_idle(intnewval,booldoit,GucSourcesource);
162160
staticboolassign_tcp_keepalives_interval(intnewval,booldoit,GucSourcesource);
@@ -243,6 +241,17 @@ static const struct config_enum_entry syslog_facility_options[] = {
243241
};
244242
#endif
245243

244+
staticconststructconfig_enum_entryxmlbinary_options[]= {
245+
{"base64",XMLBINARY_BASE64},
246+
{"hex",XMLBINARY_HEX},
247+
{NULL,0}
248+
};
249+
250+
staticconststructconfig_enum_entryxmloption_options[]= {
251+
{"content",XMLOPTION_CONTENT},
252+
{"document",XMLOPTION_DOCUMENT},
253+
{NULL,0}
254+
};
246255

247256
/*
248257
* GUC option variables that are exported from this module
@@ -316,8 +325,6 @@ static char *timezone_abbreviations_string;
316325
staticchar*XactIsoLevel_string;
317326
staticchar*data_directory;
318327
staticchar*custom_variable_classes;
319-
staticchar*xmlbinary_string;
320-
staticchar*xmloption_string;
321328
staticintmax_function_args;
322329
staticintmax_index_keys;
323330
staticintmax_identifier_length;
@@ -2382,25 +2389,6 @@ static struct config_string ConfigureNamesString[] =
23822389
NULL,assign_canonical_path,NULL
23832390
},
23842391

2385-
{
2386-
{"xmlbinary",PGC_USERSET,CLIENT_CONN_STATEMENT,
2387-
gettext_noop("Sets how binary values are to be encoded in XML."),
2388-
gettext_noop("Valid values are BASE64 and HEX.")
2389-
},
2390-
&xmlbinary_string,
2391-
"base64",assign_xmlbinary,NULL
2392-
},
2393-
2394-
{
2395-
{"xmloption",PGC_USERSET,CLIENT_CONN_STATEMENT,
2396-
gettext_noop("Sets whether XML data in implicit parsing and serialization "
2397-
"operations is to be considered as documents or content fragments."),
2398-
gettext_noop("Valid values are DOCUMENT and CONTENT.")
2399-
},
2400-
&xmloption_string,
2401-
"content",assign_xmloption,NULL
2402-
},
2403-
24042392
{
24052393
{"default_text_search_config",PGC_USERSET,CLIENT_CONN_LOCALE,
24062394
gettext_noop("Sets default text search configuration."),
@@ -2524,6 +2512,25 @@ static struct config_enum ConfigureNamesEnum[] =
25242512
assign_session_replication_role,NULL
25252513
},
25262514

2515+
{
2516+
{"xmlbinary",PGC_USERSET,CLIENT_CONN_STATEMENT,
2517+
gettext_noop("Sets how binary values are to be encoded in XML."),
2518+
gettext_noop("Valid values are BASE64 and HEX.")
2519+
},
2520+
&xmlbinary,
2521+
XMLBINARY_BASE64,xmlbinary_options,NULL,NULL
2522+
},
2523+
2524+
{
2525+
{"xmloption",PGC_USERSET,CLIENT_CONN_STATEMENT,
2526+
gettext_noop("Sets whether XML data in implicit parsing and serialization "
2527+
"operations is to be considered as documents or content fragments."),
2528+
gettext_noop("Valid values are DOCUMENT and CONTENT.")
2529+
},
2530+
&xmloption,
2531+
XMLOPTION_CONTENT,xmloption_options,NULL,NULL
2532+
},
2533+
25272534

25282535
/* End-of-list marker */
25292536
{
@@ -7172,42 +7179,6 @@ pg_timezone_abbrev_initialize(void)
71727179
}
71737180
}
71747181

7175-
staticconstchar*
7176-
assign_xmlbinary(constchar*newval,booldoit,GucSourcesource)
7177-
{
7178-
XmlBinaryTypexb;
7179-
7180-
if (pg_strcasecmp(newval,"base64")==0)
7181-
xb=XMLBINARY_BASE64;
7182-
elseif (pg_strcasecmp(newval,"hex")==0)
7183-
xb=XMLBINARY_HEX;
7184-
else
7185-
returnNULL;/* reject */
7186-
7187-
if (doit)
7188-
xmlbinary=xb;
7189-
7190-
returnnewval;
7191-
}
7192-
7193-
staticconstchar*
7194-
assign_xmloption(constchar*newval,booldoit,GucSourcesource)
7195-
{
7196-
XmlOptionTypexo;
7197-
7198-
if (pg_strcasecmp(newval,"document")==0)
7199-
xo=XMLOPTION_DOCUMENT;
7200-
elseif (pg_strcasecmp(newval,"content")==0)
7201-
xo=XMLOPTION_CONTENT;
7202-
else
7203-
returnNULL;/* reject */
7204-
7205-
if (doit)
7206-
xmloption=xo;
7207-
7208-
returnnewval;
7209-
}
7210-
72117182
staticconstchar*
72127183
show_archive_command(void)
72137184
{

‎src/include/utils/xml.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.23 2008/01/15 18:57:00 tgl Exp $
10+
* $PostgreSQL: pgsql/src/include/utils/xml.h,v 1.24 2008/04/04 08:33:15 mha Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -83,8 +83,8 @@ typedef enum
8383
XMLBINARY_HEX
8484
}XmlBinaryType;
8585

86-
externXmlBinaryTypexmlbinary;
86+
externintxmlbinary;/* XmlBinaryType, but int for guc enum */
8787

88-
externXmlOptionTypexmloption;
88+
externintxmloption;/* XmlOptionType, but int for guc enum */
8989

9090
#endif/* XML_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp