FreeBSD kernel pms device code
sallist.h File Reference

The file contains link list manipulation helper routines. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _SALINK
 Structure of Link Data. More...
 
struct  _SALINK_LIST
 Structure of Link List. More...
 

Macros

#define saLlistInitialize(pList)
 saLlistInitialize macro More...
 
#define saLlistIOInitialize(pList)
 
#define saLlinkInitialize(pLink)
 saLlinkInitialize macro More...
 
#define saLlinkIOInitialize(pLink)
 
#define saLlistAdd(pList, pLink)
 saLlistAdd macro More...
 
#define saLlistIOAdd(pList, pLink)
 
#define saLlistInsert(pList, pLink, pNew)
 saLlistInsert macro More...
 
#define saLlistRemove(pList, pLink)
 saLlistRemove macro More...
 
#define saLlistIORemove(pList, pLink)
 
#define saLlistGetHead(pList)   saLlistGetNext(pList,(pList)->pHead)
 saLlistGetHead macro More...
 
#define saLlistIOGetHead(pList)   saLlistGetNext(pList,(pList)->pHead)
 
#define saLlistGetTail(pList)   saLlistGetPrev((pList), (pList)->pHead)
 saLlistGetTail macro More...
 
#define saLlistGetCount(pList)   ((pList)->Count)
 saLlistGetCount macro More...
 
#define saLlistIOGetCount(pList)   ((pList)->Count)
 
#define saLlistGetNext(pList, pLink)
 saLlistGetNext macro More...
 
#define saLlistIOGetNext(pList, pLink)
 
#define saLlistGetPrev(pList, pLink)
 saLlistGetPrev macro More...
 
#define agObjectBase(baseType, fieldName, fieldPtr)
 

Typedefs

typedef struct _SALINK SALINK
 Structure of Link Data. More...
 
typedef struct _SALINKPSALINK
 
typedef struct _SALINK_LIST SALINK_LIST
 Structure of Link List. More...
 
typedef struct _SALINK_LISTPSALINK_LIST
 

Detailed Description

The file contains link list manipulation helper routines.

Definition in file sallist.h.

Macro Definition Documentation

◆ agObjectBase

#define agObjectBase (   baseType,
  fieldName,
  fieldPtr 
)
Value:
(void * ) fieldPtr == (void *) 0 ? (baseType *) 0 : \
((baseType *)((bit8 *)(fieldPtr) - ((bitptr)(&(((baseType *)0)->fieldName)))))
unsigned long bitptr
Definition: ostypes.h:112
unsigned char bit8
Definition: ostypes.h:97

Definition at line 438 of file sallist.h.

◆ saLlinkInitialize

#define saLlinkInitialize (   pLink)
Value:
{ (pLink)->pHead = agNULL; \
(pLink)->pNext = agNULL; \
(pLink)->pPrev = agNULL; \
}
#define agNULL
Definition: ostypes.h:151

saLlinkInitialize macro

use to initialize a Link

Definition at line 136 of file sallist.h.

◆ saLlinkIOInitialize

#define saLlinkIOInitialize (   pLink)
Value:
{ (pLink)->pHead = agNULL; \
(pLink)->pNext = agNULL; \
(pLink)->pPrev = agNULL; \
}

Definition at line 141 of file sallist.h.

◆ saLlistAdd

#define saLlistAdd (   pList,
  pLink 
)
Value:
{ \
(pLink)->pNext = (pList)->pHead; \
(pLink)->pPrev = (pList)->pHead->pPrev; \
(pLink)->pPrev->pNext = (pLink); \
(pList)->pHead->pPrev = (pLink); \
(pList)->Count ++; \
(pLink)->pHead = (pList)->pHead; \
}

saLlistAdd macro

use to add a link to the tail of list

Definition at line 176 of file sallist.h.

◆ saLlistGetCount

#define saLlistGetCount (   pList)    ((pList)->Count)

saLlistGetCount macro

use to get the number of links in the list excluding head and tail

Definition at line 359 of file sallist.h.

◆ saLlistGetHead

#define saLlistGetHead (   pList)    saLlistGetNext(pList,(pList)->pHead)

saLlistGetHead macro

use to get the link following the head link

Definition at line 305 of file sallist.h.

◆ saLlistGetNext

#define saLlistGetNext (   pList,
  pLink 
)
Value:
(((pLink)->pNext == (pList)->pHead) ? \
agNULL : (pLink)->pNext)

saLlistGetNext macro

use to get the next link in the list

Definition at line 395 of file sallist.h.

◆ saLlistGetPrev

#define saLlistGetPrev (   pList,
  pLink 
)
Value:
(((pLink)->pPrev == (pList)->pHead) ? \
agNULL : (pLink)->pPrev)

saLlistGetPrev macro

use to get the previous link in the list

Definition at line 433 of file sallist.h.

◆ saLlistGetTail

#define saLlistGetTail (   pList)    saLlistGetPrev((pList), (pList)->pHead)

saLlistGetTail macro

use to get the link preceding the tail link

Definition at line 331 of file sallist.h.

◆ saLlistInitialize

#define saLlistInitialize (   pList)
Value:
{(pList)->pHead = &((pList)->Head); \
(pList)->pHead->pNext = (pList)->pHead; \
(pList)->pHead->pPrev = (pList)->pHead; \
(pList)->Count = 0; \
}

saLlistInitialize macro

use to initialize a Link List

Definition at line 99 of file sallist.h.

◆ saLlistInsert

#define saLlistInsert (   pList,
  pLink,
  pNew 
)
Value:
{ \
(pNew)->pNext = (pLink); \
(pNew)->pPrev = (pLink)->pPrev; \
(pNew)->pPrev->pNext = (pNew); \
(pLink)->pPrev = (pNew); \
(pList)->Count ++; \
(pNew)->pHead = (pList)->pHead; \
}

saLlistInsert macro

use to insert a link preceding the given one

Definition at line 226 of file sallist.h.

◆ saLlistIOAdd

#define saLlistIOAdd (   pList,
  pLink 
)
Value:
{ \
(pLink)->pNext = (pList)->pHead; \
(pLink)->pPrev = (pList)->pHead->pPrev; \
(pLink)->pPrev->pNext = (pLink); \
(pList)->pHead->pPrev = (pLink); \
(pList)->Count ++; \
(pLink)->pHead = (pList)->pHead; \
}

Definition at line 185 of file sallist.h.

◆ saLlistIOGetCount

#define saLlistIOGetCount (   pList)    ((pList)->Count)

Definition at line 361 of file sallist.h.

◆ saLlistIOGetHead

#define saLlistIOGetHead (   pList)    saLlistGetNext(pList,(pList)->pHead)

Definition at line 307 of file sallist.h.

◆ saLlistIOGetNext

#define saLlistIOGetNext (   pList,
  pLink 
)
Value:
(((pLink)->pNext == (pList)->pHead) ? \
agNULL : (pLink)->pNext)

Definition at line 398 of file sallist.h.

◆ saLlistIOInitialize

#define saLlistIOInitialize (   pList)
Value:
{(pList)->pHead = &((pList)->Head); \
(pList)->pHead->pNext = (pList)->pHead; \
(pList)->pHead->pPrev = (pList)->pHead; \
(pList)->Count = 0; \
}

Definition at line 105 of file sallist.h.

◆ saLlistIORemove

#define saLlistIORemove (   pList,
  pLink 
)
Value:
{ \
(pLink)->pPrev->pNext = (pLink)->pNext; \
(pLink)->pNext->pPrev = (pLink)->pPrev; \
(pLink)->pHead = agNULL; \
(pList)->Count --; \
}

Definition at line 275 of file sallist.h.

◆ saLlistRemove

#define saLlistRemove (   pList,
  pLink 
)
Value:
{ \
(pLink)->pPrev->pNext = (pLink)->pNext; \
(pLink)->pNext->pPrev = (pLink)->pPrev; \
(pLink)->pHead = agNULL; \
(pList)->Count --; \
}

saLlistRemove macro

use to remove the link from the list

Definition at line 268 of file sallist.h.

Typedef Documentation

◆ PSALINK

typedef struct _SALINK * PSALINK

◆ PSALINK_LIST

typedef struct _SALINK_LIST * PSALINK_LIST

◆ SALINK

typedef struct _SALINK SALINK

Structure of Link Data.

link data, need to be included at the start (offset 0) of any structures that are to be stored in the link list

◆ SALINK_LIST

typedef struct _SALINK_LIST SALINK_LIST

Structure of Link List.

link list basic pointers