36 #include "mysys_priv.h"
38 #include "my_static.h"
40 static char get_scode(
CHARSET_INFO * cs,
char **ptr,pbool remove_garbage);
45 void soundex(
CHARSET_INFO * cs,
register char * out_pntr,
char * in_pntr,
50 register uchar *map=cs->to_upper;
54 while (*in_pntr && !my_isalpha(cs,*in_pntr))
57 *out_pntr++ = map[(uchar)*in_pntr];
58 last_ch = get_scode(cs,&in_pntr,0);
66 while (out_pntr < end && (ch = get_scode(cs,&in_pntr,remove_garbage)) != 0)
69 if ((ch !=
'0') && (ch != last_ch))
75 while (out_pntr < end)
88 static char get_scode(
CHARSET_INFO * cs,
char **ptr, pbool remove_garbage)
94 while (**ptr && !my_isalpha(cs,**ptr))
97 ch=my_toupper(cs,**ptr);
98 if (ch < 'A' || ch >
'Z')
100 if (my_isalpha(cs,ch))
104 return(soundex_map[ch-
'A']);