39#define STRDUP(s) pstrdup(s)
40#define ALLOC(size) palloc(size)
41#define FREE(size) pfree(size)
43#define STRDUP(s) strdup(s)
44#define ALLOC(size) malloc(size)
45#define FREE(size) free(size)
966#define IS_CODE_IN_TABLE(code, map) is_code_in_table(code, map, lengthof(map))
987 if (code < map[0] || code > map[mapsize - 1])
990 if (bsearch(&code, map, mapsize / 2,
sizeof(
pg_wchar) * 2,
1005 const unsigned char *p = (
const unsigned char *)
source;
1056 bool contains_RandALCat;
1090 p = (
unsigned char *)
input;
1091 for (
i = 0;
i < input_size;
i++)
1108 for (
i = 0;
i < input_size;
i++)
1113 input_chars[count++] = 0x0020;
1119 input_chars[count++] = code;
1121 input_chars[count] = (
pg_wchar)
'\0';
1124 if (input_size == 0)
1139 for (
i = 0;
i < input_size;
i++)
1170 contains_RandALCat =
false;
1171 for (
i = 0;
i < input_size;
i++)
1177 contains_RandALCat =
true;
1182 if (contains_RandALCat)
1185 pg_wchar last = input_chars[input_size - 1];
1187 for (
i = 0;
i < input_size;
i++)
1204 for (wp = output_chars; *wp; wp++)
1206 unsigned char buf[4];
1212 result =
ALLOC(result_size + 1);
1220 p = (
unsigned char *) result;
1221 for (wp = output_chars; *wp; wp++)
1226 Assert((
char *) p == result + result_size);
#define Assert(condition)
static pg_wchar utf8_to_unicode(const unsigned char *c)
static rewind_source * source
static unsigned char * unicode_to_utf8(pg_wchar c, unsigned char *utf8string)
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)