Commit df5e0316 authored by Brian Wellington's avatar Brian Wellington

- add the missing typedef for dns_order_t

- change the order of parameters to dns_order_create() for consistency
- add multiple inclusion protection to order.h
- fix a couple of typos
parent f4ea2635
......@@ -15,7 +15,10 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: order.h,v 1.1 2002/03/07 06:29:37 marka Exp $ */
/* $Id: order.h,v 1.2 2002/03/07 07:48:47 bwelling Exp $ */
#ifndef DNS_ORDER_H
#define DNS_ORDER_H 1
#include <isc/lang.h>
#include <isc/types.h>
......@@ -25,7 +28,7 @@
ISC_LANG_BEGINDECLS
isc_result_t
dns_order_create(dns_order_t **orderp, isc_mem_t *mctx);
dns_order_create(isc_mem_t *mctx, dns_order_t **orderp);
/*
* Create a order object.
*
......@@ -90,3 +93,5 @@ dns_order_detach(dns_order_t **orderp);
*/
ISC_LANG_ENDDECLS
#endif /* DNS_ORDER_H */
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: types.h,v 1.104 2001/09/04 14:18:31 marka Exp $ */
/* $Id: types.h,v 1.105 2002/03/07 07:48:48 bwelling Exp $ */
#ifndef DNS_TYPES_H
#define DNS_TYPES_H 1
......@@ -76,6 +76,7 @@ typedef struct dns_name dns_name_t;
typedef ISC_LIST(dns_name_t) dns_namelist_t;
typedef isc_uint16_t dns_opcode_t;
typedef unsigned char dns_offsets_t[128];
typedef struct dns_order dns_order_t;
typedef struct dns_peer dns_peer_t;
typedef struct dns_peerlist dns_peerlist_t;
typedef struct dns_rbt dns_rbt_t;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: order.c,v 1.1 2002/03/07 06:29:37 marka Exp $ */
/* $Id: order.c,v 1.2 2002/03/07 07:48:46 bwelling Exp $ */
#include <isc/magic.h>
#include <isc/mem.h>
......@@ -49,7 +49,7 @@ struct dns_order {
#define DNS_ORDER_VALID(order) ISC_MAGIC_VALID(order, DNS_ORDER_MAGIC)
isc_result_t
dns_order_create(dns_order_t **orderp, isc_mem_t *mctx) {
dns_order_create(isc_mem_t *mctx, dns_order_t **orderp) {
dns_order_t *order;
REQUIRE(orderp != NULL && *orderp == NULL);
......@@ -60,7 +60,7 @@ dns_order_create(dns_order_t **orderp, isc_mem_t *mctx) {
ISC_LIST_INIT(order->ents);
isc_refcount_init(&order->references, 1); /* Implicit attach. */
order->mctx = 0;
order->mctx = NULL;
isc_mem_attach(mctx, &order->mctx);
order->magic = DNS_ORDER_MAGIC;
return (ISC_R_SUCCESS);
......@@ -76,7 +76,7 @@ dns_order_add(dns_order_t *order, dns_name_t *name,
REQUIRE(DNS_ORDER_VALID(order));
REQUIRE(mode == DNS_RDATASETATTR_RANDOMIZE ||
mode == DNS_RDATASETATTR_FIXEDORDER ||
mode == 0 /* DNS_RDATASETATTY_CYCLIC */ );
mode == 0 /* DNS_RDATASETATTR_CYCLIC */ );
ent = isc_mem_get(order->mctx, sizeof(*ent));
if (ent == NULL)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment