X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=include%2Fslist.h;h=5755ca14e3b6edef9b4488329a417c6bfa3a03a8;hb=f1f22dbf6222c4899b45d9c83ccf1b6314464869;hp=56c836414dcad24f3997afb288fce9ad50eeedd5;hpb=dabf41528576be84318ce8da010173493c1e1231;p=deb_libnfs.git diff --git a/include/slist.h b/include/slist.h index 56c8364..5755ca1 100644 --- a/include/slist.h +++ b/include/slist.h @@ -15,15 +15,18 @@ along with this program; if not, see . */ -#define SLIST_ADD(list, item) \ +#ifndef _LIBNFS_SLIST_H_ +#define _LIBNFS_SLIST_H_ + +#define LIBNFS_LIST_ADD(list, item) \ do { \ (item)->next = (*list); \ (*list) = (item); \ } while (0); -#define SLIST_ADD_END(list, item) \ +#define LIBNFS_LIST_ADD_END(list, item) \ if ((*list) == NULL) { \ - SLIST_ADD((list), (item)); \ + LIBNFS_LIST_ADD((list), (item)); \ } else { \ void *head = (*list); \ while ((*list)->next) \ @@ -33,7 +36,7 @@ (*list) = head; \ } -#define SLIST_REMOVE(list, item) \ +#define LIBNFS_LIST_REMOVE(list, item) \ if ((*list) == (item)) { \ (*list) = (item)->next; \ } else { \ @@ -46,6 +49,4 @@ (*list) = head; \ } - - - +#endif /* !_LIBNFS_SLIST_H_ */