Browse Source

MT#55283 add t_list_find_custom()

Typed variant of g_list_find_custom()

Change-Id: I986b6b58fd10ac43edb6bb01b5c6006d4082d201
pull/1838/head
Richard Fuchs 1 year ago
parent
commit
03a6c37729
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      lib/containers.h

+ 7
- 0
lib/containers.h View File

@ -294,6 +294,13 @@
__ret; \ __ret; \
}) })
#define t_list_find_custom(L, e, f) ({ \
int (*__f)(__typeof__((L)->__ct), const void *) = f; \
GList *__l = g_list_find_custom(&(L)->l, e, (GCompareFunc) __f); \
__typeof__(L) __ret = (__typeof__(L)) __l; \
__ret; \
})
#define t_queue_clear(Q) ({ \ #define t_queue_clear(Q) ({ \
g_queue_clear(&(Q)->q); \ g_queue_clear(&(Q)->q); \
}) })


Loading…
Cancel
Save