Lines Matching refs:cp

179 	register char *cp, **pp;  in __res_vinit()  local
356 char buf[sizeof(statp->defdname)], *cp; in __res_vinit() local
363 cp = strchr(buf, '.'); in __res_vinit()
364 cp = (cp == NULL) ? buf : (cp + 1); in __res_vinit()
365 strncpy(statp->defdname, cp, in __res_vinit()
373 if ((cp = getenv("LOCALDOMAIN")) != NULL) { in __res_vinit()
374 (void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1); in __res_vinit()
385 cp = statp->defdname; in __res_vinit()
387 *pp++ = cp; in __res_vinit()
388 for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) { in __res_vinit()
389 if (*cp == '\n') /*%< silly backwards compat */ in __res_vinit()
391 else if (*cp == ' ' || *cp == '\t') { in __res_vinit()
392 *cp = 0; in __res_vinit()
395 *pp++ = cp; in __res_vinit()
401 while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n') in __res_vinit()
402 cp++; in __res_vinit()
403 *cp = '\0'; in __res_vinit()
423 cp = buf + sizeof("domain") - 1; in __res_vinit()
424 while (*cp == ' ' || *cp == '\t') in __res_vinit()
425 cp++; in __res_vinit()
426 if ((*cp == '\0') || (*cp == '\n')) in __res_vinit()
428 strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1); in __res_vinit()
430 if ((cp = strpbrk(statp->defdname, " \t\n")) != NULL) in __res_vinit()
431 *cp = '\0'; in __res_vinit()
439 cp = buf + sizeof("search") - 1; in __res_vinit()
440 while (*cp == ' ' || *cp == '\t') in __res_vinit()
441 cp++; in __res_vinit()
442 if ((*cp == '\0') || (*cp == '\n')) in __res_vinit()
444 strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1); in __res_vinit()
446 if ((cp = strchr(statp->defdname, '\n')) != NULL) in __res_vinit()
447 *cp = '\0'; in __res_vinit()
452 cp = statp->defdname; in __res_vinit()
454 *pp++ = cp; in __res_vinit()
455 for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) { in __res_vinit()
456 if (*cp == ' ' || *cp == '\t') { in __res_vinit()
457 *cp = 0; in __res_vinit()
460 *pp++ = cp; in __res_vinit()
465 while (*cp != '\0' && *cp != ' ' && *cp != '\t') in __res_vinit()
466 cp++; in __res_vinit()
467 *cp = '\0'; in __res_vinit()
479 cp = buf + sizeof("nameserver") - 1; in __res_vinit()
480 while (*cp == ' ' || *cp == '\t') in __res_vinit()
481 cp++; in __res_vinit()
482 cp[strcspn(cp, ";# \t\n")] = '\0'; in __res_vinit()
483 if ((*cp != '\0') && (*cp != '\n')) { in __res_vinit()
489 if (getaddrinfo(cp, sbuf, &hints, &ai) == 0 && in __res_vinit()
511 cp = buf + sizeof("sortlist") - 1; in __res_vinit()
513 while (*cp == ' ' || *cp == '\t') in __res_vinit()
514 cp++; in __res_vinit()
515 if (*cp == '\0' || *cp == '\n' || *cp == ';') in __res_vinit()
517 net = cp; in __res_vinit()
518 while (*cp && !ISSORTMASK(*cp) && *cp != ';' && in __res_vinit()
519 isascii(*cp) && !isspace((unsigned char)*cp)) in __res_vinit()
520 cp++; in __res_vinit()
521 n = *cp; in __res_vinit()
522 *cp = 0; in __res_vinit()
526 *cp++ = n; in __res_vinit()
527 net = cp; in __res_vinit()
528 while (*cp && *cp != ';' && in __res_vinit()
529 isascii(*cp) && in __res_vinit()
530 !isspace((unsigned char)*cp)) in __res_vinit()
531 cp++; in __res_vinit()
532 n = *cp; in __res_vinit()
533 *cp = 0; in __res_vinit()
546 *cp = n; in __res_vinit()
574 (cp = strchr(buf, '.')) != NULL) in __res_vinit()
575 strcpy(statp->defdname, cp + 1); in __res_vinit()
584 for (cp = statp->defdname; *cp; cp++) in __res_vinit()
585 dots += (*cp == '.'); in __res_vinit()
587 cp = statp->defdname; in __res_vinit()
591 cp = strchr(cp, '.') + 1; /*%< we know there is one */ in __res_vinit()
592 *pp++ = cp; in __res_vinit()
606 if ((cp = getenv("RES_OPTIONS")) != NULL) in __res_vinit()
607 res_setoptions(statp, cp, "env"); in __res_vinit()
625 const char *cp = options; in res_setoptions() local
634 while (*cp) { in res_setoptions()
636 while (*cp == ' ' || *cp == '\t') in res_setoptions()
637 cp++; in res_setoptions()
639 if (!strncmp(cp, "ndots:", sizeof("ndots:") - 1)) { in res_setoptions()
640 i = atoi(cp + sizeof("ndots:") - 1); in res_setoptions()
649 } else if (!strncmp(cp, "timeout:", sizeof("timeout:") - 1)) { in res_setoptions()
650 i = atoi(cp + sizeof("timeout:") - 1); in res_setoptions()
660 } else if (!strncmp(cp, "retrans:", sizeof("retrans:") - 1)) { in res_setoptions()
666 statp->retrans = atoi(cp + sizeof("retrans:") - 1); in res_setoptions()
667 } else if (!strncmp(cp, "retry:", sizeof("retry:") - 1)){ in res_setoptions()
673 statp->retry = atoi(cp + sizeof("retry:") - 1); in res_setoptions()
675 } else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){ in res_setoptions()
676 i = atoi(cp + sizeof("attempts:") - 1); in res_setoptions()
685 } else if (!strncmp(cp, "debug", sizeof("debug") - 1)) { in res_setoptions()
694 } else if (!strncmp(cp, "no_tld_query", in res_setoptions()
696 !strncmp(cp, "no-tld-query", in res_setoptions()
699 } else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) { in res_setoptions()
701 } else if (!strncmp(cp, "rotate", sizeof("rotate") - 1)) { in res_setoptions()
703 } else if (!strncmp(cp, "no-check-names", in res_setoptions()
708 else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) { in res_setoptions()
712 else if (!strncmp(cp, "dname", sizeof("dname") - 1)) { in res_setoptions()
715 else if (!strncmp(cp, "nibble:", sizeof("nibble:") - 1)) { in res_setoptions()
718 cp += sizeof("nibble:") - 1; in res_setoptions()
719 i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix) - 1); in res_setoptions()
720 strncpy(ext->nsuffix, cp, i); in res_setoptions()
723 else if (!strncmp(cp, "nibble2:", sizeof("nibble2:") - 1)) { in res_setoptions()
726 cp += sizeof("nibble2:") - 1; in res_setoptions()
727 i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix2) - 1); in res_setoptions()
728 strncpy(ext->nsuffix2, cp, i); in res_setoptions()
731 else if (!strncmp(cp, "v6revmode:", sizeof("v6revmode:") - 1)) { in res_setoptions()
732 cp += sizeof("v6revmode:") - 1; in res_setoptions()
734 if (!strncmp(cp, "single", sizeof("single") - 1)) { in res_setoptions()
736 } else if (!strncmp(cp, "both", sizeof("both") - 1)) { in res_setoptions()
746 while (*cp && *cp != ' ' && *cp != '\t') in res_setoptions()
747 cp++; in res_setoptions()