/*
* Linked lists support
*
* Copyright (C) 2002 Alexandre Julliard
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#ifndef __WINE_SERVER_LIST_H
#define __WINE_SERVER_LIST_H
#ifdef inline
#undef inline
#endif
#define inline __inline
struct list
{
};
/* Define a list like so:
*
* struct gadget
* {
* struct list entry; <-- doesn't have to be the first item in the struct
* int a, b;
* };
*
* static struct list global_gadgets = LIST_INIT( global_gadgets );
*
* or
*
* struct some_global_thing
* {
* struct list gadgets;
* };
*
* list_init( &some_global_thing->gadgets );
*
* Manipulate it like this:
*
* list_add_head( &global_gadgets, &new_gadget->entry );
* list_remove( &new_gadget->entry );
* list_add_after( &some_random_gadget->entry, &new_gadget->entry );
*
* And to iterate over it:
*
* struct gadget *gadget;
* LIST_FOR_EACH_ENTRY( gadget, &global_gadgets, struct gadget, entry )
* {
* ...
* }
*
*/
/* add an element after the specified one */
{
}
/* add an element before the specified one */
{
}
/* add element at the head of the list */
{
}
/* add element at the tail of the list */
{
}
/* remove an element from its list */
{
}
/* get the next element */
{
return ret;
}
/* get the previous element */
{
return ret;
}
/* get the first element */
{
}
/* get the last element */
{
}
/* check if a list is empty */
{
}
/* initialize a list */
{
}
/* count the elements of a list */
{
unsigned count = 0;
return count;
}
/* move all elements from src to the tail of dst */
{
if (list_empty(src)) return;
}
/* move all elements from src to the head of dst */
{
if (list_empty(src)) return;
}
/* iterate through the list */
/* iterate through the list, with safety against removal */
/* iterate through the list using a list entry */
/* iterate through the list using a list entry, with safety against removal */
/* iterate through the list in reverse order */
/* iterate through the list in reverse order, with safety against removal */
/* iterate through the list in reverse order using a list entry */
/* iterate through the list in reverse order using a list entry, with safety against removal */
/* macros for statically initialized lists */
/* get pointer to object containing list element */
#endif /* __WINE_SERVER_LIST_H */