15#include "ws_symbol_export.h"
16#include "ws_attributes.h"
25#if !GLIB_CHECK_VERSION(2, 60, 0)
27#define g_queue_clear_full queue_clear_full
29queue_clear_full (GQueue * queue, GDestroyNotify free_func)
33 while ((data = g_queue_pop_head (queue)) != NULL)
39#if !GLIB_CHECK_VERSION(2, 61, 2)
41typedef volatile gint gatomicrefcount;
50 guint zero_terminated ;
52 gatomicrefcount ref_count;
53 GDestroyNotify clear_func;
57g_array_binary_search (GArray *array,
59 GCompareFunc compare_func,
60 guint *out_match_index)
62 gboolean result = FALSE;
64 guint left, middle, right;
67 g_return_val_if_fail (_array != NULL, FALSE);
68 g_return_val_if_fail (compare_func != NULL, FALSE);
70 if (G_LIKELY(_array->len))
73 right = _array->len - 1;
77 middle = left + (right - left) / 2;
79 val = compare_func (_array->data + (_array->elt_size * middle), target);
94 if (result && out_match_index != NULL)
95 *out_match_index = middle;
101#if !GLIB_CHECK_VERSION(2, 64, 0)
109 gatomicrefcount ref_count;
110 guint8 null_terminated : 1;
111 GDestroyNotify element_free_func;
114static inline gpointer
115g_array_steal (GArray *array,
121 g_return_val_if_fail (array != NULL, NULL);
124 segment = (gpointer) rarray->data;
135static inline gpointer *
136g_ptr_array_steal (GPtrArray *array,
142 g_return_val_if_fail (array != NULL, NULL);
145 segment = (gpointer *) rarray->pdata;
150 rarray->pdata = NULL;
156static inline guint8 *
157g_byte_array_steal (GByteArray *array,
160 return (guint8 *) g_array_steal ((GArray *) array, len);
164#if !GLIB_CHECK_VERSION(2, 68, 0)
166g_memdup2(
const void *mem,
size_t byte_size)
170 if (mem && byte_size != 0) {
171 new_mem = g_malloc(byte_size);
172 memcpy(new_mem, mem, byte_size);
181#if !GLIB_CHECK_VERSION(2, 74, 0)
182#ifndef G_REGEX_DEFAULT
183#define G_REGEX_DEFAULT ((GRegexCompileFlags)0)
Definition glib-compat.h:45
Definition glib-compat.h:105
Definition tap-tcp-stream.h:43