336
336
/* declarations for simple charsets */
337
size_t my_strnxfrmlen_simple(const CHARSET_INFO * const, size_t);
337
size_t my_strnxfrmlen_simple(const charset_info_st * const, size_t);
339
extern int my_strnncollsp_simple(const CHARSET_INFO * const, const unsigned char *, size_t,
339
extern int my_strnncollsp_simple(const charset_info_st * const, const unsigned char *, size_t,
340
340
const unsigned char *, size_t,
341
341
bool diff_if_only_endspace_difference);
343
extern size_t my_lengthsp_8bit(const CHARSET_INFO * const cs, const char *ptr, size_t length);
343
extern size_t my_lengthsp_8bit(const charset_info_st * const cs, const char *ptr, size_t length);
345
extern uint32_t my_instr_simple(const CHARSET_INFO * const,
345
extern uint32_t my_instr_simple(const charset_info_st * const,
346
346
const char *b, size_t b_length,
347
347
const char *s, size_t s_length,
348
348
my_match_t *match, uint32_t nmatch);
351
351
/* Functions for 8bit */
352
int my_mb_ctype_8bit(const CHARSET_INFO * const,int *, const unsigned char *,const unsigned char *);
353
int my_mb_ctype_mb(const CHARSET_INFO * const,int *, const unsigned char *,const unsigned char *);
355
size_t my_scan_8bit(const CHARSET_INFO * const cs, const char *b, const char *e, int sq);
357
size_t my_snprintf_8bit(const CHARSET_INFO * const, char *to, size_t n,
352
int my_mb_ctype_8bit(const charset_info_st * const,int *, const unsigned char *,const unsigned char *);
353
int my_mb_ctype_mb(const charset_info_st * const,int *, const unsigned char *,const unsigned char *);
355
size_t my_scan_8bit(const charset_info_st * const cs, const char *b, const char *e, int sq);
357
size_t my_snprintf_8bit(const charset_info_st * const, char *to, size_t n,
358
358
const char *fmt, ...)
359
359
__attribute__((format(printf, 4, 5)));
361
long my_strntol_8bit(const CHARSET_INFO * const, const char *s, size_t l, int base,
361
long my_strntol_8bit(const charset_info_st * const, const char *s, size_t l, int base,
362
362
char **e, int *err);
363
unsigned long my_strntoul_8bit(const CHARSET_INFO * const, const char *s, size_t l, int base,
365
int64_t my_strntoll_8bit(const CHARSET_INFO * const, const char *s, size_t l, int base,
367
uint64_t my_strntoull_8bit(const CHARSET_INFO * const, const char *s, size_t l, int base,
369
double my_strntod_8bit(const CHARSET_INFO * const, char *s, size_t l,char **e,
363
unsigned long my_strntoul_8bit(const charset_info_st * const, const char *s, size_t l, int base,
365
int64_t my_strntoll_8bit(const charset_info_st * const, const char *s, size_t l, int base,
367
uint64_t my_strntoull_8bit(const charset_info_st * const, const char *s, size_t l, int base,
369
double my_strntod_8bit(const charset_info_st * const, char *s, size_t l,char **e,
371
size_t my_long10_to_str_8bit(const CHARSET_INFO * const, char *to, size_t l, int radix,
371
size_t my_long10_to_str_8bit(const charset_info_st * const, char *to, size_t l, int radix,
373
size_t my_int64_t10_to_str_8bit(const CHARSET_INFO * const, char *to, size_t l, int radix,
373
size_t my_int64_t10_to_str_8bit(const charset_info_st * const, char *to, size_t l, int radix,
376
int64_t my_strtoll10_8bit(const CHARSET_INFO * const cs,
376
int64_t my_strtoll10_8bit(const charset_info_st * const cs,
377
377
const char *nptr, char **endptr, int *error);
378
int64_t my_strtoll10_ucs2(CHARSET_INFO *cs,
378
int64_t my_strtoll10_ucs2(charset_info_st *cs,
379
379
const char *nptr, char **endptr, int *error);
381
uint64_t my_strntoull10rnd_8bit(const CHARSET_INFO * const cs,
381
uint64_t my_strntoull10rnd_8bit(const charset_info_st * const cs,
382
382
const char *str, size_t length, int
383
383
unsigned_fl, char **endptr, int *error);
384
uint64_t my_strntoull10rnd_ucs2(CHARSET_INFO *cs,
384
uint64_t my_strntoull10rnd_ucs2(charset_info_st *cs,
385
385
const char *str, size_t length,
386
386
int unsigned_fl, char **endptr, int *error);
388
void my_fill_8bit(const CHARSET_INFO * const cs, char* to, size_t l, int fill);
388
void my_fill_8bit(const charset_info_st * const cs, char* to, size_t l, int fill);
390
bool my_like_range_simple(const CHARSET_INFO * const cs,
390
bool my_like_range_simple(const charset_info_st * const cs,
391
391
const char *ptr, size_t ptr_length,
392
392
char escape, char w_one, char w_many,
393
393
size_t res_length,
394
394
char *min_str, char *max_str,
395
395
size_t *min_length, size_t *max_length);
397
bool my_like_range_mb(const CHARSET_INFO * const cs,
397
bool my_like_range_mb(const charset_info_st * const cs,
398
398
const char *ptr, size_t ptr_length,
399
399
char escape, char w_one, char w_many,
400
400
size_t res_length,
401
401
char *min_str, char *max_str,
402
402
size_t *min_length, size_t *max_length);
404
bool my_like_range_ucs2(const CHARSET_INFO * const cs,
404
bool my_like_range_ucs2(const charset_info_st * const cs,
405
405
const char *ptr, size_t ptr_length,
406
406
char escape, char w_one, char w_many,
407
407
size_t res_length,
408
408
char *min_str, char *max_str,
409
409
size_t *min_length, size_t *max_length);
411
bool my_like_range_utf16(const CHARSET_INFO * const cs,
412
const char *ptr, size_t ptr_length,
413
char escape, char w_one, char w_many,
415
char *min_str, char *max_str,
416
size_t *min_length, size_t *max_length);
418
bool my_like_range_utf32(const CHARSET_INFO * const cs,
419
const char *ptr, size_t ptr_length,
420
char escape, char w_one, char w_many,
422
char *min_str, char *max_str,
423
size_t *min_length, size_t *max_length);
426
int my_wildcmp_8bit(const CHARSET_INFO * const,
411
bool my_like_range_utf16(const charset_info_st * const cs,
412
const char *ptr, size_t ptr_length,
413
char escape, char w_one, char w_many,
415
char *min_str, char *max_str,
416
size_t *min_length, size_t *max_length);
418
bool my_like_range_utf32(const charset_info_st * const cs,
419
const char *ptr, size_t ptr_length,
420
char escape, char w_one, char w_many,
422
char *min_str, char *max_str,
423
size_t *min_length, size_t *max_length);
426
int my_wildcmp_8bit(const charset_info_st * const,
427
427
const char *str,const char *str_end,
428
428
const char *wildstr,const char *wildend,
429
429
int escape, int w_one, int w_many);
431
int my_wildcmp_bin(const CHARSET_INFO * const,
431
int my_wildcmp_bin(const charset_info_st * const,
432
432
const char *str,const char *str_end,
433
433
const char *wildstr,const char *wildend,
434
434
int escape, int w_one, int w_many);
436
size_t my_numchars_8bit(const CHARSET_INFO * const, const char *b, const char *e);
437
size_t my_numcells_8bit(const CHARSET_INFO * const, const char *b, const char *e);
438
size_t my_charpos_8bit(const CHARSET_INFO * const, const char *b, const char *e, size_t pos);
439
size_t my_well_formed_len_8bit(const CHARSET_INFO * const, const char *b, const char *e,
436
size_t my_numchars_8bit(const charset_info_st * const, const char *b, const char *e);
437
size_t my_numcells_8bit(const charset_info_st * const, const char *b, const char *e);
438
size_t my_charpos_8bit(const charset_info_st * const, const char *b, const char *e, size_t pos);
439
size_t my_well_formed_len_8bit(const charset_info_st * const, const char *b, const char *e,
440
440
size_t pos, int *error);
441
441
typedef unsigned char *(*cs_alloc_func)(size_t);
442
bool my_coll_init_simple(CHARSET_INFO *cs, cs_alloc_func alloc);
443
bool my_cset_init_8bit(CHARSET_INFO *cs, cs_alloc_func alloc);
444
uint32_t my_mbcharlen_8bit(const CHARSET_INFO * const, uint32_t c);
442
bool my_coll_init_simple(charset_info_st *cs, cs_alloc_func alloc);
443
bool my_cset_init_8bit(charset_info_st *cs, cs_alloc_func alloc);
444
uint32_t my_mbcharlen_8bit(const charset_info_st * const, uint32_t c);
447
447
/* Functions for multibyte charsets */
448
extern size_t my_caseup_str_mb(const CHARSET_INFO * const, char *);
449
extern size_t my_casedn_str_mb(const CHARSET_INFO * const, char *);
450
extern size_t my_caseup_mb(const CHARSET_INFO * const, char *src, size_t srclen,
451
char *dst, size_t dstlen);
452
extern size_t my_casedn_mb(const CHARSET_INFO * const, char *src, size_t srclen,
453
char *dst, size_t dstlen);
454
extern int my_strcasecmp_mb(const CHARSET_INFO * const cs, const char *s, const char *t);
448
extern size_t my_caseup_str_mb(const charset_info_st * const, char *);
449
extern size_t my_casedn_str_mb(const charset_info_st * const, char *);
450
extern size_t my_caseup_mb(const charset_info_st * const, char *src, size_t srclen,
451
char *dst, size_t dstlen);
452
extern size_t my_casedn_mb(const charset_info_st * const, char *src, size_t srclen,
453
char *dst, size_t dstlen);
454
extern int my_strcasecmp_mb(const charset_info_st * const cs, const char *s, const char *t);
456
int my_wildcmp_mb(const CHARSET_INFO * const,
456
int my_wildcmp_mb(const charset_info_st * const,
457
457
const char *str,const char *str_end,
458
458
const char *wildstr,const char *wildend,
459
459
int escape, int w_one, int w_many);
460
size_t my_numchars_mb(const CHARSET_INFO * const, const char *b, const char *e);
461
size_t my_numcells_mb(const CHARSET_INFO * const, const char *b, const char *e);
462
size_t my_charpos_mb(const CHARSET_INFO * const, const char *b, const char *e, size_t pos);
463
size_t my_well_formed_len_mb(const CHARSET_INFO * const, const char *b, const char *e,
460
size_t my_numchars_mb(const charset_info_st * const, const char *b, const char *e);
461
size_t my_numcells_mb(const charset_info_st * const, const char *b, const char *e);
462
size_t my_charpos_mb(const charset_info_st * const, const char *b, const char *e, size_t pos);
463
size_t my_well_formed_len_mb(const charset_info_st * const, const char *b, const char *e,
464
464
size_t pos, int *error);
465
uint32_t my_instr_mb(const CHARSET_INFO * const,
465
uint32_t my_instr_mb(const charset_info_st * const,
466
466
const char *b, size_t b_length,
467
467
const char *s, size_t s_length,
468
468
my_match_t *match, uint32_t nmatch);
470
int my_strnncoll_mb_bin(const CHARSET_INFO * const cs,
470
int my_strnncoll_mb_bin(const charset_info_st * const cs,
471
471
const unsigned char *s, size_t slen,
472
472
const unsigned char *t, size_t tlen,
473
473
bool t_is_prefix);
475
int my_strnncollsp_mb_bin(const CHARSET_INFO * const cs,
475
int my_strnncollsp_mb_bin(const charset_info_st * const cs,
476
476
const unsigned char *a, size_t a_length,
477
477
const unsigned char *b, size_t b_length,
478
478
bool diff_if_only_endspace_difference);
480
int my_wildcmp_mb_bin(const CHARSET_INFO * const cs,
480
int my_wildcmp_mb_bin(const charset_info_st * const cs,
481
481
const char *str,const char *str_end,
482
482
const char *wildstr,const char *wildend,
483
483
int escape, int w_one, int w_many);
485
int my_strcasecmp_mb_bin(const CHARSET_INFO * const, const char *s, const char *t);
485
int my_strcasecmp_mb_bin(const charset_info_st * const, const char *s, const char *t);
487
void my_hash_sort_mb_bin(const CHARSET_INFO * const,
487
void my_hash_sort_mb_bin(const charset_info_st * const,
488
488
const unsigned char *key, size_t len, uint32_t *nr1, uint32_t *nr2);
490
size_t my_strnxfrm_mb(const CHARSET_INFO * const,
490
size_t my_strnxfrm_mb(const charset_info_st * const,
491
491
unsigned char *dst, size_t dstlen, uint32_t nweights,
492
492
const unsigned char *src, size_t srclen, uint32_t flags);
494
int my_wildcmp_unicode(const CHARSET_INFO * const cs,
494
int my_wildcmp_unicode(const charset_info_st * const cs,
495
495
const char *str, const char *str_end,
496
496
const char *wildstr, const char *wildend,
497
497
int escape, int w_one, int w_many,
498
498
MY_UNICASE_INFO **weights);
500
500
extern bool my_parse_charset_xml(const char *bug, size_t len,
501
int (*add)(CHARSET_INFO *cs));
501
int (*add)(charset_info_st *cs));
503
bool my_propagate_simple(const CHARSET_INFO * const cs, const unsigned char *str, size_t len);
504
bool my_propagate_complex(const CHARSET_INFO * const cs, const unsigned char *str, size_t len);
503
bool my_propagate_simple(const charset_info_st * const cs, const unsigned char *str, size_t len);
504
bool my_propagate_complex(const charset_info_st * const cs, const unsigned char *str, size_t len);
507
507
uint32_t my_strxfrm_flag_normalize(uint32_t flags, uint32_t nlevels);
508
508
void my_strxfrm_desc_and_reverse(unsigned char *str, unsigned char *strend,
509
509
uint32_t flags, uint32_t level);
510
size_t my_strxfrm_pad_desc_and_reverse(const CHARSET_INFO * const cs,
510
size_t my_strxfrm_pad_desc_and_reverse(const charset_info_st * const cs,
511
511
unsigned char *str, unsigned char *frmend, unsigned char *strend,
512
512
uint32_t nweights, uint32_t flags, uint32_t level);
514
bool my_charset_is_ascii_compatible(const CHARSET_INFO * const cs);
514
bool my_charset_is_ascii_compatible(const charset_info_st * const cs);
517
517
Compare 0-terminated UTF8 strings.
530
530
- 0 is the strings are equal
533
my_wc_mb_filename(const CHARSET_INFO * const,
533
my_wc_mb_filename(const charset_info_st * const,
534
534
my_wc_t wc, unsigned char *s, unsigned char *e);
537
my_mb_wc_filename(const CHARSET_INFO * const,
537
my_mb_wc_filename(const charset_info_st * const,
538
538
my_wc_t *pwc, const unsigned char *s, const unsigned char *e);
541
unsigned int my_ismbchar_utf8mb4(const CHARSET_INFO * const cs, const char *b, const char *e);
542
unsigned int my_mbcharlen_utf8mb4(const CHARSET_INFO * const, uint32_t c);
541
unsigned int my_ismbchar_utf8mb4(const charset_info_st * const cs, const char *b, const char *e);
542
unsigned int my_mbcharlen_utf8mb4(const charset_info_st * const, uint32_t c);
544
size_t my_strnxfrmlen_utf8mb4(const CHARSET_INFO * const, size_t len);
544
size_t my_strnxfrmlen_utf8mb4(const charset_info_st * const, size_t len);
546
my_strnxfrm_utf8mb4(const CHARSET_INFO * const cs,
546
my_strnxfrm_utf8mb4(const charset_info_st * const cs,
547
547
unsigned char *dst, size_t dstlen, uint32_t nweights,
548
548
const unsigned char *src, size_t srclen, uint32_t flags);
551
my_wildcmp_utf8mb4(const CHARSET_INFO * const cs,
551
my_wildcmp_utf8mb4(const charset_info_st * const cs,
552
552
const char *str, const char *strend,
553
553
const char *wildstr, const char *wildend,
554
554
int escape, int w_one, int w_many);
556
my_strnncollsp_utf8mb4(const CHARSET_INFO * const cs,
556
my_strnncollsp_utf8mb4(const charset_info_st * const cs,
557
557
const unsigned char *s, size_t slen,
558
558
const unsigned char *t, size_t tlen,
559
559
bool diff_if_only_endspace_difference);
560
int my_strcasecmp_utf8mb4(const CHARSET_INFO * const cs,
560
int my_strcasecmp_utf8mb4(const charset_info_st * const cs,
561
561
const char *s, const char *t);
564
my_strnncoll_utf8mb4(const CHARSET_INFO * const cs,
564
my_strnncoll_utf8mb4(const charset_info_st * const cs,
565
565
const unsigned char *s, size_t slen,
566
566
const unsigned char *t, size_t tlen,
567
567
bool t_is_prefix);
570
my_mb_wc_utf8mb4(const CHARSET_INFO * const cs,
570
my_mb_wc_utf8mb4(const charset_info_st * const cs,
571
571
my_wc_t * pwc, const unsigned char *s, const unsigned char *e);
574
my_wc_mb_utf8mb4(const CHARSET_INFO * const cs,
574
my_wc_mb_utf8mb4(const charset_info_st * const cs,
575
575
my_wc_t wc, unsigned char *r, unsigned char *e);
577
size_t my_caseup_str_utf8mb4(const CHARSET_INFO * const cs, char *src);
578
size_t my_casedn_str_utf8mb4(const CHARSET_INFO * const cs, char *src);
577
size_t my_caseup_str_utf8mb4(const charset_info_st * const cs, char *src);
578
size_t my_casedn_str_utf8mb4(const charset_info_st * const cs, char *src);
581
my_caseup_utf8mb4(const CHARSET_INFO * const cs, char *src, size_t srclen,
581
my_caseup_utf8mb4(const charset_info_st * const cs, char *src, size_t srclen,
582
582
char *dst, size_t dstlen);
584
my_casedn_utf8mb4(const CHARSET_INFO * const cs,
584
my_casedn_utf8mb4(const charset_info_st * const cs,
585
585
char *src, size_t srclen,
586
586
char *dst, size_t dstlen);
589
bool my_coll_init_uca(CHARSET_INFO *cs, cs_alloc_func alloc);
589
bool my_coll_init_uca(charset_info_st *cs, cs_alloc_func alloc);
591
int my_strnncoll_any_uca(const CHARSET_INFO * const cs,
591
int my_strnncoll_any_uca(const charset_info_st * const cs,
592
592
const unsigned char *s, size_t slen,
593
593
const unsigned char *t, size_t tlen,
594
594
bool t_is_prefix);
596
int my_strnncollsp_any_uca(const CHARSET_INFO * const cs,
596
int my_strnncollsp_any_uca(const charset_info_st * const cs,
597
597
const unsigned char *s, size_t slen,
598
598
const unsigned char *t, size_t tlen,
599
599
bool diff_if_only_endspace_difference);
601
void my_hash_sort_any_uca(const CHARSET_INFO * const cs,
601
void my_hash_sort_any_uca(const charset_info_st * const cs,
602
602
const unsigned char *s, size_t slen,
603
603
uint32_t *n1, uint32_t *n2);
605
size_t my_strnxfrm_any_uca(const CHARSET_INFO * const cs,
605
size_t my_strnxfrm_any_uca(const charset_info_st * const cs,
606
606
unsigned char *dst, size_t dstlen, uint32_t nweights,
607
607
const unsigned char *src, size_t srclen,
610
int my_wildcmp_uca(const CHARSET_INFO * const cs,
610
int my_wildcmp_uca(const charset_info_st * const cs,
611
611
const char *str,const char *str_end,
612
612
const char *wildstr,const char *wildend,
613
613
int escape, int w_one, int w_many);
615
int my_strnncoll_8bit_bin(const CHARSET_INFO * const,
615
int my_strnncoll_8bit_bin(const charset_info_st * const,
616
616
const unsigned char *s, size_t slen,
617
617
const unsigned char *t, size_t tlen,
618
618
bool t_is_prefix);
619
int my_strnncollsp_8bit_bin(const CHARSET_INFO * const,
619
int my_strnncollsp_8bit_bin(const charset_info_st * const,
620
620
const unsigned char *a, size_t a_length,
621
621
const unsigned char *b, size_t b_length,
622
622
bool diff_if_only_endspace_difference);
623
size_t my_case_str_bin(const CHARSET_INFO * const, char *);
624
size_t my_case_bin(const CHARSET_INFO * const, char *,
623
size_t my_case_str_bin(const charset_info_st * const, char *);
624
size_t my_case_bin(const charset_info_st * const, char *,
625
625
size_t srclen, char *, size_t);
626
int my_strcasecmp_bin(const CHARSET_INFO * const,
626
int my_strcasecmp_bin(const charset_info_st * const,
627
627
const char *s, const char *t);
629
my_strnxfrm_8bit_bin(const CHARSET_INFO * const cs,
629
my_strnxfrm_8bit_bin(const charset_info_st * const cs,
630
630
unsigned char * dst, size_t dstlen, uint32_t nweights,
631
631
const unsigned char *src, size_t srclen, uint32_t flags);
632
uint32_t my_instr_bin(const CHARSET_INFO * const,
632
uint32_t my_instr_bin(const charset_info_st * const,
633
633
const char *b, size_t b_length,
634
634
const char *s, size_t s_length,
635
635
my_match_t *match, uint32_t nmatch);
636
size_t my_lengthsp_binary(const CHARSET_INFO * const,
636
size_t my_lengthsp_binary(const charset_info_st * const,
637
637
const char *, size_t length);
638
int my_mb_wc_bin(const CHARSET_INFO * const,
638
int my_mb_wc_bin(const charset_info_st * const,
639
639
my_wc_t *wc, const unsigned char *str,
640
640
const unsigned char *end);
641
int my_wc_mb_bin(const CHARSET_INFO * const, my_wc_t wc,
641
int my_wc_mb_bin(const charset_info_st * const, my_wc_t wc,
642
642
unsigned char *str, unsigned char *end);
643
void my_hash_sort_8bit_bin(const CHARSET_INFO * const,
643
void my_hash_sort_8bit_bin(const charset_info_st * const,
644
644
const unsigned char *key, size_t len,
645
645
uint32_t *nr1, uint32_t *nr2);
646
bool my_coll_init_8bit_bin(CHARSET_INFO *cs,
646
bool my_coll_init_8bit_bin(charset_info_st *cs,
648
int my_strnncoll_binary(const CHARSET_INFO * const,
648
int my_strnncoll_binary(const charset_info_st * const,
649
649
const unsigned char *s, size_t slen,
650
650
const unsigned char *t, size_t tlen,
651
651
bool t_is_prefix);
652
int my_strnncollsp_binary(const CHARSET_INFO * const cs,
652
int my_strnncollsp_binary(const charset_info_st * const cs,
653
653
const unsigned char *s, size_t slen,
654
654
const unsigned char *t, size_t tlen,