diff options
Diffstat (limited to 'src/include/common')
| -rw-r--r-- | src/include/common/logging.h | 4 | ||||
| -rw-r--r-- | src/include/common/string.h | 2 | ||||
| -rw-r--r-- | src/include/common/unicode_case.h | 10 | ||||
| -rw-r--r-- | src/include/common/unicode_case_table.h | 13 | ||||
| -rw-r--r-- | src/include/common/unicode_category.h | 46 | ||||
| -rw-r--r-- | src/include/common/unicode_category_table.h | 8 | ||||
| -rw-r--r-- | src/include/common/unicode_norm.h | 6 | 
7 files changed, 41 insertions, 48 deletions
diff --git a/src/include/common/logging.h b/src/include/common/logging.h index 81529ee8f29..2e0333dc009 100644 --- a/src/include/common/logging.h +++ b/src/include/common/logging.h @@ -93,10 +93,10 @@ void		pg_logging_set_pre_callback(void (*cb) (void));  void		pg_logging_set_locus_callback(void (*cb) (const char **filename, uint64 *lineno));  void		pg_log_generic(enum pg_log_level level, enum pg_log_part part, -						   const char *pg_restrict fmt,...) +						   const char *restrict fmt,...)  			pg_attribute_printf(3, 4);  void		pg_log_generic_v(enum pg_log_level level, enum pg_log_part part, -							 const char *pg_restrict fmt, va_list ap) +							 const char *restrict fmt, va_list ap)  			pg_attribute_printf(3, 0);  /* diff --git a/src/include/common/string.h b/src/include/common/string.h index 55ed8774364..32a97c24b22 100644 --- a/src/include/common/string.h +++ b/src/include/common/string.h @@ -25,7 +25,7 @@ typedef struct PromptInterruptContext  /* functions in src/common/string.c */  extern bool pg_str_endswith(const char *str, const char *end); -extern int	strtoint(const char *pg_restrict str, char **pg_restrict endptr, +extern int	strtoint(const char *restrict str, char **restrict endptr,  					 int base);  extern char *pg_clean_ascii(const char *str, int alloc_flags);  extern int	pg_strip_crlf(char *str); diff --git a/src/include/common/unicode_case.h b/src/include/common/unicode_case.h index 41e2c1f4b33..6bcffd349c2 100644 --- a/src/include/common/unicode_case.h +++ b/src/include/common/unicode_case.h @@ -14,14 +14,12 @@  #ifndef UNICODE_CASE_H  #define UNICODE_CASE_H -#include "mb/pg_wchar.h" -  typedef size_t (*WordBoundaryNext) (void *wbstate); -pg_wchar	unicode_lowercase_simple(pg_wchar code); -pg_wchar	unicode_titlecase_simple(pg_wchar code); -pg_wchar	unicode_uppercase_simple(pg_wchar code); -pg_wchar	unicode_casefold_simple(pg_wchar code); +char32_t	unicode_lowercase_simple(char32_t code); +char32_t	unicode_titlecase_simple(char32_t code); +char32_t	unicode_uppercase_simple(char32_t code); +char32_t	unicode_casefold_simple(char32_t code);  size_t		unicode_strlower(char *dst, size_t dstsize, const char *src,  							 ssize_t srclen, bool full);  size_t		unicode_strtitle(char *dst, size_t dstsize, const char *src, diff --git a/src/include/common/unicode_case_table.h b/src/include/common/unicode_case_table.h index d5311786582..0a14fb2d97b 100644 --- a/src/include/common/unicode_case_table.h +++ b/src/include/common/unicode_case_table.h @@ -18,7 +18,6 @@   */  #include "common/unicode_case.h" -#include "mb/pg_wchar.h"  /*   * The maximum number of codepoints that can result from case mapping @@ -45,7 +44,7 @@ typedef enum  typedef struct  {  	int16		conditions; -	pg_wchar	map[NCaseKind][MAX_CASE_EXPANSION]; +	char32_t	map[NCaseKind][MAX_CASE_EXPANSION];  } pg_special_case;  /* @@ -166,7 +165,7 @@ static const pg_special_case special_case[106] =   * The entry case_map_lower[case_index(codepoint)] is the mapping for the   * given codepoint.   */ -static const pg_wchar case_map_lower[1704] = +static const char32_t case_map_lower[1704] =  {  	0x000000,					/* reserved */  	0x000000,					/* U+000000 */ @@ -1879,7 +1878,7 @@ static const pg_wchar case_map_lower[1704] =   * The entry case_map_title[case_index(codepoint)] is the mapping for the   * given codepoint.   */ -static const pg_wchar case_map_title[1704] = +static const char32_t case_map_title[1704] =  {  	0x000000,					/* reserved */  	0x000000,					/* U+000000 */ @@ -3592,7 +3591,7 @@ static const pg_wchar case_map_title[1704] =   * The entry case_map_upper[case_index(codepoint)] is the mapping for the   * given codepoint.   */ -static const pg_wchar case_map_upper[1704] = +static const char32_t case_map_upper[1704] =  {  	0x000000,					/* reserved */  	0x000000,					/* U+000000 */ @@ -5305,7 +5304,7 @@ static const pg_wchar case_map_upper[1704] =   * The entry case_map_fold[case_index(codepoint)] is the mapping for the   * given codepoint.   */ -static const pg_wchar case_map_fold[1704] = +static const char32_t case_map_fold[1704] =  {  	0x000000,					/* reserved */  	0x000000,					/* U+000000 */ @@ -13522,7 +13521,7 @@ static const uint16 case_map[4778] =   * the offset into the mapping tables.   */  static inline uint16 -case_index(pg_wchar cp) +case_index(char32_t cp)  {  	/* Fast path for codepoints < 0x0588 */  	if (cp < 0x0588) diff --git a/src/include/common/unicode_category.h b/src/include/common/unicode_category.h index 8fd8b67a416..684143d3c8a 100644 --- a/src/include/common/unicode_category.h +++ b/src/include/common/unicode_category.h @@ -14,8 +14,6 @@  #ifndef UNICODE_CATEGORY_H  #define UNICODE_CATEGORY_H -#include "mb/pg_wchar.h" -  /*   * Unicode General Category Values   * @@ -61,31 +59,31 @@ typedef enum pg_unicode_category  	PG_U_FINAL_PUNCTUATION = 29 /* Pf */  } pg_unicode_category; -extern pg_unicode_category unicode_category(pg_wchar code); +extern pg_unicode_category unicode_category(char32_t code);  extern const char *unicode_category_string(pg_unicode_category category);  extern const char *unicode_category_abbrev(pg_unicode_category category); -extern bool pg_u_prop_alphabetic(pg_wchar code); -extern bool pg_u_prop_lowercase(pg_wchar code); -extern bool pg_u_prop_uppercase(pg_wchar code); -extern bool pg_u_prop_cased(pg_wchar code); -extern bool pg_u_prop_case_ignorable(pg_wchar code); -extern bool pg_u_prop_white_space(pg_wchar code); -extern bool pg_u_prop_hex_digit(pg_wchar code); -extern bool pg_u_prop_join_control(pg_wchar code); +extern bool pg_u_prop_alphabetic(char32_t code); +extern bool pg_u_prop_lowercase(char32_t code); +extern bool pg_u_prop_uppercase(char32_t code); +extern bool pg_u_prop_cased(char32_t code); +extern bool pg_u_prop_case_ignorable(char32_t code); +extern bool pg_u_prop_white_space(char32_t code); +extern bool pg_u_prop_hex_digit(char32_t code); +extern bool pg_u_prop_join_control(char32_t code); -extern bool pg_u_isdigit(pg_wchar code, bool posix); -extern bool pg_u_isalpha(pg_wchar code); -extern bool pg_u_isalnum(pg_wchar code, bool posix); -extern bool pg_u_isword(pg_wchar code); -extern bool pg_u_isupper(pg_wchar code); -extern bool pg_u_islower(pg_wchar code); -extern bool pg_u_isblank(pg_wchar code); -extern bool pg_u_iscntrl(pg_wchar code); -extern bool pg_u_isgraph(pg_wchar code); -extern bool pg_u_isprint(pg_wchar code); -extern bool pg_u_ispunct(pg_wchar code, bool posix); -extern bool pg_u_isspace(pg_wchar code); -extern bool pg_u_isxdigit(pg_wchar code, bool posix); +extern bool pg_u_isdigit(char32_t code, bool posix); +extern bool pg_u_isalpha(char32_t code); +extern bool pg_u_isalnum(char32_t code, bool posix); +extern bool pg_u_isword(char32_t code); +extern bool pg_u_isupper(char32_t code); +extern bool pg_u_islower(char32_t code); +extern bool pg_u_isblank(char32_t code); +extern bool pg_u_iscntrl(char32_t code); +extern bool pg_u_isgraph(char32_t code); +extern bool pg_u_isprint(char32_t code); +extern bool pg_u_ispunct(char32_t code, bool posix); +extern bool pg_u_isspace(char32_t code); +extern bool pg_u_isxdigit(char32_t code, bool posix);  #endif							/* UNICODE_CATEGORY_H */ diff --git a/src/include/common/unicode_category_table.h b/src/include/common/unicode_category_table.h index 95a1c65da7e..466a41b72b0 100644 --- a/src/include/common/unicode_category_table.h +++ b/src/include/common/unicode_category_table.h @@ -20,15 +20,15 @@   */  typedef struct  { -	uint32		first;			/* Unicode codepoint */ -	uint32		last;			/* Unicode codepoint */ +	char32_t	first;			/* Unicode codepoint */ +	char32_t	last;			/* Unicode codepoint */  	uint8		category;		/* General Category */  } pg_category_range;  typedef struct  { -	uint32		first;			/* Unicode codepoint */ -	uint32		last;			/* Unicode codepoint */ +	char32_t	first;			/* Unicode codepoint */ +	char32_t	last;			/* Unicode codepoint */  } pg_unicode_range;  typedef struct diff --git a/src/include/common/unicode_norm.h b/src/include/common/unicode_norm.h index 5bc3b79e78e..516c192cc4c 100644 --- a/src/include/common/unicode_norm.h +++ b/src/include/common/unicode_norm.h @@ -14,8 +14,6 @@  #ifndef UNICODE_NORM_H  #define UNICODE_NORM_H -#include "mb/pg_wchar.h" -  typedef enum  {  	UNICODE_NFC = 0, @@ -32,8 +30,8 @@ typedef enum  	UNICODE_NORM_QC_MAYBE = -1,  } UnicodeNormalizationQC; -extern pg_wchar *unicode_normalize(UnicodeNormalizationForm form, const pg_wchar *input); +extern char32_t *unicode_normalize(UnicodeNormalizationForm form, const char32_t *input); -extern UnicodeNormalizationQC unicode_is_normalized_quickcheck(UnicodeNormalizationForm form, const pg_wchar *input); +extern UnicodeNormalizationQC unicode_is_normalized_quickcheck(UnicodeNormalizationForm form, const char32_t *input);  #endif							/* UNICODE_NORM_H */  | 
