Lines Matching refs:list
33 ns_lwsearchlist_t *list;
39 list = isc_mem_get(mctx, sizeof(ns_lwsearchlist_t));
40 if (list == NULL)
43 result = isc_mutex_init(&list->lock);
45 isc_mem_put(mctx, list, sizeof(ns_lwsearchlist_t));
48 list->mctx = NULL;
49 isc_mem_attach(mctx, &list->mctx);
50 list->refs = 1;
51 ISC_LIST_INIT(list->names);
52 list->magic = LWSEARCHLIST_MAGIC;
54 *listp = list;
74 ns_lwsearchlist_t *list;
78 list = *listp;
79 REQUIRE(VALID_LWSEARCHLIST(list));
81 LOCK(&list->lock);
82 INSIST(list->refs > 0);
83 list->refs--;
84 UNLOCK(&list->lock);
87 if (list->refs != 0)
90 mctx = list->mctx;
91 while (!ISC_LIST_EMPTY(list->names)) {
92 dns_name_t *name = ISC_LIST_HEAD(list->names);
93 ISC_LIST_UNLINK(list->names, name, link);
94 dns_name_free(name, list->mctx);
95 isc_mem_put(list->mctx, name, sizeof(dns_name_t));
97 list->magic = 0;
98 isc_mem_put(mctx, list, sizeof(ns_lwsearchlist_t));
103 ns_lwsearchlist_append(ns_lwsearchlist_t *list, dns_name_t *name) {
107 REQUIRE(VALID_LWSEARCHLIST(list));
110 newname = isc_mem_get(list->mctx, sizeof(dns_name_t));
114 result = dns_name_dup(name, list->mctx, newname);
116 isc_mem_put(list->mctx, newname, sizeof(dns_name_t));
120 ISC_LIST_APPEND(list->names, newname, link);
125 ns_lwsearchctx_init(ns_lwsearchctx_t *sctx, ns_lwsearchlist_t *list,
134 if (dns_name_isabsolute(name) || list == NULL) {
135 sctx->list = NULL;
138 sctx->list = list;
139 sctx->searchname = ISC_LIST_HEAD(sctx->list->names);
154 if (sctx->list == NULL)
182 if (sctx->list == NULL ||