vlist.h File Reference


Detailed Description

A documented header file containing the vlist.

Definition in file vlist.h.

#include <stdlib.h>

Go to the source code of this file.

Classes

struct  vlist_node_s
struct  vlist_s

Defines

#define VLIST_CDECL
#define _W3DTK_API
#define V_POINTER_SIZED_INT   unsigned long
#define VLIST_RESET_CURSOR(XL)
#define VLIST_PEEK_CURSOR(XL)   ((!(XL)->cursor)?0:(XL)->cursor->item)
#define VLIST_ADVANCE_CURSOR(XL)
#define LIST_REMOVE_AND_CONTINUE_ITERATION(XL)
#define START_LIST_ITERATION(TYPE, LIST)
#define END_LIST_ITERATION(LIST)   VLIST_ADVANCE_CURSOR(LIST); }

Typedefs

typedef vlist_node_s vlist_node_t

Functions

_W3DTK_API vlist_tnew_vlist (void *(VLIST_CDECL *vlist_malloc)(size_t), void(VLIST_CDECL *vlist_free)(void *))
 This function creates and initalises a vlist structure.
_W3DTK_API void delete_vlist (vlist_t *vlist)
 This function destroys and cleans up a vlist structure.
_W3DTK_API void vlist_add_first (vlist_t *vlist, void *item)
 This function adds an item to the head of a vlist structure.
_W3DTK_API void vlist_add_last (vlist_t *vlist, void *item)
 This function adds an item to the tail of a vlist structure.
_W3DTK_API void vlist_add_before_cursor (vlist_t *vlist, void *item)
 This function adds an item before the cursor of a vlist structure.
_W3DTK_API void vlist_add_after_cursor (vlist_t *vlist, void *item)
 This function adds an item after the cursor to the vlist structure.
_W3DTK_API int vlist_remove (vlist_t *vlist, void *item)
 This function removes an item from the vlist structure.
_W3DTK_API void * vlist_remove_first (vlist_t *vlist)
 This function removes the first item from the vlist structure.
_W3DTK_API void * vlist_remove_cursor_next (vlist_t *vlist)
 This function removes the next item after the cursor from the vlist structure.
_W3DTK_API void * vlist_remove_at_cursor (vlist_t *vlist)
 This function removes the item at the cursor from the vlist structure.
_W3DTK_API void vlist_reset_cursor (vlist_t *vlist)
 This function moves the cursor to the front of the vlist structure.
_W3DTK_API void * vlist_peek_cursor (vlist_t *vlist)
 This function returns item at the cursor but doesn't remove it.
_W3DTK_API void * vlist_peek_cursor_next (vlist_t *vlist)
 This function returns next item after the cursor but doesn't remove it.
_W3DTK_API void * vlist_peek_cursor_next_next (vlist_t *vlist)
 This function returns next item's next after the cursor but doesn't remove it.
_W3DTK_API void vlist_advance_cursor (vlist_t *vlist)
 This function moves the cursor to the next postition in the vlist structure.
_W3DTK_API void * vlist_peek_first (vlist_t *vlist)
 This function returns first item on the vlist but doesn't remove it.
_W3DTK_API void * vlist_peek_last (vlist_t *vlist)
 This function returns last item on the vlist but doesn't remove it.
_W3DTK_API unsigned long vlist_count (vlist_t *vlist)
 This function returns number of items in the vlist.
_W3DTK_API int vlist_item_exists (vlist_t *vlist, void *item)
 This function checks the existence of a item in the vlist.
_W3DTK_API void vlist_items_to_array (vlist_t *vlist, void **items)
 This function writes the items in the vlist into a array doesn't change the list .
_W3DTK_API void vlist_map_function (vlist_t *vlist, void(*function)(void *, void *), void *user_data)
 This function calls a function once for each item in the vlist.
_W3DTK_API void * vlist_nth_item (vlist_t *vlist, unsigned long index)
 This function peeks at the nth item in the vlist.
_W3DTK_API void vlist_reverse (vlist_t *vlist)
 This function reverses the items in the vlist.
_W3DTK_API void vlist_flush (vlist_t *vlist)
 This function wipes out all items in the list.


Typedef Documentation

typedef struct vlist_node_s vlist_node_t
 

The vlist is single linked list that stores void pointers. It has a cursor to traverse the list.


Function Documentation

_W3DTK_API void delete_vlist vlist_t vlist  ) 
 

This function destroys and cleans up a vlist structure.

Parameters:
vlist The list to delete

_W3DTK_API vlist_t* new_vlist void *  (VLIST_CDECL *vlist_malloc)(size_t),
void(VLIST_CDECL *vlist_free)(void *) 
 

This function creates and initalises a vlist structure.

Parameters:
VHASH_CDECL* vlist_malloc A malloc function for vlist to use
VHASH_CDECL *vlist_free A free function for vlist to use
Returns:
The vlist structure

_W3DTK_API void vlist_add_after_cursor vlist_t vlist,
void *  item
 

This function adds an item after the cursor to the vlist structure.

Parameters:
vlist The list operate on
item A void pointer to store

_W3DTK_API void vlist_add_before_cursor vlist_t vlist,
void *  item
 

This function adds an item before the cursor of a vlist structure.

Parameters:
vlist The list operate on
item A void pointer to store

_W3DTK_API void vlist_add_first vlist_t vlist,
void *  item
 

This function adds an item to the head of a vlist structure.

Parameters:
vlist The list operate on
item A void pointer to store

_W3DTK_API void vlist_add_last vlist_t vlist,
void *  item
 

This function adds an item to the tail of a vlist structure.

Parameters:
vlist The list operate on
item A void pointer to store

_W3DTK_API void vlist_advance_cursor vlist_t vlist  ) 
 

This function moves the cursor to the next postition in the vlist structure.

Parameters:
vlist The list operate on

_W3DTK_API unsigned long vlist_count vlist_t vlist  ) 
 

This function returns number of items in the vlist.

Parameters:
vlist The list operate on
Returns:
Number of items in the list.

_W3DTK_API void vlist_flush vlist_t vlist  ) 
 

This function wipes out all items in the list.

Parameters:
vlist The list operate on

_W3DTK_API int vlist_item_exists vlist_t vlist,
void *  item
 

This function checks the existence of a item in the vlist.

Parameters:
vlist The list operate on
item A void pointer look for
Returns:
0 if item not found ~0 if found

_W3DTK_API void vlist_items_to_array vlist_t vlist,
void **  items
 

This function writes the items in the vlist into a array doesn't change the list .

Parameters:
vlist The list operate on
items An array of void pointers the size of number of items in the list

_W3DTK_API void vlist_map_function vlist_t vlist,
void(*)(void *, void *)  function,
void *  user_data
 

This function calls a function once for each item in the vlist.

Parameters:
vlist The list operate on
function A pointer to a function taking an item and user data.
user_data A pointer passed with each function call.

_W3DTK_API void* vlist_nth_item vlist_t vlist,
unsigned long  index
 

This function peeks at the nth item in the vlist.

Parameters:
vlist The list operate on
index A 0 based index into the vlist
Returns:
0 if no such item exists else the item

_W3DTK_API void* vlist_peek_cursor vlist_t vlist  ) 
 

This function returns item at the cursor but doesn't remove it.

Parameters:
vlist The list operate on
Returns:
0 if no such item exists else the item

_W3DTK_API void* vlist_peek_cursor_next vlist_t vlist  ) 
 

This function returns next item after the cursor but doesn't remove it.

Parameters:
vlist The list operate on
Returns:
0 if no such item exists else the item

_W3DTK_API void* vlist_peek_cursor_next_next vlist_t vlist  ) 
 

This function returns next item's next after the cursor but doesn't remove it.

Parameters:
vlist The list operate on
Returns:
0 if no such item exists else the item

_W3DTK_API void* vlist_peek_first vlist_t vlist  ) 
 

This function returns first item on the vlist but doesn't remove it.

Parameters:
vlist The list operate on
Returns:
0 if no such item exists else the item

_W3DTK_API void* vlist_peek_last vlist_t vlist  ) 
 

This function returns last item on the vlist but doesn't remove it.

Parameters:
vlist The list operate on
Returns:
0 if no such item exists else the item

_W3DTK_API int vlist_remove vlist_t vlist,
void *  item
 

This function removes an item from the vlist structure.

Parameters:
vlist The list operate on
item A void pointer to remove from the list
Returns:
0 if item not found ~0 if found

_W3DTK_API void* vlist_remove_at_cursor vlist_t vlist  ) 
 

This function removes the item at the cursor from the vlist structure.

Parameters:
vlist The list operate on
Returns:
0 if no such item exists else the item

_W3DTK_API void* vlist_remove_cursor_next vlist_t vlist  ) 
 

This function removes the next item after the cursor from the vlist structure.

Parameters:
vlist The list operate on
Returns:
0 if no such item exists else the item

_W3DTK_API void* vlist_remove_first vlist_t vlist  ) 
 

This function removes the first item from the vlist structure.

Parameters:
vlist The list operate on
Returns:
0 if vlist is empty or first item pointer

_W3DTK_API void vlist_reset_cursor vlist_t vlist  ) 
 

This function moves the cursor to the front of the vlist structure.

Parameters:
vlist The list operate on

_W3DTK_API void vlist_reverse vlist_t vlist  ) 
 

This function reverses the items in the vlist.

Parameters:
vlist The list operate on


Generated on Tue Jan 6 22:41:37 2009 for Autodesk DWF 3D Toolkit by  doxygen 1.4.5