Lines Matching full:cp

170 	register char *cp, **pp;  in __res_vinit()  local
262 char buf[sizeof(statp->defdname)], *cp; in __res_vinit() local
269 cp = strchr(buf, '.'); in __res_vinit()
270 cp = (cp == NULL) ? buf : (cp + 1); in __res_vinit()
271 strncpy(statp->defdname, cp, in __res_vinit()
279 if ((cp = getenv("LOCALDOMAIN")) != NULL) { in __res_vinit()
280 (void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1); in __res_vinit()
291 cp = statp->defdname; in __res_vinit()
293 *pp++ = cp; in __res_vinit()
294 for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) { in __res_vinit()
295 if (*cp == '\n') /*%< silly backwards compat */ in __res_vinit()
297 else if (*cp == ' ' || *cp == '\t') { in __res_vinit()
298 *cp = 0; in __res_vinit()
301 *pp++ = cp; in __res_vinit()
307 while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n') in __res_vinit()
308 cp++; in __res_vinit()
309 *cp = '\0'; in __res_vinit()
329 cp = buf + sizeof("domain") - 1; in __res_vinit()
330 while (*cp == ' ' || *cp == '\t') in __res_vinit()
331 cp++; in __res_vinit()
332 if ((*cp == '\0') || (*cp == '\n')) in __res_vinit()
334 strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1); in __res_vinit()
336 if ((cp = strpbrk(statp->defdname, " \t\n")) != NULL) in __res_vinit()
337 *cp = '\0'; in __res_vinit()
345 cp = buf + sizeof("search") - 1; in __res_vinit()
346 while (*cp == ' ' || *cp == '\t') in __res_vinit()
347 cp++; in __res_vinit()
348 if ((*cp == '\0') || (*cp == '\n')) in __res_vinit()
350 strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1); in __res_vinit()
352 if ((cp = strchr(statp->defdname, '\n')) != NULL) in __res_vinit()
353 *cp = '\0'; in __res_vinit()
358 cp = statp->defdname; in __res_vinit()
360 *pp++ = cp; in __res_vinit()
361 for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) { in __res_vinit()
362 if (*cp == ' ' || *cp == '\t') { in __res_vinit()
363 *cp = 0; in __res_vinit()
366 *pp++ = cp; in __res_vinit()
371 while (*cp != '\0' && *cp != ' ' && *cp != '\t') in __res_vinit()
372 cp++; in __res_vinit()
373 *cp = '\0'; in __res_vinit()
385 cp = buf + sizeof("nameserver") - 1; in __res_vinit()
386 while (*cp == ' ' || *cp == '\t') in __res_vinit()
387 cp++; in __res_vinit()
388 cp[strcspn(cp, ";# \t\n")] = '\0'; in __res_vinit()
389 if ((*cp != '\0') && (*cp != '\n')) { in __res_vinit()
395 if (getaddrinfo(cp, sbuf, &hints, &ai) == 0 && in __res_vinit()
417 cp = buf + sizeof("sortlist") - 1; in __res_vinit()
419 while (*cp == ' ' || *cp == '\t') in __res_vinit()
420 cp++; in __res_vinit()
421 if (*cp == '\0' || *cp == '\n' || *cp == ';') in __res_vinit()
423 net = cp; in __res_vinit()
424 while (*cp && !ISSORTMASK(*cp) && *cp != ';' && in __res_vinit()
425 isascii(*cp) && !isspace((unsigned char)*cp)) in __res_vinit()
426 cp++; in __res_vinit()
427 n = *cp; in __res_vinit()
428 *cp = 0; in __res_vinit()
432 *cp++ = n; in __res_vinit()
433 net = cp; in __res_vinit()
434 while (*cp && *cp != ';' && in __res_vinit()
435 isascii(*cp) && in __res_vinit()
436 !isspace((unsigned char)*cp)) in __res_vinit()
437 cp++; in __res_vinit()
438 n = *cp; in __res_vinit()
439 *cp = 0; in __res_vinit()
452 *cp = n; in __res_vinit()
480 (cp = strchr(buf, '.')) != NULL) in __res_vinit()
481 strcpy(statp->defdname, cp + 1); in __res_vinit()
490 for (cp = statp->defdname; *cp; cp++) in __res_vinit()
491 dots += (*cp == '.'); in __res_vinit()
493 cp = statp->defdname; in __res_vinit()
497 cp = strchr(cp, '.') + 1; /*%< we know there is one */ in __res_vinit()
498 *pp++ = cp; in __res_vinit()
512 if ((cp = getenv("RES_OPTIONS")) != NULL) in __res_vinit()
513 res_setoptions(statp, cp, "env"); in __res_vinit()
521 const char *cp = options; in res_setoptions() local
530 while (*cp) { in res_setoptions()
532 while (*cp == ' ' || *cp == '\t') in res_setoptions()
533 cp++; in res_setoptions()
535 if (!strncmp(cp, "ndots:", sizeof("ndots:") - 1)) { in res_setoptions()
536 i = atoi(cp + sizeof("ndots:") - 1); in res_setoptions()
545 } else if (!strncmp(cp, "timeout:", sizeof("timeout:") - 1)) { in res_setoptions()
546 i = atoi(cp + sizeof("timeout:") - 1); in res_setoptions()
556 } else if (!strncmp(cp, "retrans:", sizeof("retrans:") - 1)) { in res_setoptions()
562 statp->retrans = atoi(cp + sizeof("retrans:") - 1); in res_setoptions()
563 } else if (!strncmp(cp, "retry:", sizeof("retry:") - 1)){ in res_setoptions()
569 statp->retry = atoi(cp + sizeof("retry:") - 1); in res_setoptions()
571 } else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){ in res_setoptions()
572 i = atoi(cp + sizeof("attempts:") - 1); in res_setoptions()
581 } else if (!strncmp(cp, "debug", sizeof("debug") - 1)) { in res_setoptions()
590 } else if (!strncmp(cp, "no_tld_query", in res_setoptions()
592 !strncmp(cp, "no-tld-query", in res_setoptions()
595 } else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) { in res_setoptions()
597 } else if (!strncmp(cp, "rotate", sizeof("rotate") - 1)) { in res_setoptions()
599 } else if (!strncmp(cp, "no-check-names", in res_setoptions()
604 else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) { in res_setoptions()
608 else if (!strncmp(cp, "dname", sizeof("dname") - 1)) { in res_setoptions()
611 else if (!strncmp(cp, "nibble:", sizeof("nibble:") - 1)) { in res_setoptions()
614 cp += sizeof("nibble:") - 1; in res_setoptions()
615 i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix) - 1); in res_setoptions()
616 strncpy(ext->nsuffix, cp, i); in res_setoptions()
619 else if (!strncmp(cp, "nibble2:", sizeof("nibble2:") - 1)) { in res_setoptions()
622 cp += sizeof("nibble2:") - 1; in res_setoptions()
623 i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix2) - 1); in res_setoptions()
624 strncpy(ext->nsuffix2, cp, i); in res_setoptions()
627 else if (!strncmp(cp, "v6revmode:", sizeof("v6revmode:") - 1)) { in res_setoptions()
628 cp += sizeof("v6revmode:") - 1; in res_setoptions()
630 if (!strncmp(cp, "single", sizeof("single") - 1)) { in res_setoptions()
632 } else if (!strncmp(cp, "both", sizeof("both") - 1)) { in res_setoptions()
642 while (*cp && *cp != ' ' && *cp != '\t') in res_setoptions()
643 cp++; in res_setoptions()