reman3/Rayman_X/cpa/tempgrp/NET/NetList2.h

99 lines
2.6 KiB
C

/*
NetList2.h : List management
*/
#if !defined(__NETLIST2_TYPES__)
#define __NETLIST2_TYPES__
#if !defined(ONLY_TYPES)
#define NETLIST2_UNDEF
#define ONLY_TYPES
#endif /* !ONLY_TYPES */
#if defined(NETLIST2_UNDEF)
#undef ONLY_TYPES
#undef NETLIST2_UNDEF
#endif /* !NETLIST2_UNDEF */
typedef struct stNetList2Cell
{
struct stNetList2Cell *pNext; /* Next cellule.*/
struct stNetList2Cell *pPrev; /* Previous cellule.*/
unsigned ulSize; /* Size of element.*/
}tdstNetList2Cell;
typedef struct stNetList2
{
tdstNetList2Cell *pFirstCell; /* First cellule.*/
tdstNetList2Cell *pLastCell; /* Last cellule.*/
unsigned long ulNbrElem; /* Number of element.*/
}tdstNetList2;
typedef struct stNetIter
{
tdstNetList2 *pList; /* Adress of the list.*/
tdstNetList2Cell *pCurCell; /* Current cellule.*/
unsigned long ulCurPos; /* Current position.*/
}tdstNetIter;
#endif /* !__NETLIST2_TYPES__ */
#if !defined(ONLY_TYPES)
#if !defined(__NETLIST2_VARS__)
#define __NETLIST2_VARS__
#undef EXTERN
#undef extern
#if !defined(GLOBALS)
#define EXTERN extern
#else /* !GLOBALS */
#define EXTERN
#endif /* !GLOBALS */
/*
* variables of the above types are here. declarations with initialization
* are of the form:
*
* <type> <variable name>
* #if defined(GLOBALS)
* = <initial values>
* #endif
* ;
*/
#endif /* !__NETLIST2_VARS__ */
#if !defined (__NETLIST2_PROTOS__)
#define __NETLIST2_PROTOS__
/*
* put here the prototypes of the handler functions for the object
*/
int iNetList2Init(tdstNetList2 *pList);
void *pNetList2IterInit(tdstNetIter *pIter,tdstNetList2 *pList);
void *pNetList2ReservElem(tdstNetIter *pIter,unsigned long ulSize);
void *pNetList2InsertElem(tdstNetIter *pIter,void *pElem,unsigned long ulSize);
void *pNetList2PeekElem(tdstNetIter *pIter);
void *pNetList2DeleteElem(tdstNetIter *pIter);
void *pNetList2Next(tdstNetIter *pIter);
void *pNetList2Prev(tdstNetIter *pIter);
int iNetList2IsFirst(tdstNetIter *pIter);
int iNetList2IsEnd(tdstNetIter *pIter);
int iNetList2IsLast(tdstNetIter *pIter);
void *pNetList2ToFirst(tdstNetIter *pIter);
void vNetList2ToEnd(tdstNetIter *pIter);
void *pNetList2ToLast(tdstNetIter *pIter);
unsigned long ulNetList2NbrElem(tdstNetList2 *pList);
unsigned long ulNetList2NbrElemIter(tdstNetIter *pIter);
unsigned long ulNetList2PosIter(tdstNetIter *pIter);
void *pNetList2SetPos(tdstNetIter *pIter,unsigned long ulPos);
void vNetList2Clear(tdstNetIter *pIter);
void vNetList2Kill(tdstNetList2 *pList);
#endif /* !__NETLIST2_PROTOS__ */
#endif /* !ONLY_TYPES */