Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

simplelist.h File Reference

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

Go to the source code of this file.

Data Structures

struct  SimpleList
 This is the simle array-like list Sorry for the barbarous implementation, but as long as this simple list is considered temporary. More...

Defines

#define STORAGE_TYPE   extern
 This file represents one of the implementations of the Statement List It shold not be included directly.

Typedefs

typedef void(* element_free_func )(void *)
 Cleaning function.

Functions

STORAGE_TYPE int append_element (SimpleList *list, void *elt)
 Appends a new element to the list.
STORAGE_TYPE int clear_list (SimpleList *list)
 Clears the list.
STORAGE_TYPE int delete_list (SimpleList *list)
 Clears and removes the list itself.
STORAGE_TYPE void * get_element (SimpleList *list, int index)
 Returns the element with given index.
STORAGE_TYPE int list_extend (SimpleList *list, SimpleList *addin, int flag)
 Extends the first list with the elements from the second one.
STORAGE_TYPE void * list_iterator (SimpleList *list)
 Creates a new iterator over the list.
STORAGE_TYPE void * list_next (SimpleList *list)
 Iterates over a list.
STORAGE_TYPE SimpleListnew_list ()
 Creates a new list.
STORAGE_TYPE SimpleListnew_list_with_destructor (element_free_func free_element)
 Creates a new list with given element destructor.
STORAGE_TYPE void * pop_element (SimpleList *list, int index)
 Withdraws and elmenent from the list.
STORAGE_TYPE void remove_element (SimpleList *list, int index)
 Removes an element from the list.


Define Documentation

#define STORAGE_TYPE   extern
 

This file represents one of the implementations of the Statement List It shold not be included directly.


Typedef Documentation

typedef void(* element_free_func)(void *)
 

Cleaning function.

This type of function is to be passed to constructor


Function Documentation

STORAGE_TYPE int append_element SimpleList list,
void *  elt
 

Appends a new element to the list.

  • list -- a list pointer
  • elt -- an element pointer
Returns:
the total size of the list

STORAGE_TYPE int clear_list SimpleList list  ) 
 

Clears the list.

STORAGE_TYPE int delete_list SimpleList list  ) 
 

Clears and removes the list itself.

STORAGE_TYPE void* get_element SimpleList list,
int  index
 

Returns the element with given index.

  • list -- a list pointer
  • index -- the element index
    Returns:
    a pointer to the element with given index

STORAGE_TYPE int list_extend SimpleList list,
SimpleList addin,
int  flag
 

Extends the first list with the elements from the second one.

  • flag -- if true, clears the second list.

STORAGE_TYPE void* list_iterator SimpleList list  ) 
 

Creates a new iterator over the list.

STORAGE_TYPE void* list_next SimpleList list  ) 
 

Iterates over a list.

 for ( s = list_iterator(lst); s != NULL; s = list_next(lst) ) {
 \\ do smth with element
 }

STORAGE_TYPE SimpleList* new_list  ) 
 

Creates a new list.

Returns:
a pointer to the list created.

STORAGE_TYPE SimpleList* new_list_with_destructor element_free_func  free_element  ) 
 

Creates a new list with given element destructor.

Returns:
a pointer to the list created.

STORAGE_TYPE void* pop_element SimpleList list,
int  index
 

Withdraws and elmenent from the list.

  • list -- a list pointer
  • index -- the element index
    Returns:
    a pointer to the element withdrawn.

STORAGE_TYPE void remove_element SimpleList list,
int  index
 

Removes an element from the list.


Generated on Wed Dec 27 16:52:25 2006 for VRB Online Server by  doxygen 1.4.4