INSEE 05.04.2011
Interconnection Nertworks Simulation and Evaluation Environment
Defines | Functions
C:/cygwin/home/Javier/insee/src/list.c File Reference

Implementation of a double linked dinamic list. Used by Execution driven simulation module. More...

#include <stdlib.h>
#include <stdio.h>
#include "list.h"
Include dependency graph for list.c:

Defines

#define TRUE   1
#define FALSE   0

Functions

listElementCreateListElement (void *dataPointer)
void DestroyListElement (listElement *thisElement)
listElementAddBeforeElement (listElement *thisElement, void *dataPointer)
listElementAddAfterElement (listElement *thisElement, void *dataPointer)
listCreateVoidList ()
void DestroyList (list **theList)
void AddFirst (list *thisList, void *pointer)
void AddLast (list *thisList, void *pointer)
void * StartLoop (list *thisList)
void * GetNext (list *thisList)
int IsInList (list *thisList, void *dataPointer)
int IsEmpty (list *thisList)
int ElementsInList (list *thisList)
void RemoveFromList (list *thisList, void *dataPointer)
void PrintList (list *thisList)

Detailed Description

Implementation of a double linked dinamic list. Used by Execution driven simulation module.


Function Documentation

listElement* AddAfterElement ( listElement thisElement,
void *  dataPointer 
)

Adds an element after another one.

Parameters:
thisElementThe element to insert after.
dataPointerThe data of the element to insert.
Returns:
The inserted element.
listElement* AddBeforeElement ( listElement thisElement,
void *  dataPointer 
)

Adds an element before another one.

Parameters:
thisElementThe element to insert before.
dataPointerThe data of the element to insert.
Returns:
The inserted element.
void AddFirst ( list thisList,
void *  pointer 
)

Add an element at the begining of a list.

Parameters:
thisListThe list to insert into.
pointerThe data of the element to insert.
void AddLast ( list thisList,
void *  pointer 
)

Add an element at the end of a list.

Parameters:
thisListThe list to insert into.
pointerThe data of the element to insert.
listElement* CreateListElement ( void *  dataPointer)

Create a element to be inserted in the list.

Parameters:
dataPointerA pointer to the element data.
Returns:
The element.
list* CreateVoidList ( )

Creates an empty list.

Returns:
The empty list.
void DestroyList ( list **  theList)

Destroy a list.

Parameters:
theListThe lñist to destroy.
void DestroyListElement ( listElement thisElement)

Destroy an element.

Parameters:
thisElementThe element to destroy.
int ElementsInList ( list thisList)

Number of elements in the list.

Parameters:
thisListThe list to look in.
Returns:
The number of elements in the list.
void* GetNext ( list thisList)

Get an element of a list.

Parameters:
thisListThe list to get the next element.
Returns:
The element's data.
int IsEmpty ( list thisList)

Assert if list is empty.

Parameters:
thisListThe list to look in.
Returns:
TRUE/FALSE.
int IsInList ( list thisList,
void *  dataPointer 
)

Assert if data is in the list.

Parameters:
thisListThe list to look in.
dataPointerThe data to look for.
Returns:
TRUE/FALSE.
void PrintList ( list thisList)

Print the list.

Parameters:
thisListThe list to print.
void RemoveFromList ( list thisList,
void *  dataPointer 
)

Remove some data from a list.

Parameters:
thisListThe list to look in.
dataPointerThe data to remove.
void* StartLoop ( list thisList)

Start a loop in a list

Parameters:
thisListThe list to loop into.
Returns:
A pointer to the loop.