15#include "ws_symbol_export.h"
16#include "ws_attributes.h"
25#if !GLIB_CHECK_VERSION(2, 61, 2)
27typedef volatile gint gatomicrefcount;
36 guint zero_terminated ;
38 gatomicrefcount ref_count;
39 GDestroyNotify clear_func;
43g_array_binary_search (GArray *array,
45 GCompareFunc compare_func,
46 guint *out_match_index)
48 gboolean result = FALSE;
50 guint left, middle, right;
53 g_return_val_if_fail (_array != NULL, FALSE);
54 g_return_val_if_fail (compare_func != NULL, FALSE);
56 if (G_LIKELY(_array->len))
59 right = _array->len - 1;
63 middle = left + (right - left) / 2;
65 val = compare_func (_array->data + (_array->elt_size * middle), target);
80 if (result && out_match_index != NULL)
81 *out_match_index = middle;
87#if !GLIB_CHECK_VERSION(2, 64, 0)
95 gatomicrefcount ref_count;
96 guint8 null_terminated : 1;
97 GDestroyNotify element_free_func;
100static inline gpointer
101g_array_steal (GArray *array,
107 g_return_val_if_fail (array != NULL, NULL);
110 segment = (gpointer) rarray->data;
121static inline gpointer *
122g_ptr_array_steal (GPtrArray *array,
128 g_return_val_if_fail (array != NULL, NULL);
131 segment = (gpointer *) rarray->pdata;
136 rarray->pdata = NULL;
142static inline guint8 *
143g_byte_array_steal (GByteArray *array,
146 return (guint8 *) g_array_steal ((GArray *) array, len);
150#if !GLIB_CHECK_VERSION(2, 68, 0)
152g_memdup2(
const void *mem,
size_t byte_size)
156 if (mem && byte_size != 0) {
157 new_mem = g_malloc(byte_size);
158 memcpy(new_mem, mem, byte_size);
167#if !GLIB_CHECK_VERSION(2, 74, 0)
168#ifndef G_REGEX_DEFAULT
169#define G_REGEX_DEFAULT ((GRegexCompileFlags)0)
Definition glib-compat.h:31
Definition glib-compat.h:91
Definition tap-tcp-stream.h:43