38 #define STRDUP(s) pstrdup(s)
39 #define ALLOC(size) palloc(size)
40 #define FREE(size) pfree(size)
42 #define STRDUP(s) strdup(s)
43 #define ALLOC(size) malloc(size)
44 #define FREE(size) free(size)
965 #define IS_CODE_IN_TABLE(code, map) is_code_in_table(code, map, lengthof(map))
986 if (code < map[0] || code > map[mapsize - 1])
989 if (bsearch(&code, map, mapsize / 2,
sizeof(
pg_wchar) * 2,
1004 const unsigned char *p = (
const unsigned char *)
source;
1053 bool contains_RandALCat;
1085 p = (
unsigned char *)
input;
1086 for (
i = 0;
i < input_size;
i++)
1103 for (
i = 0;
i < input_size;
i++)
1108 input_chars[count++] = 0x0020;
1114 input_chars[count++] = code;
1116 input_chars[count] = (
pg_wchar)
'\0';
1119 if (input_size == 0)
1134 for (
i = 0;
i < input_size;
i++)
1165 contains_RandALCat =
false;
1166 for (
i = 0;
i < input_size;
i++)
1172 contains_RandALCat =
true;
1177 if (contains_RandALCat)
1180 pg_wchar last = input_chars[input_size - 1];
1182 for (
i = 0;
i < input_size;
i++)
1199 for (wp = output_chars; *wp; wp++)
1201 unsigned char buf[4];
1207 result =
ALLOC(result_size + 1);
1215 p = (
unsigned char *) result;
1216 for (wp = output_chars; *wp; wp++)
1221 Assert((
char *) p == result + result_size);
Assert(fmt[strlen(fmt) - 1] !='\n')
static rewind_source * source
static struct cvec * range(struct vars *v, chr a, chr b, int cases)
static int codepoint_range_cmp(const void *a, const void *b)
static const pg_wchar unassigned_codepoint_ranges[]
static const pg_wchar non_ascii_space_ranges[]
static const pg_wchar RandALCat_codepoint_ranges[]
#define IS_CODE_IN_TABLE(code, map)
pg_saslprep_rc pg_saslprep(const char *input, char **output)
static const pg_wchar LCat_codepoint_ranges[]
static const pg_wchar commonly_mapped_to_nothing_ranges[]
static bool is_code_in_table(pg_wchar code, const pg_wchar *map, int mapsize)
static const pg_wchar prohibited_output_ranges[]
static int pg_utf8_string_len(const char *source)
bool pg_is_ascii(const char *str)
pg_wchar * unicode_normalize(UnicodeNormalizationForm form, const pg_wchar *input)
bool pg_utf8_islegal(const unsigned char *source, int length)
unsigned char * unicode_to_utf8(pg_wchar c, unsigned char *utf8string)
int pg_utf_mblen(const unsigned char *s)
pg_wchar utf8_to_unicode(const unsigned char *c)