Lines Matching refs:nsort

95 static int sortlist_alloc(struct apattern **sortlist, int *nsort, struct apattern *pat);
101 static int config_sortlist(struct apattern **sortlist, int *nsort,
106 #define ARES_CONFIG_CHECK(x) (x->lookups && x->nsort > -1 && \
164 channel->nsort = -1; in ares_init_options()
402 if (channel->nsort) { in ares_save_options()
403 options->sortlist = malloc(channel->nsort * sizeof(struct apattern)); in ares_save_options()
406 for (i = 0; i < channel->nsort; i++) in ares_save_options()
409 options->nsort = channel->nsort; in ares_save_options()
501 if ((optmask & ARES_OPT_SORTLIST) && (channel->nsort == -1) && in init_by_options()
502 (options->nsort>0)) { in init_by_options()
503 channel->sortlist = malloc(options->nsort * sizeof(struct apattern)); in init_by_options()
506 for (i = 0; i < options->nsort; i++) in init_by_options()
508 channel->nsort = options->nsort; in init_by_options()
793 int status = -1, nservers = 0, nsort = 0; in init_by_resolv_conf() local
995 channel->nsort == -1) in init_by_resolv_conf()
996 status = config_sortlist(&sortlist, &nsort, p); in init_by_resolv_conf()
1135 channel->nsort = nsort; in init_by_resolv_conf()
1239 if (channel->nsort == -1) { in init_by_defaults()
1241 channel->nsort = 0; in init_by_defaults()
1383 static int config_sortlist(struct apattern **sortlist, int *nsort, in config_sortlist() argument
1421 if (!sortlist_alloc(sortlist, nsort, &pat)) in config_sortlist()
1431 if (!sortlist_alloc(sortlist, nsort, &pat)) in config_sortlist()
1448 if (!sortlist_alloc(sortlist, nsort, &pat)) in config_sortlist()
1633 static int sortlist_alloc(struct apattern **sortlist, int *nsort, in sortlist_alloc() argument
1637 newsort = realloc(*sortlist, (*nsort + 1) * sizeof(struct apattern)); in sortlist_alloc()
1640 newsort[*nsort] = *pat; in sortlist_alloc()
1642 (*nsort)++; in sortlist_alloc()