Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

idliste.h File Reference

#include "idgen.h"
#include "idliste-restricted.h"

Go to the source code of this file.

Data Structures

struct  _elem
struct  PRIVATE_LIST

Defines

#define LST_MODE   0x0f
#define LST_BEG   0x0 /* au debut de la liste */
#define LST_END   0x1 /* a la fin de la liste */
#define LST_ELEM   0x2 /* apres un element */
#define LST_ELEM_AV   0x4 /* AVANT un element */ /*JPR */
#define LST_NEXT   0x10 /* au champ Pred de l'element */
#define LST_PRED
#define LST_BIDIR   0x40 /* liste bidirect. */
#define _IdLstPrivate(lst)   (((PRIVATE_LIST*)(lst))-1)
#define IdLstNumero(lst)   (_IdLstPrivate(lst)->Numero)
#define IdLstMessage(lst)   (_IdLstPrivate(lst)->_message)
#define IdLstFichier(lst)   (_IdLstPrivate(lst)->_fichier)
#define IdLstNbElems(l)   ( _IdLstPrivate(l)->NbElems)
#define IdLstNbObjects(l)   ( _IdLstPrivate(l)->NbElems)
#define IdLstType(l)   ( _IdLstPrivate(l)->Type)
#define IdLstGetTypeObj(el)   ( (el)->TypeElem)
#define IdLstSetTypeObj(el, type)   ( (el)->TypeElem) = (type)
#define IdLstFirst(l)   ( _IdLstPrivate(l)->First)
#define IdLstList(l)   ( _IdLstPrivate(l)->First)
#define IdLstLast(l)   ( _IdLstPrivate(l)->Last)
#define IdLstNext(el)   ( ((el) )->Next)
#define IdLstPrevious(el)   ( ((el) )->Pred)
#define IdLstPtrObj(el)   ( ((el))->Object)
#define IdLstAddFirst(list, obj)   IdLstAddElement((list),((void *)obj),LST_BEG|LST_BIDIR,NULL)
#define IdLstAddLast(list, obj)   IdLstAddElement((list),((void *)obj),LST_END|LST_BIDIR,NULL)
#define IdLstFree(l)   _IdLstFree( (PLIST*)&(l) )
#define IdLstDestroyNoControl(l, f)   _IdLstDestroyNoControl( (PLIST*)&(l),(f) )
#define IdLstFindElemObj(a, b, c)   IdLstFindElem( (a),(b),(c) )
#define IdLstAddAfter(list, obj, el)   IdLstAddElement((list),((void *)obj),LST_ELEM|LST_BIDIR,(el) )
#define IdLstAddBefore(list, obj, el)   IdLstAddElement((list),((void *)obj),LST_ELEM_AV|LST_BIDIR,(el) )

Typedefs

typedef _elem LIST_ELEMENT
typedef LIST_ELEMENTPLIST_ELEMENT
typedef PLIST_ELEMENT PLIST
typedef PLIST_ELEMENTPPLIST
typedef int(* INT_FUNCTION_PLISTELEMENT_VOIDP_POINTER )(PLIST_ELEMENT, void *)

Functions

void IdLstClear (PLIST lst)
 Deletion of the elements of a list BUT not the OBJECTS it refers to.

PLIST IdLstCopy (PLIST lst)
 Duplication of a list AND it's elements BUT NOT the refered objects.

PLIST IdLstAlloc (void)
 Allocation of a list.

PLIST_ELEMENT IdLstSearchElemObj (PLIST, void *)
 Get an element from a list.

PLIST_ELEMENT IdLstFindElem (PLIST, INT_FUNCTION_PLISTELEMENT_VOIDP_POINTER, void *)
void IdLstDestroyElemNoControl (PLIST, PLIST_ELEMENT, VOID_FUNCTION_VOIDP_POINTER)
 Deletion of an element of a list AND the refering object.

int IdLstRemoveFirst (PLIST)
 Suppression of the first element of a bidirectional list.

int IdLstRemoveLast (PLIST)
 Suppression of the last element of a bidirectional list.

int IdLstRemoveElem (PLIST, PLIST_ELEMENT)
 Suppression of an element of a bidirectional list.


Define Documentation

#define _IdLstPrivate lst   )     (((PRIVATE_LIST*)(lst))-1)
 

Definition at line 89 of file idliste.h.

Referenced by _IdLstFree(), IdLstAddElement(), IdLstRemoveElem(), IdLstRemoveFirst(), IdLstRemoveLast(), LstAddAfter(), and LstAddBefore().

#define IdLstAddAfter list,
obj,
el   )     IdLstAddElement((list),((void *)obj),LST_ELEM|LST_BIDIR,(el) )
 

Definition at line 474 of file idliste.h.

#define IdLstAddBefore list,
obj,
el   )     IdLstAddElement((list),((void *)obj),LST_ELEM_AV|LST_BIDIR,(el) )
 

Definition at line 477 of file idliste.h.

#define IdLstAddFirst list,
obj   )     IdLstAddElement((list),((void *)obj),LST_BEG|LST_BIDIR,NULL)
 

Definition at line 127 of file idliste.h.

Referenced by LstAddBefore().

#define IdLstAddLast list,
obj   )     IdLstAddElement((list),((void *)obj),LST_END|LST_BIDIR,NULL)
 

Definition at line 129 of file idliste.h.

Referenced by IdDcmGetHeader(), IdDcmGetHeaderLeonardo(), IdLstCopy(), and LstAddAfter().

#define IdLstDestroyNoControl l,
 )     _IdLstDestroyNoControl( (PLIST*)&(l),(f) )
 

Definition at line 442 of file idliste.h.

#define IdLstFichier lst   )     (_IdLstPrivate(lst)->_fichier)
 

Definition at line 97 of file idliste.h.

#define IdLstFindElemObj a,
b,
 )     IdLstFindElem( (a),(b),(c) )
 

Definition at line 463 of file idliste.h.

#define IdLstFirst  )     ( _IdLstPrivate(l)->First)
 

Definition at line 118 of file idliste.h.

Referenced by _IdDcmGetElementLength(), _IdDcmReadElement(), _IdDcmReadElementNoSQ(), _IdDcmReadElementUSHORT(), _IdLstDestroyNoControl(), IdDcmAffDcmHdr(), IdDcmGetHeader(), IdLstAddElement(), IdLstClear(), IdLstCopy(), IdLstFindElem(), IdLstRemoveFirst(), IdLstRemoveLast(), IdLstSearchElemObj(), and LstAddBefore().

#define IdLstFree  )     _IdLstFree( (PLIST*)&(l) )
 

Definition at line 441 of file idliste.h.

Referenced by IdDcmHdrFree().

#define IdLstGetTypeObj el   )     ( (el)->TypeElem)
 

Definition at line 116 of file idliste.h.

#define IdLstLast  )     ( _IdLstPrivate(l)->Last)
 

Definition at line 122 of file idliste.h.

Referenced by IdLstAddElement(), IdLstRemoveFirst(), IdLstRemoveLast(), and LstAddAfter().

#define IdLstList  )     ( _IdLstPrivate(l)->First)
 

Definition at line 119 of file idliste.h.

Referenced by _IdLstFree().

#define IdLstMessage lst   )     (_IdLstPrivate(lst)->_message)
 

Definition at line 96 of file idliste.h.

#define IdLstNbElems  )     ( _IdLstPrivate(l)->NbElems)
 

Definition at line 113 of file idliste.h.

Referenced by _IdLstFree(), IdLstAddElement(), IdLstRemoveElem(), IdLstRemoveFirst(), IdLstRemoveLast(), LstAddAfter(), and LstAddBefore().

#define IdLstNbObjects  )     ( _IdLstPrivate(l)->NbElems)
 

Definition at line 114 of file idliste.h.

#define IdLstNext el   )     ( ((el) )->Next)
 

Definition at line 124 of file idliste.h.

Referenced by _IdDcmGetElementLength(), _IdDcmReadElement(), _IdDcmReadElementNoSQ(), _IdDcmReadElementUSHORT(), _IdLstDestroyNoControl(), IdDcmAffDcmHdr(), IdDcmGetHeader(), IdLstClear(), IdLstCopy(), IdLstRemoveElem(), IdLstRemoveFirst(), IdLstRemoveLast(), LstAddAfter(), and LstAddBefore().

#define IdLstNumero lst   )     (_IdLstPrivate(lst)->Numero)
 

Definition at line 95 of file idliste.h.

#define IdLstPrevious el   )     ( ((el) )->Pred)
 

Definition at line 125 of file idliste.h.

Referenced by IdLstRemoveElem(), IdLstRemoveFirst(), IdLstRemoveLast(), LstAddAfter(), and LstAddBefore().

#define IdLstPtrObj el   )     ( ((el))->Object)
 

Definition at line 126 of file idliste.h.

Referenced by _IdDcmGetElementLength(), _IdDcmReadElement(), _IdDcmReadElementNoSQ(), _IdDcmReadElementUSHORT(), _IdLstDestroyNoControl(), IdDcmAffDcmHdr(), IdDcmGetHeader(), IdLstCopy(), and IdLstDestroyElemNoControl().

#define IdLstSetTypeObj el,
type   )     ( (el)->TypeElem) = (type)
 

Definition at line 117 of file idliste.h.

#define IdLstType  )     ( _IdLstPrivate(l)->Type)
 

Definition at line 115 of file idliste.h.

#define LST_BEG   0x0 /* au debut de la liste */
 

Definition at line 48 of file idliste.h.

Referenced by IdLstAddElement().

#define LST_BIDIR   0x40 /* liste bidirect. */
 

Definition at line 59 of file idliste.h.

Referenced by IdLstAddElement().

#define LST_ELEM   0x2 /* apres un element */
 

Definition at line 50 of file idliste.h.

Referenced by IdLstAddElement().

#define LST_ELEM_AV   0x4 /* AVANT un element */ /*JPR */
 

Definition at line 51 of file idliste.h.

Referenced by IdLstAddElement().

#define LST_END   0x1 /* a la fin de la liste */
 

Definition at line 49 of file idliste.h.

Referenced by IdLstAddElement().

#define LST_MODE   0x0f
 

Definition at line 47 of file idliste.h.

#define LST_NEXT   0x10 /* au champ Pred de l'element */
 

Definition at line 56 of file idliste.h.

Referenced by IdLstAddElement().

#define LST_PRED
 

Value:

0x20 /* au champ Next de l'element pour arbre binaire */

Definition at line 57 of file idliste.h.

Referenced by IdLstAddElement().


Typedef Documentation

typedef int(* INT_FUNCTION_PLISTELEMENT_VOIDP_POINTER)(PLIST_ELEMENT, void *)
 

Definition at line 452 of file idliste.h.

typedef struct _elem LIST_ELEMENT
 

typedef PLIST_ELEMENT PLIST
 

Definition at line 78 of file idliste.h.

typedef LIST_ELEMENT* PLIST_ELEMENT
 

Definition at line 76 of file idliste.h.

Referenced by IdLstFindElem().

typedef PLIST_ELEMENT * PPLIST
 

Definition at line 78 of file idliste.h.


Function Documentation

PLIST IdLstAlloc void   ) 
 

Allocation of a list.

Warning:
One should test the returned value before using it...
Returns:
On succes, return a pointeur the first free element of the allocated list. On failure, return 0.

Definition at line 121 of file lstallo.c.

References PRIVATE_LIST::_fichier, PRIVATE_LIST::_message, IdErrPrintf(), LST, and PRIVATE_LIST::Type.

Referenced by IdDcmHdrAlloc().

void IdLstClear PLIST  lst  ) 
 

Deletion of the elements of a list BUT not the OBJECTS it refers to.

Parameters:
lst List from which to delete.
Warning:
If no other reference exists to the pointed object then this creates a memory leak...
Parameters:
lst List to destruct.

Definition at line 231 of file lstallo.c.

References IdLstFirst, IdLstNext, and IdLstRemoveElem().

PLIST IdLstCopy PLIST  lst  ) 
 

Duplication of a list AND it's elements BUT NOT the refered objects.

Parameters:
lst List to duplicate from.
Returns:
Pointeur to the duplicated list.

Definition at line 276 of file lstallo.c.

References PRIVATE_LIST::_fichier, PRIVATE_LIST::_message, IdErrPrintf(), IdLstAddLast, IdLstFirst, IdLstNext, IdLstPtrObj, LST, and PRIVATE_LIST::Type.

void IdLstDestroyElemNoControl PLIST  lst,
PLIST_ELEMENT  elem,
VOID_FUNCTION_VOIDP_POINTER  foncDestr
 

Deletion of an element of a list AND the refering object.

Warning:
If no other reference exists to the pointed object then this creates a memory leak. Also, make sure the given destruction function corresponds to the type of objects that are stored in this list.
Parameters:
lst List from which to delete.
foncDestr Pointer to destruction function of a pointed object.

Definition at line 256 of file lstallo.c.

References IdLstPtrObj, and IdLstRemoveElem().

PLIST_ELEMENT IdLstFindElem PLIST  ,
INT_FUNCTION_PLISTELEMENT_VOIDP_POINTER  ,
void * 
 

int IdLstRemoveElem PLIST  l,
PLIST_ELEMENT  e
 

Suppression of an element of a bidirectional list.

Parameters:
l List from which we suppress the element.
e Element to suppress.
Returns:
1 on success, 0 on failure.

Definition at line 289 of file lstbasic.c.

References _IdLstPrivate, IDERR_EMPTY_LIST, IdErrno, IdLstNbElems, IdLstNext, IdLstPrevious, IdLstRemoveFirst(), and IdLstRemoveLast().

Referenced by IdLstClear(), and IdLstDestroyElemNoControl().

int IdLstRemoveFirst PLIST  l  ) 
 

Suppression of the first element of a bidirectional list.

Parameters:
l List from which we suppress
Returns:
1 on success, 0 on failure.

Definition at line 214 of file lstbasic.c.

References _IdLstPrivate, IDERR_EMPTY_LIST, IdErrno, IdLstFirst, IdLstLast, IdLstNbElems, IdLstNext, and IdLstPrevious.

Referenced by IdLstRemoveElem().

int IdLstRemoveLast PLIST  l  ) 
 

Suppression of the last element of a bidirectional list.

Parameters:
l List from which we suppress
Returns:
1 on success, 0 on failure.

Definition at line 251 of file lstbasic.c.

References _IdLstPrivate, IDERR_EMPTY_LIST, IdErrno, IdLstFirst, IdLstLast, IdLstNbElems, IdLstNext, and IdLstPrevious.

Referenced by IdLstRemoveElem().

PLIST_ELEMENT IdLstSearchElemObj PLIST  pl,
void *  obj
 

Get an element from a list.

Parameters:
pl List among which to search.
obj Object corresponding to the element that we search.
Returns:
On succes, return a pointeur to the searched element among list. On failure, return 0.

Definition at line 147 of file lstallo.c.

References IdLstFirst, _elem::Next, and _elem::Object.


Generated on Wed Oct 19 09:28:36 2005 for SIMRI3D by doxygen 1.3.7