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

idliste-restricted.h File Reference

#include "idswig.h"

Go to the source code of this file.

Defines

#define _IdLstTypeElement(e)   ( ((e))->TypeElem)

Functions

void _IdLstFree (PLIST *)
 Destruction of a list.

void _IdLstDestroyNoControl (PLIST *, VOID_FUNCTION_VOIDP_POINTER)
 Destruction of a list AND the OBJECTS it refers to.

void _IdFreeElement (PLIST_ELEMENT, int)
 Destruction of an element of a list.

PLIST_ELEMENT _IdLstAllocElement (void)
 Allocation of an element.

int IdLstAddElement (PLIST, void *pobj, int, PLIST_ELEMENT)
 Manipulation of bidirect lists or binary trees (creation, registering...).

int LstAddAfter (PLIST l, void *pobj, PLIST_ELEMENT e)
 Creation of an element and insertion-AFTER a given element-inside a bidirectional * list.

int LstAddBefore (PLIST l, void *pobj, PLIST_ELEMENT e)
 Creation of an element and insertion-BEFORE a given element-inside a bidirectional * list.


Define Documentation

#define _IdLstTypeElement  )     ( ((e))->TypeElem)
 

Definition at line 51 of file idliste-restricted.h.


Function Documentation

void _IdFreeElement PLIST_ELEMENT  p,
int  d
 

Destruction of an element of a list.

Warning:
Destruction only works for LINKED lists. Binary trees should be destructed by hand...
Parameters:
p List from which the element is desctructed
d Code targeted for destruction of binary trees (UNUSED)

Definition at line 54 of file lstallo.c.

References d, _elem::Next, and _elem::Pred.

Referenced by _IdLstFree().

PLIST_ELEMENT _IdLstAllocElement void   ) 
 

Allocation of an element.

Returns:
Allocated element

Definition at line 103 of file lstallo.c.

References IdErrPrintf().

void _IdLstDestroyNoControl PLIST lst,
VOID_FUNCTION_VOIDP_POINTER  foncDestr
 

Destruction of a list AND the OBJECTS it refers to.

Warning:
Make sure the given destruction function corresponds to the type of objects that are stored in this list...
Parameters:
lst List to destruct.
foncDestr Pointer to destruction function of a pointed object.

Definition at line 207 of file lstallo.c.

References _IdLstFree(), IdLstFirst, IdLstNext, and IdLstPtrObj.

void _IdLstFree PLIST lst  ) 
 

Destruction of a list.

Parameters:
lst List to desctruct.

Definition at line 70 of file lstallo.c.

References _IdFreeElement(), _IdLstPrivate, IdLstList, IdLstNbElems, _elem::Next, and _elem::Pred.

Referenced by _IdLstDestroyNoControl().

int IdLstAddElement PLIST  list,
void *  obj,
int  mode,
PLIST_ELEMENT  elem
 

Manipulation of bidirect lists or binary trees (creation, registering...).

Creation of a liste and registering of an element. A list can be unary (mono ou bidirectional) or represent binary tree (correponding modes are LST_NEXT et LST_PRED);

Parameters:
list List to add an new element to.
obj Object to add to the list (in the 'Object' field of the list)
mode Modality of registering to the list : LST_BEG | LST_NEXT : liste ou arbre binaire element rajoute en tete de liste par le lien Next. Ajout a la racine, 'ancien arbre' chaine a droite LST_BEG | LST_PRED : liste ou arbre binaire element rajoute en tete de liste par le lien Pred. Ajout a la racine, 'ancien arbre' chaine a gauche LST_END | LST_NEXT : liste ou arbre binaire element rajoute en queue de liste par le lien Next. Ajout a droite sur une feuille LST_END | LST_PRED : liste ou arbre binaire element rajoute en tete de liste par le lien Pred. Ajout a gauche sur une feuille LST_BEG | LST_BIDIR : liste bidirectionnelle element rajoute en tete de liste LST_END | LST_BIDIR : liste bidirectionnelle element rajoute en queue de liste LST_ELEM | LST_PRED : liste ou arbre binaire element rajoute par le champ Pred avant l'element el (param.) de la liste Insertion d'un noeud a gauche LST_ELEM | LST_NEXT : liste ou arbre binaire element rajoute par le champ Next apres l'element el (param.) de la liste Insertion d'un noeud a droite LST_ELEM | LST_BIDIR : liste bidirectionnelle element rajoute apres l'element el (param.) de la liste
elem Element of the list after which we register.
Returns:
1 on success, 0 on failure.

Definition at line 94 of file lstbasic.c.

References _IdLstPrivate, IDERR_ALLOC_ELEM, IDERR_POINTER_IS_NULL, IdErrno, IdLstFirst, IdLstLast, IdLstNbElems, LST_BEG, LST_BIDIR, LST_ELEM, LST_ELEM_AV, LST_END, LST_NEXT, LST_PRED, _elem::Next, _elem::Numero, _elem::Object, and _elem::Pred.

int LstAddAfter PLIST  l,
void *  pobj,
PLIST_ELEMENT  e
 

Creation of an element and insertion-AFTER a given element-inside a bidirectional * list.

Parameters:
l List inside which we insert the new element.
pobj Pointer to object that shall be linked we new element.
e Element AFTER which insertion should occur.
Returns:
1 on success, 0 on failure.

Definition at line 340 of file lstbasic.c.

References _IdLstPrivate, IDERR_ALLOC_ELEM, IdErrno, IdErrPrintf(), IdLstAddLast, IdLstLast, IdLstNbElems, IdLstNext, IdLstPrevious, _elem::Numero, and _elem::Object.

int LstAddBefore PLIST  l,
void *  pobj,
PLIST_ELEMENT  e
 

Creation of an element and insertion-BEFORE a given element-inside a bidirectional * list.

Parameters:
l List inside which we insert the new element.
pobj Pointer to object that shall be linked we new element.
e Element BEFORE which insertion should occur.
Returns:
1 on success, 0 on failure.

Definition at line 378 of file lstbasic.c.

References _IdLstPrivate, IDERR_ALLOC_ELEM, IdErrno, IdErrPrintf(), IdLstAddFirst, IdLstFirst, IdLstNbElems, IdLstNext, IdLstPrevious, _elem::Numero, and _elem::Object.


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