00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __G_QUEUE_H__
00029 #define __G_QUEUE_H__
00030
00031 #include <_ansi.h>
00032 #include <glib/glist.h>
00033
00034 G_BEGIN_DECLS
00035
00036 typedef struct _GQueue GQueue;
00037
00038 struct _GQueue
00039 {
00040 GList *head;
00041 GList *tail;
00042 guint length;
00043 };
00044
00045
00046
00047 IMPORT_C GQueue* g_queue_new (void);
00048 IMPORT_C void g_queue_free (GQueue *queue);
00049 IMPORT_C gboolean g_queue_is_empty (GQueue *queue);
00050 IMPORT_C guint g_queue_get_length (GQueue *queue);
00051 IMPORT_C void g_queue_reverse (GQueue *queue);
00052 IMPORT_C GQueue * g_queue_copy (GQueue *queue);
00053 IMPORT_C void g_queue_foreach (GQueue *queue,
00054 GFunc func,
00055 gpointer user_data);
00056 IMPORT_C GList * g_queue_find (GQueue *queue,
00057 gconstpointer data);
00058 IMPORT_C GList * g_queue_find_custom (GQueue *queue,
00059 gconstpointer data,
00060 GCompareFunc func);
00061 IMPORT_C void g_queue_sort (GQueue *queue,
00062 GCompareDataFunc compare_func,
00063 gpointer user_data);
00064
00065 IMPORT_C void g_queue_push_head (GQueue *queue,
00066 gpointer data);
00067 IMPORT_C void g_queue_push_tail (GQueue *queue,
00068 gpointer data);
00069 IMPORT_C void g_queue_push_nth (GQueue *queue,
00070 gpointer data,
00071 gint n);
00072 IMPORT_C gpointer g_queue_pop_head (GQueue *queue);
00073 IMPORT_C gpointer g_queue_pop_tail (GQueue *queue);
00074 IMPORT_C gpointer g_queue_pop_nth (GQueue *queue,
00075 guint n);
00076 IMPORT_C gpointer g_queue_peek_head (GQueue *queue);
00077 IMPORT_C gpointer g_queue_peek_tail (GQueue *queue);
00078 IMPORT_C gpointer g_queue_peek_nth (GQueue *queue,
00079 guint n);
00080 IMPORT_C gint g_queue_index (GQueue *queue,
00081 gconstpointer data);
00082 IMPORT_C void g_queue_remove (GQueue *queue,
00083 gconstpointer data);
00084 IMPORT_C void g_queue_remove_all (GQueue *queue,
00085 gconstpointer data);
00086 IMPORT_C void g_queue_insert_before (GQueue *queue,
00087 GList *sibling,
00088 gpointer data);
00089 IMPORT_C void g_queue_insert_after (GQueue *queue,
00090 GList *sibling,
00091 gpointer data);
00092 IMPORT_C void g_queue_insert_sorted (GQueue *queue,
00093 gpointer data,
00094 GCompareDataFunc func,
00095 gpointer user_data);
00096
00097 IMPORT_C void g_queue_push_head_link (GQueue *queue,
00098 GList *link_);
00099 IMPORT_C void g_queue_push_tail_link (GQueue *queue,
00100 GList *link_);
00101 IMPORT_C void g_queue_push_nth_link (GQueue *queue,
00102 gint n,
00103 GList *link_);
00104 IMPORT_C GList* g_queue_pop_head_link (GQueue *queue);
00105 IMPORT_C GList* g_queue_pop_tail_link (GQueue *queue);
00106 IMPORT_C GList* g_queue_pop_nth_link (GQueue *queue,
00107 guint n);
00108 IMPORT_C GList* g_queue_peek_head_link (GQueue *queue);
00109 IMPORT_C GList* g_queue_peek_tail_link (GQueue *queue);
00110 IMPORT_C GList* g_queue_peek_nth_link (GQueue *queue,
00111 guint n);
00112 IMPORT_C gint g_queue_link_index (GQueue *queue,
00113 GList *link_);
00114 IMPORT_C void g_queue_unlink (GQueue *queue,
00115 GList *link_);
00116 IMPORT_C void g_queue_delete_link (GQueue *queue,
00117 GList *link_);
00118
00119 G_END_DECLS
00120
00121 #endif