Lines Matching refs:order
18 /* $Id: order.c,v 1.10 2007/06/19 23:47:16 tbox Exp $ */
32 #include <dns/order.h>
53 #define DNS_ORDER_VALID(order) ISC_MAGIC_VALID(order, DNS_ORDER_MAGIC)
57 dns_order_t *order;
62 order = isc_mem_get(mctx, sizeof(*order));
63 if (order == NULL)
66 ISC_LIST_INIT(order->ents);
69 result = isc_refcount_init(&order->references, 1);
71 isc_mem_put(mctx, order, sizeof(*order));
75 order->mctx = NULL;
76 isc_mem_attach(mctx, &order->mctx);
77 order->magic = DNS_ORDER_MAGIC;
78 *orderp = order;
83 dns_order_add(dns_order_t *order, dns_name_t *name,
89 REQUIRE(DNS_ORDER_VALID(order));
94 ent = isc_mem_get(order->mctx, sizeof(*ent));
105 ISC_LIST_INITANDAPPEND(order->ents, ent, link);
118 dns_order_find(dns_order_t *order, dns_name_t *name,
122 REQUIRE(DNS_ORDER_VALID(order));
124 for (ent = ISC_LIST_HEAD(order->ents);
148 dns_order_t *order;
153 order = *orderp;
154 REQUIRE(DNS_ORDER_VALID(order));
155 isc_refcount_decrement(&order->references, &references);
160 order->magic = 0;
161 while ((ent = ISC_LIST_HEAD(order->ents)) != NULL) {
162 ISC_LIST_UNLINK(order->ents, ent, link);
163 isc_mem_put(order->mctx, ent, sizeof(*ent));
165 isc_refcount_destroy(&order->references);
166 isc_mem_putanddetach(&order->mctx, order, sizeof(*order));