# lists.h

Go to the documentation of this file.

    00001 #define IN
    00002 #define STATUS_FAILURE -1
    00003 #define STATUS_SUCCESS 0
    00004
    00005 typedef struct _item_t Item_t;
    00006 typedef struct _list_t List_t;
    00007 struct _item_t
    00008 {
    00009         Item_t          *Previous;
    00010         Item_t          *Next;
    00011         void            *data;
    00012 };
    00013
    00014 struct _list_t
    00015 {
    00016         Item_t  *First;
    00017         Item_t  *Last;
    00018 };
    00019
    00020 List_t *
    00021 InitializeList();
    00022 Item_t *
    00023 CreateItem();
    00024 int
    00025 InsertItemAtFront(      IN List_t * TList,
    00026                         IN Item_t * kItem);
    00027 int
    00028 InsertItemBetweenItems( IN List_t * TList,
    00029                                 IN Item_t * Previous,
    00030                                 IN Item_t * Next,
    00031                                 IN Item_t * Insert);
    00032 int
    00033 RemoveItem(     IN List_t *     TList,
    00034                 IN Item_t *     kItem);
    00035 int
    00036 DestroyItemsInList(IN List_t * ItemList);
    00037 int
    00038 DestroyItemList(IN List_t * ItemList);
    00039 Item_t *
    00040 GetFirstItem(IN List_t * kItem);
    00041
    00042 Item_t *
    00043 GetLastItem(IN List_t * kItem);
    00044 List_t *
    00045 RemoveItemListBetweenItems(     IN Item_t *     Previous,
    00046                                         IN Item_t *     Next);
    00047
    00048 void
    00049 InsertItemListBetweenItems(     IN Item_t *     Previous,
    00050                                         IN Item_t *     Next,
    00051                                         IN List_t *     Insert);