Lines Matching defs:cp
172 register char *cp, **pp;
248 if ((cp = getenv("LOCALDOMAIN")) != NULL) {
249 (void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
260 cp = statp->defdname;
262 *pp++ = cp;
263 for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) {
264 if (*cp == '\n') /* silly backwards compat */
266 else if (*cp == ' ' || *cp == '\t') {
267 *cp = 0;
270 *pp++ = cp;
276 while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n')
277 cp++;
278 *cp = '\0';
302 cp = buf + sizeof("domain") - 1;
303 while (*cp == ' ' || *cp == '\t')
304 cp++;
305 if ((*cp == '\0') || (*cp == '\n'))
307 strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
309 if ((cp = strpbrk(statp->defdname, " \t\n")) != NULL)
310 *cp = '\0';
318 cp = buf + sizeof("search") - 1;
319 while (*cp == ' ' || *cp == '\t')
320 cp++;
321 if ((*cp == '\0') || (*cp == '\n'))
323 strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
325 if ((cp = strchr(statp->defdname, '\n')) != NULL)
326 *cp = '\0';
331 cp = statp->defdname;
333 *pp++ = cp;
334 for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) {
335 if (*cp == ' ' || *cp == '\t') {
336 *cp = 0;
339 *pp++ = cp;
344 while (*cp != '\0' && *cp != ' ' && *cp != '\t')
345 cp++;
346 *cp = '\0';
358 cp = buf + sizeof("nameserver") - 1;
359 while (*cp == ' ' || *cp == '\t')
360 cp++;
361 cp[strcspn(cp, ";# \t\n")] = '\0';
362 if ((*cp != '\0') && (*cp != '\n')) {
368 if (getaddrinfo(cp, sbuf, &hints, &ai) == 0 &&
389 cp = buf + sizeof("sortlist") - 1;
391 while (*cp == ' ' || *cp == '\t')
392 cp++;
393 if (*cp == '\0' || *cp == '\n' || *cp == ';')
395 net = cp;
396 while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
397 isascii(*cp) && !isspace((unsigned char)*cp))
398 cp++;
399 n = *cp;
400 *cp = 0;
404 *cp++ = n;
405 net = cp;
406 while (*cp && *cp != ';' &&
407 isascii(*cp) &&
408 !isspace((unsigned char)*cp))
409 cp++;
410 n = *cp;
411 *cp = 0;
424 *cp = n;
450 (cp = strchr(buf, '.')) != NULL)
451 strcpy(statp->defdname, cp + 1);
460 for (cp = statp->defdname; *cp; cp++)
461 dots += (*cp == '.');
463 cp = statp->defdname;
467 cp = strchr(cp, '.') + 1; /* we know there is one */
468 *pp++ = cp;
482 if ((cp = getenv("RES_OPTIONS")) != NULL)
483 res_setoptions(statp, cp, "env");
494 const char *cp = options;
503 while (*cp) {
505 while (*cp == ' ' || *cp == '\t')
506 cp++;
508 if (!strncmp(cp, "ndots:", sizeof("ndots:") - 1)) {
509 i = atoi(cp + sizeof("ndots:") - 1);
518 } else if (!strncmp(cp, "timeout:", sizeof("timeout:") - 1)) {
519 i = atoi(cp + sizeof("timeout:") - 1);
528 } else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){
529 i = atoi(cp + sizeof("attempts:") - 1);
538 } else if (!strncmp(cp, "debug", sizeof("debug") - 1)) {
547 } else if (!strncmp(cp, "no_tld_query",
549 !strncmp(cp, "no-tld-query",
552 } else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
554 } else if (!strncmp(cp, "rotate", sizeof("rotate") - 1)) {
556 } else if (!strncmp(cp, "no-check-names",
561 else if (!strncmp(cp, "edns0", sizeof("edns0") - 1)) {
565 else if (!strncmp(cp, "dname", sizeof("dname") - 1)) {
568 else if (!strncmp(cp, "nibble:", sizeof("nibble:") - 1)) {
571 cp += sizeof("nibble:") - 1;
572 i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix) - 1);
573 strncpy(ext->nsuffix, cp, (size_t)i);
576 else if (!strncmp(cp, "nibble2:", sizeof("nibble2:") - 1)) {
579 cp += sizeof("nibble2:") - 1;
580 i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix2) - 1);
581 strncpy(ext->nsuffix2, cp, (size_t)i);
584 else if (!strncmp(cp, "v6revmode:", sizeof("v6revmode:") - 1)) {
585 cp += sizeof("v6revmode:") - 1;
587 if (!strncmp(cp, "single", sizeof("single") - 1)) {
589 } else if (!strncmp(cp, "both", sizeof("both") - 1)) {
599 while (*cp && *cp != ' ' && *cp != '\t')
600 cp++;