00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef DBUS_LIST_H
00025 #define DBUS_LIST_H
00026
00027 #include <dbus/dbus-internals.h>
00028 #include <dbus/dbus-memory.h>
00029 #include <dbus/dbus-types.h>
00030 #include <dbus/dbus-sysdeps.h>
00031
00032 DBUS_BEGIN_DECLS
00033
00034 struct DBusList
00035 {
00036 DBusList *prev;
00037 DBusList *next;
00038 void *data;
00039 };
00040 dbus_bool_t _dbus_list_append (DBusList **list,
00041 void *data);
00042 dbus_bool_t _dbus_list_prepend (DBusList **list,
00043 void *data);
00044 dbus_bool_t _dbus_list_insert_before (DBusList **list,
00045 DBusList *before_this_link,
00046 void *data);
00047 dbus_bool_t _dbus_list_insert_after (DBusList **list,
00048 DBusList *after_this_link,
00049 void *data);
00050 void _dbus_list_insert_before_link (DBusList **list,
00051 DBusList *before_this_link,
00052 DBusList *link);
00053 void _dbus_list_insert_after_link (DBusList **list,
00054 DBusList *after_this_link,
00055 DBusList *link);
00056 dbus_bool_t _dbus_list_remove (DBusList **list,
00057 void *data);
00058 dbus_bool_t _dbus_list_remove_last (DBusList **list,
00059 void *data);
00060 void _dbus_list_remove_link (DBusList **list,
00061 DBusList *link);
00062 DBusList* _dbus_list_find_last (DBusList **list,
00063 void *data);
00064 void _dbus_list_clear (DBusList **list);
00065 DBusList* _dbus_list_get_first_link (DBusList **list);
00066 DBusList* _dbus_list_get_last_link (DBusList **list);
00067 void* _dbus_list_get_last (DBusList **list);
00068 void* _dbus_list_get_first (DBusList **list);
00069 void* _dbus_list_pop_first (DBusList **list);
00070 void* _dbus_list_pop_last (DBusList **list);
00071 DBusList* _dbus_list_pop_first_link (DBusList **list);
00072 DBusList* _dbus_list_pop_last_link (DBusList **list);
00073 dbus_bool_t _dbus_list_copy (DBusList **list,
00074 DBusList **dest);
00075 int _dbus_list_get_length (DBusList **list);
00076 DBusList* _dbus_list_alloc_link (void *data);
00077 void _dbus_list_free_link (DBusList *link);
00078 void _dbus_list_unlink (DBusList **list,
00079 DBusList *link);
00080 void _dbus_list_append_link (DBusList **list,
00081 DBusList *link);
00082 void _dbus_list_prepend_link (DBusList **list,
00083 DBusList *link);
00084 dbus_bool_t _dbus_list_length_is_one (DBusList **list);
00085
00086
00087
00088
00089 void _dbus_list_foreach (DBusList **list,
00090 DBusForeachFunction function,
00091 void *data);
00092
00093 #define _dbus_list_get_next_link(list, link) ((link)->next == *(list) ? NULL : (link)->next)
00094 #define _dbus_list_get_prev_link(list, link) ((link) == *(list) ? NULL : (link)->prev)
00095
00096 DBUS_END_DECLS
00097
00098 #endif