ISC_LINK_*UNSAFE -> ISC_LINK_INITAND*

This commit is contained in:
Mark Andrews 2000-12-07 20:15:58 +00:00
parent 020ebf1190
commit 6fda157766
14 changed files with 50 additions and 44 deletions

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dighost.c,v 1.169 2000/12/07 19:56:04 mws Exp $ */
/* $Id: dighost.c,v 1.170 2000/12/07 20:15:40 marka Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
@ -649,7 +649,7 @@ setup_system(void) {
ptr,
MXNAME);
search->origin[MXNAME-1]=0;
ISC_LIST_APPENDUNSAFE
ISC_LIST_INITANDAPPEND
(search_list,
search,
link);
@ -673,7 +673,7 @@ setup_system(void) {
ptr,
MXNAME - 1);
search->origin[MXNAME-1]=0;
ISC_LIST_PREPENDUNSAFE
ISC_LIST_INITANDPREPEND
(search_list,
search,
link);

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: nslookup.c,v 1.65 2000/12/07 19:56:05 mws Exp $ */
/* $Id: nslookup.c,v 1.66 2000/12/07 20:15:41 marka Exp $ */
#include <config.h>
@ -807,7 +807,7 @@ setsrv(char *opt) {
if (srv == NULL)
fatal("Memory allocation failure.");
safecpy(srv->servername, opt, MXNAME-1);
ISC_LIST_APPENDUNSAFE(server_list, srv, link);
ISC_LIST_INITANDAPPEND(server_list, srv, link);
}
static void

View file

@ -17,7 +17,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dnssec-makekeyset.c,v 1.44 2000/11/09 18:55:16 bwelling Exp $ */
/* $Id: dnssec-makekeyset.c,v 1.45 2000/12/07 20:15:43 marka Exp $ */
#include <config.h>
@ -286,7 +286,7 @@ main(int argc, char *argv[]) {
if (keynode == NULL)
fatal("out of memory");
keynode->key = zonekey;
ISC_LIST_APPENDUNSAFE(keylist, keynode, link);
ISC_LIST_INITANDAPPEND(keylist, keynode, link);
}
rdata = isc_mem_get(mctx, sizeof(dns_rdata_t));
if (rdata == NULL)

View file

@ -17,7 +17,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dnssec-signkey.c,v 1.43 2000/11/09 18:55:17 bwelling Exp $ */
/* $Id: dnssec-signkey.c,v 1.44 2000/12/07 20:15:44 marka Exp $ */
#include <config.h>
@ -124,7 +124,7 @@ loadkeys(dns_name_t *name, dns_rdataset_t *rdataset) {
fatal("out of memory");
keynode->key = key;
keynode->verified = ISC_FALSE;
ISC_LIST_APPENDUNSAFE(keylist, keynode, link);
ISC_LIST_INITANDAPPEND(keylist, keynode, link);
}
if (result != ISC_R_NOMORE)
fatal("failure traversing key list");

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: query.c,v 1.159 2000/12/05 19:17:32 gson Exp $ */
/* $Id: query.c,v 1.160 2000/12/07 20:15:46 marka Exp $ */
#include <config.h>
@ -155,7 +155,7 @@ query_reset(ns_client_t *client, isc_boolean_t everything) {
dns_db_closeversion(dbversion->db, &dbversion->version,
ISC_FALSE);
dns_db_detach(&dbversion->db);
ISC_LIST_APPENDUNSAFE(client->query.freeversions,
ISC_LIST_INITANDAPPEND(client->query.freeversions,
dbversion, link);
}
ISC_LIST_INIT(client->query.activeversions);
@ -384,7 +384,7 @@ query_newdbversion(ns_client_t *client, unsigned int n) {
if (dbversion != NULL) {
dbversion->db = NULL;
dbversion->version = NULL;
ISC_LIST_APPENDUNSAFE(client->query.freeversions,
ISC_LIST_INITANDAPPEND(client->query.freeversions,
dbversion, link);
} else {
/*

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dispatch.c,v 1.75 2000/11/10 03:08:57 gson Exp $ */
/* $Id: dispatch.c,v 1.76 2000/12/07 20:15:47 marka Exp $ */
#include <config.h>
@ -2043,7 +2043,7 @@ dns_dispatch_addrequest(dns_dispatch_t *disp,
res->arg = arg;
res->item_out = ISC_FALSE;
ISC_LIST_INIT(res->items);
ISC_LIST_APPENDUNSAFE(disp->rq_handlers, res, link);
ISC_LIST_INITANDAPPEND(disp->rq_handlers, res, link);
request_log(disp, res, LVL(90), "attaching task %p", res->task);

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: master.c,v 1.85 2000/12/04 04:17:00 marka Exp $ */
/* $Id: master.c,v 1.86 2000/12/07 20:15:49 marka Exp $ */
#include <config.h>
@ -1329,9 +1329,9 @@ load(dns_loadctx_t **ctxp) {
this->ttl = ctx->ttl;
ISC_LIST_INIT(this->rdata);
if (ctx->glue != NULL)
ISC_LIST_PREPENDUNSAFE(glue_list, this, link);
ISC_LIST_INITANDPREPEND(glue_list, this, link);
else
ISC_LIST_PREPENDUNSAFE(current_list, this,
ISC_LIST_INITANDPREPEND(current_list, this,
link);
} else if (this->ttl != ctx->ttl) {
(*callbacks->warn)(callbacks,

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rbtdb.c,v 1.137 2000/12/07 19:51:57 marka Exp $ */
/* $Id: rbtdb.c,v 1.138 2000/12/07 20:15:50 marka Exp $ */
/*
* Principal Author: Bob Halley
@ -501,7 +501,7 @@ add_changed(dns_rbtdb_t *rbtdb, rbtdb_version_t *version,
INSIST(node->references != 0);
changed->node = node;
changed->dirty = ISC_FALSE;
ISC_LIST_APPENDUNSAFE(version->changed_list, changed, link);
ISC_LIST_INITANDAPPEND(version->changed_list, changed, link);
} else
version->commit_ok = ISC_FALSE;

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: resolver.c,v 1.184 2000/11/27 19:56:16 halley Exp $ */
/* $Id: resolver.c,v 1.185 2000/12/07 20:15:51 marka Exp $ */
#include <config.h>
@ -1276,7 +1276,7 @@ add_bad(fetchctx_t *fctx, isc_sockaddr_t *address) {
if (sa == NULL)
return;
*sa = *address;
ISC_LIST_APPENDUNSAFE(fctx->bad, sa, link);
ISC_LIST_INITANDAPPEND(fctx->bad, sa, link);
}
static void

View file

@ -16,7 +16,7 @@
*/
/*
* $Id: ssu.c,v 1.16 2000/12/07 17:52:37 marka Exp $
* $Id: ssu.c,v 1.17 2000/12/07 20:15:52 marka Exp $
* Principal Author: Brian Wellington
*/
@ -212,7 +212,7 @@ dns_ssutable_addrule(dns_ssutable_t *table, isc_boolean_t grant,
rule->types = NULL;
rule->magic = SSURULEMAGIC;
ISC_LIST_APPENDUNSAFE(table->rules, rule, link);
ISC_LIST_INITANDAPPEND(table->rules, rule, link);
return (ISC_R_SUCCESS);

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: list.h,v 1.15 2000/10/20 13:35:56 marka Exp $ */
/* $Id: list.h,v 1.16 2000/12/07 20:15:58 marka Exp $ */
#ifndef ISC_LIST_H
#define ISC_LIST_H 1
@ -44,7 +44,7 @@
#define ISC_LIST_TAIL(list) ((list).tail)
#define ISC_LIST_EMPTY(list) ISC_TF((list).head == NULL)
#define ISC_LIST_PREPENDUNSAFE(list, elt, link) \
#define __ISC_LIST_PREPENDUNSAFE(list, elt, link) \
do { \
if ((list).head != NULL) \
(list).head->link.prev = (elt); \
@ -58,10 +58,13 @@
#define ISC_LIST_PREPEND(list, elt, link) \
do { \
ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \
ISC_LIST_PREPENDUNSAFE(list, elt, link); \
__ISC_LIST_PREPENDUNSAFE(list, elt, link); \
} while (0)
#define ISC_LIST_APPENDUNSAFE(list, elt, link) \
#define ISC_LIST_INITANDPREPEND(list, elt, link) \
__ISC_LIST_PREPENDUNSAFE(list, elt, link)
#define __ISC_LIST_APPENDUNSAFE(list, elt, link) \
do { \
if ((list).tail != NULL) \
(list).tail->link.next = (elt); \
@ -75,10 +78,13 @@
#define ISC_LIST_APPEND(list, elt, link) \
do { \
ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \
ISC_LIST_APPENDUNSAFE(list, elt, link); \
__ISC_LIST_APPENDUNSAFE(list, elt, link); \
} while (0)
#define ISC_LIST_UNLINKUNSAFE(list, elt, link) \
#define ISC_LIST_INITANDAPPEND(list, elt, link) \
__ISC_LIST_APPENDUNSAFE(list, elt, link)
#define __ISC_LIST_UNLINKUNSAFE(list, elt, link) \
do { \
if ((elt)->link.next != NULL) \
(elt)->link.next->link.prev = (elt)->link.prev; \
@ -95,13 +101,13 @@
#define ISC_LIST_UNLINK(list, elt, link) \
do { \
ISC_LINK_INSIST(ISC_LINK_LINKED(elt, link)); \
ISC_LIST_UNLINKUNSAFE(list, elt, link); \
__ISC_LIST_UNLINKUNSAFE(list, elt, link); \
} while (0)
#define ISC_LIST_PREV(elt, link) ((elt)->link.prev)
#define ISC_LIST_NEXT(elt, link) ((elt)->link.next)
#define ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link) \
#define __ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link) \
do { \
if ((before)->link.prev == NULL) \
ISC_LIST_PREPEND(list, elt, link); \
@ -117,10 +123,10 @@
do { \
ISC_LINK_INSIST(ISC_LINK_LINKED(before, link)); \
ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \
ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link); \
__ISC_LIST_INSERTBEFOREUNSAFE(list, before, elt, link); \
} while (0)
#define ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link) \
#define __ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link) \
do { \
if ((after)->link.next == NULL) \
ISC_LIST_APPEND(list, elt, link); \
@ -136,7 +142,7 @@
do { \
ISC_LINK_INSIST(ISC_LINK_LINKED(after, link)); \
ISC_LINK_INSIST(!ISC_LINK_LINKED(elt, link)); \
ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link); \
__ISC_LIST_INSERTAFTERUNSAFE(list, after, elt, link); \
} while (0)
#define ISC_LIST_APPENDLIST(list1, list2, link) \
@ -153,10 +159,10 @@
} while (0)
#define ISC_LIST_ENQUEUE(list, elt, link) ISC_LIST_APPEND(list, elt, link)
#define ISC_LIST_ENQUEUEUNSAFE(list, elt, link) \
ISC_LIST_APPENDUNSAFE(list, elt, link)
#define __ISC_LIST_ENQUEUEUNSAFE(list, elt, link) \
__ISC_LIST_APPENDUNSAFE(list, elt, link)
#define ISC_LIST_DEQUEUE(list, elt, link) ISC_LIST_UNLINK(list, elt, link)
#define ISC_LIST_DEQUEUEUNSAFE(list, elt, link) \
ISC_LIST_UNLINKUNSAFE(list, elt, link)
#define __ISC_LIST_DEQUEUEUNSAFE(list, elt, link) \
__ISC_LIST_UNLINKUNSAFE(list, elt, link)
#endif /* ISC_LIST_H */

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lex.c,v 1.53 2000/12/06 00:29:58 tale Exp $ */
/* $Id: lex.c,v 1.54 2000/12/07 20:15:54 marka Exp $ */
#include <config.h>
@ -213,7 +213,7 @@ new_source(isc_lex_t *lex, isc_boolean_t is_file, isc_boolean_t need_close,
return (result);
}
source->line = 1;
ISC_LIST_PREPENDUNSAFE(lex->sources, source, link);
ISC_LIST_INITANDPREPEND(lex->sources, source, link);
return (ISC_R_SUCCESS);
}

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: log.c,v 1.51 2000/12/07 19:30:26 tale Exp $ */
/* $Id: log.c,v 1.52 2000/12/07 20:15:55 marka Exp $ */
/* Principal Authors: DCL */
@ -1040,7 +1040,7 @@ assignchannel(isc_logconfig_t *lcfg, unsigned int category_id,
new_item->channel = channel;
new_item->module = module;
ISC_LIST_PREPENDUNSAFE(lcfg->channellists[category_id],
ISC_LIST_INITANDPREPEND(lcfg->channellists[category_id],
new_item, link);
/*

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mem.c,v 1.72 2000/12/06 23:39:04 bwelling Exp $ */
/* $Id: mem.c,v 1.73 2000/12/07 20:15:57 marka Exp $ */
#include <config.h>
@ -1366,7 +1366,7 @@ isc_mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp) {
*mpctxp = mpctx;
ISC_LIST_APPENDUNSAFE(mctx->pools, mpctx, link);
ISC_LIST_INITANDAPPEND(mctx->pools, mpctx, link);
UNLOCK(&mctx->lock);