/home/dko/Projects/mobilec/src/mc_list/list.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include "../include/macros.h"
#include "../include/rwlock.h"

Go to the source code of this file.

Data Structures

struct  listNode_s
struct  list_s

Typedefs

typedef int(* ListSearchFunc_t )(const void *key, void *element)
typedef void *(* ListElemCopyFunc_t )(const void *src)
typedef int(* ListElemDestroyFunc_t )(void *elem)
typedef int(* ListElemGenericFunc_t )(void *elem)
typedef struct listNode_s listNode_t
typedef listNode_tlistNode_p
typedef struct list_s list_t
typedef list_tlist_p

Functions

list_p ListInitialize (void)
void ListTerminate (list_p list)
void ListClearCB (list_p list, ListElemDestroyFunc_t cb)
int ListGetSize (list_p list)
int ListAdd (list_p list, void *data)
int ListAppend (list_p list, void *data)
int ListInsert (list_p list, void *data, const int index)
list_p ListCopy (list_p list, void *(*data_copy_callback)(const void *data))
void * ListGetHead (list_p list)
void * ListPop (list_p list)
void * ListSearch (list_p list, const int index)
void * ListDelete (list_p list, const int index)
void * ListSearchCB (list_p list, const void *key, ListSearchFunc_t cb)
void * ListDeleteCB (list_p list, const void *key, ListSearchFunc_t cb)
void ListWait (list_p list)
int ListForEachCB (list_p list, ListElemGenericFunc_t cb)
void ListRDLock (list_p list)
void ListRDUnlock (list_p list)
void ListWRLock (list_p list)
void ListWRUnlock (list_p list)
void ListWRWait (list_p list)
void ListRDWait (list_p list)
void ListRDtoWR (list_p list)
void ListWRtoRD (list_p list)

Typedef Documentation

typedef list_t* list_p

Definition at line 58 of file list.h.

typedef struct list_s list_t
typedef void*(* ListElemCopyFunc_t)(const void *src)

Definition at line 36 of file list.h.

typedef int(* ListElemDestroyFunc_t)(void *elem)

Definition at line 37 of file list.h.

typedef int(* ListElemGenericFunc_t)(void *elem)

Definition at line 38 of file list.h.

Definition at line 47 of file list.h.

typedef struct listNode_s listNode_t
typedef int(* ListSearchFunc_t)(const void *key, void *element)

Definition at line 35 of file list.h.


Function Documentation

int ListAdd ( list_p  list,
void *  data 
)
int ListAppend ( list_p  list,
void *  data 
)

Definition at line 221 of file list.c.

References list_s::listhead, listNode_s::next, listNode_s::node_data, and list_s::size.

Referenced by ListCopy().

void ListClearCB ( list_p  list,
ListElemDestroyFunc_t  cb 
)
list_p ListCopy ( list_p  list,
void *(*)(const void *data)  data_copy_callback 
)

Definition at line 257 of file list.c.

References ListAppend(), list_s::listhead, ListInitialize(), listNode_s::next, and listNode_s::node_data.

Referenced by agent_task_Copy().

void* ListDelete ( list_p  list,
const int  index 
)
void* ListDeleteCB ( list_p  list,
const void *  key,
ListSearchFunc_t  cb 
)
int ListForEachCB ( list_p  list,
ListElemGenericFunc_t  cb 
)
void* ListGetHead ( list_p  list  ) 

Definition at line 92 of file list.c.

References list_s::listhead, and listNode_s::node_data.

int ListGetSize ( list_p  list  ) 
list_p ListInitialize ( void   ) 
int ListInsert ( list_p  list,
void *  data,
const int  index 
)

Definition at line 249 of file list.c.

void* ListPop ( list_p  list  ) 
void ListRDLock ( list_p  list  ) 
void ListRDtoWR ( list_p  list  ) 
void ListRDUnlock ( list_p  list  ) 
void ListRDWait ( list_p  list  ) 
void* ListSearch ( list_p  list,
const int  index 
)
void* ListSearchCB ( list_p  list,
const void *  key,
ListSearchFunc_t  cb 
)
void ListTerminate ( list_p  list  ) 
void ListWait ( list_p  list  ) 

Definition at line 403 of file list.c.

References list_s::rwlock, and rwlock_rdwait().

void ListWRLock ( list_p  list  ) 
void ListWRtoRD ( list_p  list  ) 
void ListWRUnlock ( list_p  list  ) 
void ListWRWait ( list_p  list  ) 

Definition at line 442 of file list.c.

References COND_WAIT, rwlock_s::lock, rwlock_s::reader_cond, and list_s::rwlock.

Referenced by acc_MessageHandlerThread(), and MC_AclWaitRetrieve().

Generated on Fri Jun 17 16:59:07 2011 for Mobile-C by  doxygen 1.6.3