summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2013-02-22 07:42:49 -0800
committerAnas Nashif <anas.nashif@intel.com>2013-02-22 07:42:49 -0800
commitbc7fcfb262a36bcf1d6a3ed35b2e52a553e3aa80 (patch)
treef3141d9c58e24f0caed0185e3bde1c20fb77bcfe
parent19775dd4829f36b0ffd4ca1241cc5c4b95c80eb4 (diff)
downloadxdelta1-bc7fcfb262a36bcf1d6a3ed35b2e52a553e3aa80.tar.gz
xdelta1-bc7fcfb262a36bcf1d6a3ed35b2e52a553e3aa80.tar.bz2
xdelta1-bc7fcfb262a36bcf1d6a3ed35b2e52a553e3aa80.zip
fixed for building with new glib
-rwxr-xr-xconfigure.in4
-rwxr-xr-xlibedsio/edsio.c133
-rwxr-xr-xlibedsio/edsio.h43
3 files changed, 5 insertions, 175 deletions
diff --git a/configure.in b/configure.in
index 76a71f4..d6b923f 100755
--- a/configure.in
+++ b/configure.in
@@ -71,8 +71,8 @@ AC_PATH_PROGS(EMACS, emacs xemacs, emacs)
top_srcdir_absolute=`cd $srcdir; pwd`
AC_SUBST(top_srcdir_absolute)
-AM_PATH_GLIB(1.2.8,,
- AC_MSG_ERROR(Test for GLIB failed. Download it from ftp://ftp.gtk.org/pub/gtk/v1.2/))
+AM_PATH_GLIB_2_0(,,
+ AC_MSG_ERROR([Test for GLIB failed. Download it from ftp://ftp.gtk.org/pub/glib/]))
dnl AC_CHECK_LIB(z, gzsetparams, */
dnl AC_CHECK_HEADER(zlib.h,, */
diff --git a/libedsio/edsio.c b/libedsio/edsio.c
index 1c445fb..1562a93 100755
--- a/libedsio/edsio.c
+++ b/libedsio/edsio.c
@@ -179,9 +179,9 @@ eventdelivery_event_deliver (GenericEvent* e)
}
}
- while (g_queue_get_size (queued) > 0)
+ while (g_queue_get_length (queued) > 0)
{
- DelayedEvent* de = g_queue_pop (queued);
+ DelayedEvent* de = g_queue_pop_tail (queued);
for (i = 0; i < all_event_watchers->len; i += 1)
{
@@ -211,7 +211,7 @@ eventdelivery_event_deliver (GenericEvent* e)
de->def = def;
de->msg = out->str;
- g_queue_push (queued, de);
+ g_queue_push_head (queued, de);
g_ptr_array_add (free_strings, out);
}
@@ -1481,130 +1481,3 @@ checksum_source_free (SerialSource* fsource)
g_free (source);
}
-
-/* Missing glib stuff
- */
-
-GQueue *
-g_queue_new (void)
-{
- GQueue *q = g_new (GQueue, 1);
-
- q->list = q->list_end = NULL;
- q->list_size = 0;
-
- return q;
-}
-
-
-void
-g_queue_free (GQueue *q)
-{
- if (q)
- {
- if (q->list)
- g_list_free (q->list);
- g_free (q);
- }
-}
-
-
-guint
-g_queue_get_size (GQueue *q)
-{
- return (q == NULL) ? 0 : q->list_size;
-}
-
-
-void
-g_queue_push_front (GQueue *q, gpointer data)
-{
- if (q)
- {
- q->list = g_list_prepend (q->list, data);
-
- if (q->list_end == NULL)
- q->list_end = q->list;
-
- q->list_size++;
- }
-}
-
-
-void
-g_queue_push_back (GQueue *q, gpointer data)
-{
- if (q)
- {
- q->list_end = g_list_append (q->list_end, data);
-
- if (! q->list)
- q->list = q->list_end;
- else
- q->list_end = q->list_end->next;
-
- q->list_size++;
- }
-}
-
-
-gpointer
-g_queue_pop_front (GQueue *q)
-{
- gpointer data = NULL;
-
- if ((q) && (q->list))
- {
- GList *node;
-
- node = q->list;
- data = node->data;
-
- if (! node->next)
- {
- q->list = q->list_end = NULL;
- q->list_size = 0;
- }
- else
- {
- q->list = node->next;
- q->list->prev = NULL;
- q->list_size--;
- }
-
- g_list_free_1 (node);
- }
-
- return data;
-}
-
-
-gpointer
-g_queue_pop_back (GQueue *q)
-{
- gpointer data = NULL;
-
- if ((q) && (q->list))
- {
- GList *node;
-
- node = q->list_end;
- data = node->data;
-
- if (! node->prev)
- {
- q->list = q->list_end = NULL;
- q->list_size = 0;
- }
- else
- {
- q->list_end = node->prev;
- q->list_end->next = NULL;
- q->list_size--;
- }
-
- g_list_free_1 (node);
- }
-
- return data;
-}
diff --git a/libedsio/edsio.h b/libedsio/edsio.h
index daee82d..4f68ca2 100755
--- a/libedsio/edsio.h
+++ b/libedsio/edsio.h
@@ -481,49 +481,6 @@ gboolean edsio_persist_proptest_unset (PropTest *pt, const char* prop_name
#endif
-/* Missing glib stuff
- */
-
-typedef struct _GQueue GQueue;
-
-struct _GQueue
-{
- GList *list;
- GList *list_end;
- guint list_size;
-};
-
-/* Queues
- */
-
-GQueue * g_queue_new (void);
-void g_queue_free (GQueue *q);
-guint g_queue_get_size (GQueue *q);
-void g_queue_push_front (GQueue *q, gpointer data);
-void g_queue_push_back (GQueue *q, gpointer data);
-gpointer g_queue_pop_front (GQueue *q);
-gpointer g_queue_pop_back (GQueue *q);
-
-#define g_queue_empty(queue) \
- ((((GQueue *)(queue)) && ((GQueue *)(queue))->list) ? FALSE : TRUE)
-
-#define g_queue_peek_front(queue) \
- ((((GQueue *)(queue)) && ((GQueue *)(queue))->list) ? \
- ((GQueue *)(queue))->list->data : NULL)
-
-#define g_queue_peek_back(queue) \
- ((((GQueue *)(queue)) && ((GQueue *)(queue))->list_end) ? \
- ((GQueue *)(queue))->list_end->data : NULL)
-
-#define g_queue_index(queue,ptr) \
- ((((GQueue *)(queue)) && ((GQueue *)(queue))->list) ? \
- g_list_index (((GQueue *)(queue))->list, (ptr)) : -1)
-
-#define g_queue_push g_queue_push_back
-#define g_queue_pop g_queue_pop_front
-#define g_queue_peek g_queue_peek_front
-
-
#ifdef __cplusplus
}
#endif