diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
commit | 4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53 (patch) | |
tree | 54fd1b2695a591d2306d41264df67c53077b752c /adb/shlist.h | |
download | core-4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53.tar.gz core-4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53.tar.bz2 core-4f6e8d7a00cbeda1e70cc15be9c4af1018bdad53.zip |
Initial Contribution
Diffstat (limited to 'adb/shlist.h')
-rwxr-xr-x | adb/shlist.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/adb/shlist.h b/adb/shlist.h new file mode 100755 index 000000000..0a9b07b27 --- /dev/null +++ b/adb/shlist.h @@ -0,0 +1,34 @@ +/*-------------------------------------------------------------------*/ +/* List Functionality */ +/*-------------------------------------------------------------------*/ +#ifndef _SHLIST_H_ +#define _SHLIST_H_ + +typedef struct SHLIST_STRUC { + void *data; + struct SHLIST_STRUC *next; + struct SHLIST_STRUC *prev; +} SHLIST; + +typedef int (*shListCmp)( void *valo, void *valn, void *etalon ); +typedef int (*shListPrint)( void *val ); +typedef void (*shListFree)( void *val ); +typedef int (*shListEqual)( void *val, void *idata ); + +void shListInitList( SHLIST *listPtr ); +SHLIST *shListFindItem( SHLIST *head, void *val, shListEqual func ); +SHLIST *shListGetFirstItem( SHLIST *head ); +SHLIST *shListGetNItem( SHLIST *head, unsigned long num ); +SHLIST *shListGetLastItem( SHLIST *head ); +SHLIST *shListGetNextItem( SHLIST *head, SHLIST *item ); +SHLIST *shListGetPrevItem( SHLIST *head, SHLIST *item ); +void shListDelItem( SHLIST *head, SHLIST *item, shListFree func ); +void shListInsFirstItem( SHLIST *head, void *val ); +void shListInsBeforeItem( SHLIST *head, void *val, void *etalon, + shListCmp func ); +void shListInsLastItem( SHLIST *head, void *val ); +void shListDelAllItems( SHLIST *head, shListFree func ); +void shListPrintAllItems( SHLIST *head, shListPrint func ); +unsigned long shListGetCount( SHLIST *head ); + +#endif |