list.h

00001 /*
00002  * Copyright (c) 2007, Benedikt Sauter <sauter@ixbat.de>
00003  * All rights reserved.
00004  *
00005  * Short descripton of file:
00006  *
00007  *
00008  * Redistribution and use in source and binary forms, with or without 
00009  * modification, are permitted provided that the following conditions 
00010  * are met:
00011  *
00012  *   * Redistributions of source code must retain the above copyright 
00013  *     notice, this list of conditions and the following disclaimer.
00014  *   * Redistributions in binary form must reproduce the above 
00015  *     copyright notice, this list of conditions and the following 
00016  *     disclaimer in the documentation and/or other materials provided 
00017  *     with the distribution.
00018  *   * Neither the name of the FH Augsburg nor the names of its 
00019  *     contributors may be used to endorse or promote products derived 
00020  *     from this software without specific prior written permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00023  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
00024  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
00025  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
00026  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
00027  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
00028  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
00029  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
00030  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
00031  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00032  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033  */
00034 #ifndef _LIST_H_
00035 #define _LIST_H_
00036 
00037 #include <types.h>
00038 
00039 
00040 struct element {
00041         void *data;
00042         struct element *next;
00043 };
00044 
00045 
00046 struct list {
00047         struct element *head;
00048 };
00049 
00050 
00051 struct list *list_create(void);
00052 
00053 u8 list_add_tail(struct list *l, struct element *e);
00054 u8 list_delete_element(struct list *l, struct element *e);
00055 
00056 u8 list_is_element_last(struct list *l, struct element *e);
00057 
00058 struct element *list_find_next_element(struct list *l, struct element *e);
00059 
00060 #endif // _LIST_H_
00061 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated by  doxygen 1.6.3