File tree Expand file tree Collapse file tree 2 files changed +23
-28
lines changed
Expand file tree Collapse file tree 2 files changed +23
-28
lines changed Original file line number Diff line number Diff line change @@ -169,8 +169,29 @@ extern int pg_strcasecmp(const char *s1, const char *s2);
169169extern int pg_strncasecmp (const char * s1 , const char * s2 , size_t n );
170170extern unsigned char pg_toupper (unsigned char ch );
171171extern unsigned char pg_tolower (unsigned char ch );
172- extern unsigned char pg_ascii_toupper (unsigned char ch );
173- extern unsigned char pg_ascii_tolower (unsigned char ch );
172+
173+ /*
174+ * Fold a character to upper case, following C/POSIX locale rules.
175+ */
176+ static inline unsigned char
177+ pg_ascii_toupper (unsigned char ch )
178+ {
179+ if (ch >= 'a' && ch <= 'z' )
180+ ch += 'A' - 'a' ;
181+ return ch ;
182+ }
183+
184+ /*
185+ * Fold a character to lower case, following C/POSIX locale rules.
186+ */
187+ static inline unsigned char
188+ pg_ascii_tolower (unsigned char ch )
189+ {
190+ if (ch >= 'A' && ch <= 'Z' )
191+ ch += 'a' - 'A' ;
192+ return ch ;
193+ }
194+
174195
175196/*
176197 * Beginning in v12, we always replace snprintf() and friends with our own
Original file line number Diff line number Diff line change 1313 *
1414 * NB: this code should match downcase_truncate_identifier() in scansup.c.
1515 *
16- * We also provide strict ASCII-only case conversion functions, which can
17- * be used to implement C/POSIX case folding semantics no matter what the
18- * C library thinks the locale is.
19- *
2016 *
2117 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
2218 *
@@ -127,25 +123,3 @@ pg_tolower(unsigned char ch)
127123 ch = tolower (ch );
128124 return ch ;
129125}
130-
131- /*
132- * Fold a character to upper case, following C/POSIX locale rules.
133- */
134- unsigned char
135- pg_ascii_toupper (unsigned char ch )
136- {
137- if (ch >= 'a' && ch <= 'z' )
138- ch += 'A' - 'a' ;
139- return ch ;
140- }
141-
142- /*
143- * Fold a character to lower case, following C/POSIX locale rules.
144- */
145- unsigned char
146- pg_ascii_tolower (unsigned char ch )
147- {
148- if (ch >= 'A' && ch <= 'Z' )
149- ch += 'a' - 'A' ;
150- return ch ;
151- }
You can’t perform that action at this time.
0 commit comments