| 171 | } |
| 172 | |
| 173 | int main(int argc acl_unused, char *argv[] acl_unused) |
| 174 | { |
| 175 | ACL_VSTRING *vp = acl_vstring_alloc(256); |
| 176 | char *ptr; |
| 177 | int i; |
| 178 | size_t z; |
| 179 | |
| 180 | acl_vstring_strcpy(vp, "��Һã��й�����Hi��Һ�, Hello World! �й���������!"); |
| 181 | |
| 182 | printf(">>>%s\r\n", acl_vstring_str(vp)); |
| 183 | ptr = acl_vstring_strstr(vp, "Hello"); |
| 184 | if (ptr) |
| 185 | printf(">>ok, find it, ptr = %s\r\n", ptr); |
| 186 | else |
| 187 | printf(">>error, no find it\r\n"); |
| 188 | |
| 189 | ptr = acl_vstring_strcasestr(vp, "WORLD"); |
| 190 | if (ptr) |
| 191 | printf(">>ok, find it, ptr = %s\r\n", ptr); |
| 192 | else |
| 193 | printf(">>error, no find it\r\n"); |
| 194 | |
| 195 | ptr = acl_vstring_strstr(vp, "�й�"); |
| 196 | if (ptr) |
| 197 | printf(">>ok, find it, ptr = %s\r\n", ptr); |
| 198 | else |
| 199 | printf(">>error, no find it\r\n"); |
| 200 | |
| 201 | ptr = acl_vstring_strcasestr(vp, "Hi��Һ�"); |
| 202 | if (ptr) |
| 203 | printf(">>ok, find it, ptr = %s\r\n", ptr); |
| 204 | else |
| 205 | printf(">>error, no find it\r\n"); |
| 206 | |
| 207 | ptr = acl_vstring_memchr(vp, 'W'); |
| 208 | if (ptr) |
| 209 | printf(">>ok, find it, ptr = %s\r\n", ptr); |
| 210 | else |
| 211 | printf(">>error, no find it\r\n"); |
| 212 | |
| 213 | acl_vstring_strcpy(vp, "hello"); |
| 214 | ptr = acl_vstring_strstr(vp, "h"); |
| 215 | if (ptr) |
| 216 | printf(">>>find it, ptr: %s\r\n", ptr); |
| 217 | else |
| 218 | printf(">>>not find it\r\n"); |
| 219 | |
| 220 | printf("\r\n------------------------------------------------------------\r\n"); |
| 221 | for (i = 0; needle_tab[i]; i++) { |
| 222 | string_rfind(vp, needle_tab[i]); |
| 223 | } |
| 224 | |
| 225 | printf("\r\n------------------------------------------------------------\r\n"); |
| 226 | for (i = 0; needle_tab[i]; i++) { |
| 227 | string_case_rfind(vp, needle_tab[i]); |
| 228 | } |
| 229 | |
| 230 | printf("\r\n------------------------------------------------------------\r\n"); |
nothing calls this directly
no test coverage detected
searching dependent graphs…