2025-04-27 07:49:33 -04:00

60 lines
1.2 KiB
C
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Copyright (c) 1992 Microsoft Corporation
Module Name:
lists.h
Abstract:
This module contains the macros for managing lists
Author:
Jameel Hyder (microsoft!jameelh)
Revision History:
25 Oct 1992 Initial Version
Notes: Tab stop: 4
--*/
#ifndef _LISTS_
#define _LISTS_
#define AtalkLinkDoubleAtHead(_pHead, _p, Next, Prev) \
{ \
(_p)->Next = (_pHead); \
(_p)->Prev = &(_pHead); \
if ((_pHead) != NULL) \
(_pHead)->Prev = &(_p)->Next; \
(_pHead) = (_p); \
}
#define AtalkLinkDoubleAtEnd(_pThis, _pLast, Next, Prev) \
{ \
(_pLast)->Next = (_pThis); \
(_pThis)->Prev = &(_pLast)->Next; \
(_pThis)->Next = NULL; \
}
#define AtalkInsertDoubleBefore(_pThis, _pBefore, Next, Prev)\
{ \
(_pThis)->Next = (_pBefore); \
(_pThis)->Prev = (_pBefore)->Prev; \
(_pBefore)->Prev = &(_pThis)->Next; \
*((_pThis)->Prev) = (_pThis); \
}
#define AtalkUnlinkDouble(_p, Next, Prev) \
{ \
*((_p)->Prev) = (_p)->Next; \
if ((_p)->Next != NULL) \
(_p)->Next->Prev = (_p)->Prev; \
}
#endif // _LISTS_