Lines Matching refs:str
33 int string_is_true(const char *str)
35 if (strcasecmp(str, "true") == 0)
37 if (strcasecmp(str, "yes") == 0)
39 if (strcasecmp(str, "1") == 0)
97 static int utf8_encoded_expected_len(const char *str)
99 unsigned char c = (unsigned char)str[0];
117 static int utf8_encoded_to_unichar(const char *str)
123 len = utf8_encoded_expected_len(str);
126 return (int)str[0];
128 unichar = str[0] & 0x1f;
131 unichar = (int)str[0] & 0x0f;
134 unichar = (int)str[0] & 0x07;
137 unichar = (int)str[0] & 0x03;
140 unichar = (int)str[0] & 0x01;
147 if (((int)str[i] & 0xc0) != 0x80)
150 unichar |= (int)str[i] & 0x3f;
187 int utf8_encoded_valid_unichar(const char *str)
193 len = utf8_encoded_expected_len(str);
203 if ((str[i] & 0x80) != 0x80)
206 unichar = utf8_encoded_to_unichar(str);
220 int replace_chars(char *str, const char *white)
225 while (str[i] != '\0') {
229 if (white != NULL && strchr(white, str[i]) != NULL) {
235 if ((str[i] >= '0' && str[i] <= '9') ||
236 (str[i] >= 'A' && str[i] <= 'Z') ||
237 (str[i] >= 'a' && str[i] <= 'z')) {
243 if (str[i] == '\\' && str[i+1] == 'x') {
249 len = utf8_encoded_valid_unichar(&str[i]);
256 if (isspace(str[i]) && strchr(white, ' ') != NULL) {
257 str[i] = ' ';
264 str[i] = '_';