prefix SLIST with HEIM

This commit is contained in:
Love Hornquist Astrand
2010-12-12 11:45:35 -08:00
parent 7b1e954ad4
commit 7c7dd8e1af
28 changed files with 90 additions and 90 deletions

View File

@@ -34,20 +34,20 @@
#ifndef _MECHQUEUE_H_
#define _MECHQUEUE_H_
#ifndef SLIST_HEAD
#ifndef HEIM_SLIST_HEAD
/*
* Singly-linked List definitions.
*/
#define SLIST_HEAD(name, type) \
#define HEIM_SLIST_HEAD(name, type) \
struct name { \
struct type *slh_first; /* first element */ \
}
#define SLIST_HEAD_INITIALIZER(head) \
#define HEIM_SLIST_HEAD_INITIALIZER(head) \
{ NULL }
#define SLIST_ENTRY(type) \
#define HEIM_SLIST_ENTRY(type) \
struct { \
struct type *sle_next; /* next element */ \
}
@@ -55,27 +55,27 @@ struct { \
/*
* Singly-linked List functions.
*/
#define SLIST_INIT(head) do { \
#define HEIM_SLIST_INIT(head) do { \
(head)->slh_first = NULL; \
} while (/*CONSTCOND*/0)
#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
#define HEIM_SLIST_INSERT_AFTER(slistelm, elm, field) do { \
(elm)->field.sle_next = (slistelm)->field.sle_next; \
(slistelm)->field.sle_next = (elm); \
} while (/*CONSTCOND*/0)
#define SLIST_INSERT_HEAD(head, elm, field) do { \
#define HEIM_SLIST_INSERT_HEAD(head, elm, field) do { \
(elm)->field.sle_next = (head)->slh_first; \
(head)->slh_first = (elm); \
} while (/*CONSTCOND*/0)
#define SLIST_REMOVE_HEAD(head, field) do { \
#define HEIM_SLIST_REMOVE_HEAD(head, field) do { \
(head)->slh_first = (head)->slh_first->field.sle_next; \
} while (/*CONSTCOND*/0)
#define SLIST_REMOVE(head, elm, type, field) do { \
#define HEIM_SLIST_REMOVE(head, elm, type, field) do { \
if ((head)->slh_first == (elm)) { \
SLIST_REMOVE_HEAD((head), field); \
HEIM_SLIST_REMOVE_HEAD((head), field); \
} \
else { \
struct type *curelm = (head)->slh_first; \
@@ -86,16 +86,16 @@ struct { \
} \
} while (/*CONSTCOND*/0)
#define SLIST_FOREACH(var, head, field) \
#define HEIM_SLIST_FOREACH(var, head, field) \
for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
/*
* Singly-linked List access methods.
*/
#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
#define SLIST_FIRST(head) ((head)->slh_first)
#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
#define HEIM_SLIST_EMPTY(head) ((head)->slh_first == NULL)
#define HEIM_SLIST_FIRST(head) ((head)->slh_first)
#define HEIM_SLIST_NEXT(elm, field) ((elm)->field.sle_next)
#endif /* SLIST_HEAD */
#endif /* HEIM_SLIST_HEAD */
#endif /* !_MECHQUEUE_H_ */