Browse Source

MT#55283 add _link variants

Change-Id: I9596193105300f8bb3733ae41e848ec6c8f4b887
pull/1910/head
Richard Fuchs 10 months ago
parent
commit
1896fafe60
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      lib/containers.h

+ 11
- 0
lib/containers.h View File

@ -223,6 +223,12 @@ static inline void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) {
__ret; \
})
#define t_queue_pop_head_link(Q) ({ \
GList *__l = g_queue_pop_head_link(&(Q)->q); \
__typeof__((Q)->head) __ret = (__typeof__((Q)->head)) __l; \
__ret; \
})
#define t_queue_pop_tail(Q) ({ \
__typeof__((Q)->__t) __ret = g_queue_pop_tail(&(Q)->q); \
__ret; \
@ -253,6 +259,11 @@ static inline void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) {
g_queue_push_tail(&(Q)->q, __e); \
})
#define t_queue_push_tail_link(Q, k) ({ \
__typeof__((Q)->head) __l = k; \
g_queue_push_tail_link(&(Q)->q, &__l->l); \
})
#define t_queue_insert_before(Q, k, e) ({ \
__typeof__((Q)->__t) __e = e; \
__typeof__((Q)->head) __l = k; \


Loading…
Cancel
Save