-/* -*- mode: C; c-file-style: "gnu" -*- */
-/* dbus-list.h Generic linked list utility (internal to D-BUS implementation)
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* dbus-list.h Generic linked list utility (internal to D-Bus implementation)
*
- * Copyright (C) 2002 Red Hat, Inc.
+ * Copyright (C) 2002, 2003 Red Hat, Inc.
*
- * Licensed under the Academic Free License version 1.2
+ * Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include <dbus/dbus-internals.h>
#include <dbus/dbus-memory.h>
#include <dbus/dbus-types.h>
+#include <dbus/dbus-sysdeps.h>
-DBUS_BEGIN_DECLS;
-
-typedef struct DBusList DBusList;
+DBUS_BEGIN_DECLS
struct DBusList
{
DBusList *next; /**< Next list node. */
void *data; /**< Data stored at this element. */
};
+dbus_bool_t _dbus_list_append (DBusList **list,
+ void *data);
+dbus_bool_t _dbus_list_prepend (DBusList **list,
+ void *data);
+dbus_bool_t _dbus_list_insert_before (DBusList **list,
+ DBusList *before_this_link,
+ void *data);
+dbus_bool_t _dbus_list_insert_after (DBusList **list,
+ DBusList *after_this_link,
+ void *data);
+void _dbus_list_insert_before_link (DBusList **list,
+ DBusList *before_this_link,
+ DBusList *link);
+void _dbus_list_insert_after_link (DBusList **list,
+ DBusList *after_this_link,
+ DBusList *link);
+dbus_bool_t _dbus_list_remove (DBusList **list,
+ void *data);
+dbus_bool_t _dbus_list_remove_last (DBusList **list,
+ void *data);
+void _dbus_list_remove_link (DBusList **list,
+ DBusList *link);
+DBusList* _dbus_list_find_last (DBusList **list,
+ void *data);
+void _dbus_list_clear (DBusList **list);
+DBusList* _dbus_list_get_first_link (DBusList **list);
+DBusList* _dbus_list_get_last_link (DBusList **list);
+void* _dbus_list_get_last (DBusList **list);
+void* _dbus_list_get_first (DBusList **list);
+void* _dbus_list_pop_first (DBusList **list);
+void* _dbus_list_pop_last (DBusList **list);
+DBusList* _dbus_list_pop_first_link (DBusList **list);
+dbus_bool_t _dbus_list_copy (DBusList **list,
+ DBusList **dest);
+int _dbus_list_get_length (DBusList **list);
+DBusList* _dbus_list_alloc_link (void *data);
+void _dbus_list_free_link (DBusList *link);
+void _dbus_list_unlink (DBusList **list,
+ DBusList *link);
+void _dbus_list_append_link (DBusList **list,
+ DBusList *link);
+void _dbus_list_prepend_link (DBusList **list,
+ DBusList *link);
+dbus_bool_t _dbus_list_length_is_one (DBusList **list);
-dbus_bool_t _dbus_list_append (DBusList **list,
- void *data);
-dbus_bool_t _dbus_list_prepend (DBusList **list,
- void *data);
-dbus_bool_t _dbus_list_insert_before (DBusList **list,
- DBusList *before_this_link,
- void *data);
-dbus_bool_t _dbus_list_insert_after (DBusList **list,
- DBusList *after_this_link,
- void *data);
-dbus_bool_t _dbus_list_remove (DBusList **list,
- void *data);
-dbus_bool_t _dbus_list_remove_last (DBusList **list,
- void *data);
-void _dbus_list_remove_link (DBusList **list,
- DBusList *link);
-void _dbus_list_clear (DBusList **list);
-DBusList* _dbus_list_get_first_link (DBusList **list);
-DBusList* _dbus_list_get_last_link (DBusList **list);
-void* _dbus_list_get_last (DBusList **list);
-void* _dbus_list_get_first (DBusList **list);
-void* _dbus_list_pop_first (DBusList **list);
-void* _dbus_list_pop_last (DBusList **list);
-DBusList* _dbus_list_pop_first_link (DBusList **list);
-dbus_bool_t _dbus_list_copy (DBusList **list,
- DBusList **dest);
-int _dbus_list_get_length (DBusList **list);
-
-DBusList* _dbus_list_alloc_link (void *data);
-void _dbus_list_free_link (DBusList *link);
-void _dbus_list_append_link (DBusList **list,
- DBusList *link);
-void _dbus_list_prepend_link (DBusList **list,
- DBusList *link);
-
-dbus_bool_t _dbus_list_length_is_one (DBusList **list);
void _dbus_list_foreach (DBusList **list,
DBusForeachFunction function,
#define _dbus_list_get_next_link(list, link) ((link)->next == *(list) ? NULL : (link)->next)
#define _dbus_list_get_prev_link(list, link) ((link) == *(list) ? NULL : (link)->prev)
-DBUS_END_DECLS;
+/* if DBUS_ENABLE_STATS */
+void _dbus_list_get_stats (dbus_uint32_t *in_use_p,
+ dbus_uint32_t *in_free_list_p,
+ dbus_uint32_t *allocated_p);
+
+DBUS_END_DECLS
#endif /* DBUS_LIST_H */