Lines Matching refs:cp
171 register char *cp, **pp; in __res_vinit() local
249 if ((cp = getenv("LOCALDOMAIN")) != NULL) { in __res_vinit()
250 (void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1); in __res_vinit()
261 cp = statp->defdname; in __res_vinit()
263 *pp++ = cp; in __res_vinit()
264 for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) { in __res_vinit()
265 if (*cp == '\n') /* silly backwards compat */ in __res_vinit()
267 else if (*cp == ' ' || *cp == '\t') { in __res_vinit()
268 *cp = 0; in __res_vinit()
271 *pp++ = cp; in __res_vinit()
277 while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n') in __res_vinit()
278 cp++; in __res_vinit()
279 *cp = '\0'; in __res_vinit()
303 cp = buf + sizeof("domain") - 1; in __res_vinit()
304 while (*cp == ' ' || *cp == '\t') in __res_vinit()
305 cp++; in __res_vinit()
306 if ((*cp == '\0') || (*cp == '\n')) in __res_vinit()
308 strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1); in __res_vinit()
310 if ((cp = strpbrk(statp->defdname, " \t\n")) != NULL) in __res_vinit()
311 *cp = '\0'; in __res_vinit()
319 cp = buf + sizeof("search") - 1; in __res_vinit()
320 while (*cp == ' ' || *cp == '\t') in __res_vinit()
321 cp++; in __res_vinit()
322 if ((*cp == '\0') || (*cp == '\n')) in __res_vinit()
324 strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1); in __res_vinit()
326 if ((cp = strchr(statp->defdname, '\n')) != NULL) in __res_vinit()
327 *cp = '\0'; in __res_vinit()
332 cp = statp->defdname; in __res_vinit()
334 *pp++ = cp; in __res_vinit()
335 for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) { in __res_vinit()
336 if (*cp == ' ' || *cp == '\t') { in __res_vinit()
337 *cp = 0; in __res_vinit()
340 *pp++ = cp; in __res_vinit()
345 while (*cp != '\0' && *cp != ' ' && *cp != '\t') in __res_vinit()
346 cp++; in __res_vinit()
347 *cp = '\0'; in __res_vinit()
359 cp = buf + sizeof("nameserver") - 1; in __res_vinit()
360 while (*cp == ' ' || *cp == '\t') in __res_vinit()
361 cp++; in __res_vinit()
362 cp[strcspn(cp, ";# \t\n")] = '\0'; in __res_vinit()
363 if ((*cp != '\0') && (*cp != '\n')) { in __res_vinit()
369 if (getaddrinfo(cp, sbuf, &hints, &ai) == 0 && in __res_vinit()
390 cp = buf + sizeof("sortlist") - 1; in __res_vinit()
392 while (*cp == ' ' || *cp == '\t') in __res_vinit()
393 cp++; in __res_vinit()
394 if (*cp == '\0' || *cp == '\n' || *cp == ';') in __res_vinit()
396 net = cp; in __res_vinit()
397 while (*cp && !ISSORTMASK(*cp) && *cp != ';' && in __res_vinit()
398 isascii(*cp) && !isspace((unsigned char)*cp)) in __res_vinit()
399 cp++; in __res_vinit()
400 n = *cp; in __res_vinit()
401 *cp = 0; in __res_vinit()
405 *cp++ = n; in __res_vinit()
406 net = cp; in __res_vinit()
407 while (*cp && *cp != ';' && in __res_vinit()
408 isascii(*cp) && in __res_vinit()
409 !isspace((unsigned char)*cp)) in __res_vinit()
410 cp++; in __res_vinit()
411 n = *cp; in __res_vinit()
412 *cp = 0; in __res_vinit()
425 *cp = n; in __res_vinit()
451 (cp = strchr(buf, '.')) != NULL) in __res_vinit()
452 strcpy(statp->defdname, cp + 1); in __res_vinit()
461 for (cp = statp->defdname; *cp; cp++) in __res_vinit()
462 dots += (*cp == '.'); in __res_vinit()
464 cp = statp->defdname; in __res_vinit()
468 cp = strchr(cp, '.') + 1; /* we know there is one */ in __res_vinit()
469 *pp++ = cp; in __res_vinit()
483 if ((cp = getenv("RES_OPTIONS")) != NULL) in __res_vinit()
484 res_setoptions(statp, cp, "env"); in __res_vinit()
495 const char *cp = options; in res_setoptions() local
504 while (*cp) { in res_setoptions()
506 while (*cp == ' ' || *cp == '\t') in res_setoptions()
507 cp++; in res_setoptions()
509 if (!strncmp(cp, "ndots:", sizeof("ndots:") - 1)) { in res_setoptions()
510 i = atoi(cp + sizeof("ndots:") - 1); in res_setoptions()
519 } else if (!strncmp(cp, "timeout:", sizeof("timeout:") - 1)) { in res_setoptions()
520 i = atoi(cp + sizeof("timeout:") - 1); in res_setoptions()
529 } else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){ in res_setoptions()
530 i = atoi(cp + sizeof("attempts:") - 1); in res_setoptions()
539 } else if (!strncmp(cp, "debug", sizeof("debug") - 1)) { in res_setoptions()
548 } else if (!strncmp(cp, "no_tld_query", in res_setoptions()
550 !strncmp(cp, "no-tld-query", in res_setoptions()
553 } else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) { in res_setoptions()
555 } else if (!strncmp(cp, "rotate", sizeof("rotate") - 1)) { in res_setoptions()
557 } else if (!strncmp(cp, "no-check-names", in res_setoptions()
562 else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) { in res_setoptions()
566 else if (!strncmp(cp, "dname", sizeof("dname") - 1)) { in res_setoptions()
569 else if (!strncmp(cp, "nibble:", sizeof("nibble:") - 1)) { in res_setoptions()
572 cp += sizeof("nibble:") - 1; in res_setoptions()
573 i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix) - 1); in res_setoptions()
574 strncpy(ext->nsuffix, cp, (size_t)i); in res_setoptions()
577 else if (!strncmp(cp, "nibble2:", sizeof("nibble2:") - 1)) { in res_setoptions()
580 cp += sizeof("nibble2:") - 1; in res_setoptions()
581 i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix2) - 1); in res_setoptions()
582 strncpy(ext->nsuffix2, cp, (size_t)i); in res_setoptions()
585 else if (!strncmp(cp, "v6revmode:", sizeof("v6revmode:") - 1)) { in res_setoptions()
586 cp += sizeof("v6revmode:") - 1; in res_setoptions()
588 if (!strncmp(cp, "single", sizeof("single") - 1)) { in res_setoptions()
590 } else if (!strncmp(cp, "both", sizeof("both") - 1)) { in res_setoptions()
600 while (*cp && *cp != ' ' && *cp != '\t') in res_setoptions()
601 cp++; in res_setoptions()