Merge from vendor branch GCC:
[dragonfly.git] / contrib / bind-9.3 / lib / dns / include / dns / order.h
1 /*
2  * Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 2002  Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15  * PERFORMANCE OF THIS SOFTWARE.
16  */
17
18 /* $Id: order.h,v 1.2.202.3 2004/03/08 09:04:37 marka Exp $ */
19
20 #ifndef DNS_ORDER_H
21 #define DNS_ORDER_H 1
22
23 #include <isc/lang.h>
24 #include <isc/types.h>
25
26 #include <dns/types.h>
27
28 ISC_LANG_BEGINDECLS
29
30 isc_result_t
31 dns_order_create(isc_mem_t *mctx, dns_order_t **orderp);
32 /*
33  * Create a order object.
34  *
35  * Requires:
36  *      'orderp' to be non NULL and '*orderp == NULL'.
37  *      'mctx' to be valid.
38  *
39  * Returns:
40  *      ISC_R_SUCCESS
41  *      ISC_R_NOMEMORY
42  */
43
44 isc_result_t
45 dns_order_add(dns_order_t *order, dns_name_t *name,
46               dns_rdatatype_t rdtype, dns_rdataclass_t rdclass,
47               unsigned int mode);
48 /*
49  * Add a entry to the end of the order list.
50  *
51  * Requires:
52  *      'order' to be valid.
53  *      'name' to be valid.
54  *      'mode' to be one of DNS_RDATASERATTR_RANDOMIZE,
55  *              DNS_RDATASERATTR_RANDOMIZE or zero (DNS_RDATASERATTR_CYCLIC).
56  *
57  * Returns:
58  *      ISC_R_SUCCESS
59  *      ISC_R_NOMEMORY
60  */
61
62 unsigned int
63 dns_order_find(dns_order_t *order, dns_name_t *name,
64                dns_rdatatype_t rdtype, dns_rdataclass_t rdclass);
65 /*
66  * Find the first matching entry on the list.
67  *
68  * Requires:
69  *      'order' to be valid.
70  *      'name' to be valid.
71  *
72  * Returns the mode set by dns_order_add() or zero.
73  */
74
75 void
76 dns_order_attach(dns_order_t *source, dns_order_t **target);
77 /*
78  * Attach to the 'source' object.
79  *
80  * Requires:
81  *      'source' to be valid.
82  *      'target' to be non NULL and '*target == NULL'.
83  */
84
85 void
86 dns_order_detach(dns_order_t **orderp);
87 /*
88  * Detach from the object.  Clean up if last this was the last
89  * reference.
90  *
91  * Requires:
92  *      '*orderp' to be valid.
93  */
94
95 ISC_LANG_ENDDECLS
96
97 #endif /* DNS_ORDER_H */