Coverage Report

Created: 2026-10-13 06:48

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/usr/local/include/glib-2.0/glib/gutils.h
Line
Count
Source
1
/* GLIB - Library of useful routines for C programming
2
 * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
3
 *
4
 * SPDX-License-Identifier: LGPL-2.1-or-later
5
 *
6
 * This library is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU Lesser General Public
8
 * License as published by the Free Software Foundation; either
9
 * version 2.1 of the License, or (at your option) any later version.
10
 *
11
 * This library is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18
 */
19
20
/*
21
 * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
22
 * file for a list of people on the GLib Team.  See the ChangeLog
23
 * files for a list of changes.  These files are distributed with
24
 * GLib at ftp://ftp.gtk.org/pub/gtk/.
25
 */
26
27
#ifndef __G_UTILS_H__
28
#define __G_UTILS_H__
29
30
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
31
#error "Only <glib.h> can be included directly."
32
#endif
33
34
#include <glib/gtypes.h>
35
#include <stdarg.h>
36
37
G_BEGIN_DECLS
38
39
GLIB_AVAILABLE_IN_ALL
40
const gchar *         g_get_user_name        (void);
41
GLIB_AVAILABLE_IN_ALL
42
const gchar *         g_get_real_name        (void);
43
GLIB_AVAILABLE_IN_ALL
44
const gchar *         g_get_home_dir         (void);
45
GLIB_AVAILABLE_IN_ALL
46
const gchar *         g_get_tmp_dir          (void);
47
GLIB_AVAILABLE_IN_ALL
48
const gchar *         g_get_host_name      (void);
49
GLIB_AVAILABLE_IN_2_92
50
const char *          g_get_process_executable_dir (void);
51
GLIB_AVAILABLE_IN_ALL
52
const gchar *         g_get_prgname          (void);
53
GLIB_AVAILABLE_IN_ALL
54
void                  g_set_prgname          (const gchar *prgname);
55
GLIB_AVAILABLE_IN_ALL
56
const gchar *         g_get_application_name (void);
57
GLIB_AVAILABLE_IN_ALL
58
void                  g_set_application_name (const gchar *application_name);
59
GLIB_AVAILABLE_IN_2_64
60
gchar *               g_get_os_info          (const gchar *key_name);
61
62
/**
63
 * G_OS_INFO_KEY_NAME:
64
 *
65
 * A key to get the name of the operating system excluding version information suitable for presentation to the user, e.g. "YoYoOS"
66
 *
67
 * Since: 2.64
68
 */
69
#define G_OS_INFO_KEY_NAME \
70
    GLIB_AVAILABLE_MACRO_IN_2_64 \
71
    "NAME"
72
73
/**
74
 * G_OS_INFO_KEY_PRETTY_NAME:
75
 *
76
 * A key to get the name of the operating system in a format suitable for presentation to the user, e.g. "YoYoOS Foo"
77
 *
78
 * Since: 2.64
79
 */
80
#define G_OS_INFO_KEY_PRETTY_NAME \
81
    GLIB_AVAILABLE_MACRO_IN_2_64 \
82
    "PRETTY_NAME"
83
84
/**
85
 * G_OS_INFO_KEY_VERSION:
86
 *
87
 * A key to get the operating system version suitable for presentation to the user, e.g. "42 (Foo)"
88
 *
89
 * Since: 2.64
90
 */
91
#define G_OS_INFO_KEY_VERSION \
92
    GLIB_AVAILABLE_MACRO_IN_2_64 \
93
    "VERSION"
94
95
/**
96
 * G_OS_INFO_KEY_VERSION_CODENAME:
97
 *
98
 * A key to get a codename identifying the operating system release suitable for processing by scripts or usage in generated filenames, e.g. "foo"
99
 *
100
 * Since: 2.64
101
 */
102
#define G_OS_INFO_KEY_VERSION_CODENAME \
103
    GLIB_AVAILABLE_MACRO_IN_2_64 \
104
    "VERSION_CODENAME"
105
106
/**
107
 * G_OS_INFO_KEY_VERSION_ID:
108
 *
109
 * A key to get the version of the operating system suitable for processing by scripts or usage in generated filenames, e.g. "42"
110
 *
111
 * Since: 2.64
112
 */
113
#define G_OS_INFO_KEY_VERSION_ID \
114
    GLIB_AVAILABLE_MACRO_IN_2_64 \
115
    "VERSION_ID"
116
117
/**
118
 * G_OS_INFO_KEY_ID:
119
 *
120
 * A key to get an ID identifying the operating system suitable for processing by scripts or usage in generated filenames, e.g. "yoyoos"
121
 *
122
 * Since: 2.64
123
 */
124
#define G_OS_INFO_KEY_ID \
125
    GLIB_AVAILABLE_MACRO_IN_2_64 \
126
    "ID"
127
128
/**
129
 * G_OS_INFO_KEY_HOME_URL:
130
 *
131
 * A key to get the homepage for the operating system, e.g. "https://www.yoyo-os.com/"
132
 *
133
 * Since: 2.64
134
 */
135
#define G_OS_INFO_KEY_HOME_URL \
136
    GLIB_AVAILABLE_MACRO_IN_2_64 \
137
    "HOME_URL"
138
139
/**
140
 * G_OS_INFO_KEY_DOCUMENTATION_URL:
141
 *
142
 * A key to get the documentation page for the operating system, e.g. "https://docs.yoyo-os.com/"
143
 *
144
 * Since: 2.64
145
 */
146
#define G_OS_INFO_KEY_DOCUMENTATION_URL \
147
    GLIB_AVAILABLE_MACRO_IN_2_64 \
148
    "DOCUMENTATION_URL"
149
150
/**
151
 * G_OS_INFO_KEY_SUPPORT_URL:
152
 *
153
 * A key to get the support page for the operating system, e.g. "https://support.yoyo-os.com/"
154
 *
155
 * Since: 2.64
156
 */
157
#define G_OS_INFO_KEY_SUPPORT_URL \
158
    GLIB_AVAILABLE_MACRO_IN_2_64 \
159
    "SUPPORT_URL"
160
161
/**
162
 * G_OS_INFO_KEY_BUG_REPORT_URL:
163
 *
164
 * A key to get the bug reporting page for the operating system, e.g. "https://bugs.yoyo-os.com/"
165
 *
166
 * Since: 2.64
167
 */
168
#define G_OS_INFO_KEY_BUG_REPORT_URL \
169
    GLIB_AVAILABLE_MACRO_IN_2_64 \
170
    "BUG_REPORT_URL"
171
172
/**
173
 * G_OS_INFO_KEY_PRIVACY_POLICY_URL:
174
 *
175
 * A key to get the privacy policy for the operating system, e.g. "https://privacy.yoyo-os.com/"
176
 *
177
 * Since: 2.64
178
 */
179
#define G_OS_INFO_KEY_PRIVACY_POLICY_URL \
180
    GLIB_AVAILABLE_MACRO_IN_2_64 \
181
    "PRIVACY_POLICY_URL"
182
183
GLIB_AVAILABLE_IN_ALL
184
void      g_reload_user_special_dirs_cache     (void);
185
GLIB_AVAILABLE_IN_ALL
186
const gchar *         g_get_user_data_dir      (void);
187
GLIB_AVAILABLE_IN_ALL
188
const gchar *         g_get_user_config_dir    (void);
189
GLIB_AVAILABLE_IN_ALL
190
const gchar *         g_get_user_cache_dir     (void);
191
GLIB_AVAILABLE_IN_2_72
192
const gchar *         g_get_user_state_dir     (void);
193
GLIB_AVAILABLE_IN_ALL
194
const gchar * const * g_get_system_data_dirs   (void);
195
196
#ifdef G_OS_WIN32
197
/* This function is not part of the public GLib API */
198
GLIB_AVAILABLE_IN_ALL
199
const gchar * const * g_win32_get_system_data_dirs_for_module (void (*address_of_function)(void));
200
#endif
201
202
#if defined (G_OS_WIN32) && defined (G_CAN_INLINE)
203
/* This function is not part of the public GLib API either. Just call
204
 * g_get_system_data_dirs() in your code, never mind that that is
205
 * actually a macro and you will in fact call this inline function.
206
 */
207
static inline const gchar * const *
208
_g_win32_get_system_data_dirs (void)
209
{
210
  return g_win32_get_system_data_dirs_for_module ((void (*)(void)) &_g_win32_get_system_data_dirs);
211
}
212
#define g_get_system_data_dirs _g_win32_get_system_data_dirs
213
#endif
214
215
GLIB_AVAILABLE_IN_ALL
216
const gchar * const * g_get_system_config_dirs (void);
217
218
GLIB_AVAILABLE_IN_ALL
219
const gchar * g_get_user_runtime_dir (void);
220
221
/**
222
 * GUserDirectory:
223
 * @G_USER_DIRECTORY_DESKTOP: the user's Desktop directory
224
 * @G_USER_DIRECTORY_DOCUMENTS: the user's Documents directory
225
 * @G_USER_DIRECTORY_DOWNLOAD: the user's Downloads directory
226
 * @G_USER_DIRECTORY_MUSIC: the user's Music directory
227
 * @G_USER_DIRECTORY_PICTURES: the user's Pictures directory
228
 * @G_USER_DIRECTORY_PUBLIC_SHARE: the user's shared directory
229
 * @G_USER_DIRECTORY_TEMPLATES: the user's Templates directory
230
 * @G_USER_DIRECTORY_VIDEOS: the user's Movies directory
231
 * @G_USER_N_DIRECTORIES: the number of enum values
232
 *
233
 * These are logical ids for special directories which are defined
234
 * depending on the platform used. You should use g_get_user_special_dir()
235
 * to retrieve the full path associated to the logical id.
236
 *
237
 * The #GUserDirectory enumeration can be extended at later date. Not
238
 * every platform has a directory for every logical id in this
239
 * enumeration.
240
 *
241
 * Since: 2.14
242
 */
243
typedef enum {
244
  G_USER_DIRECTORY_DESKTOP,
245
  G_USER_DIRECTORY_DOCUMENTS,
246
  G_USER_DIRECTORY_DOWNLOAD,
247
  G_USER_DIRECTORY_MUSIC,
248
  G_USER_DIRECTORY_PICTURES,
249
  G_USER_DIRECTORY_PUBLIC_SHARE,
250
  G_USER_DIRECTORY_TEMPLATES,
251
  G_USER_DIRECTORY_VIDEOS,
252
253
  /**
254
   * G_USER_DIRECTORY_PROJECTS:
255
   *
256
   * The user's Projects directory.
257
   *
258
   * Since: 2.90
259
   */
260
  G_USER_DIRECTORY_PROJECTS GLIB_AVAILABLE_ENUMERATOR_IN_2_90,
261
262
  G_USER_N_DIRECTORIES
263
} GUserDirectory;
264
265
GLIB_AVAILABLE_IN_ALL
266
const gchar * g_get_user_special_dir (GUserDirectory directory);
267
268
/**
269
 * GDebugKey:
270
 * @key: the string
271
 * @value: the flag
272
 *
273
 * Associates a string with a bit flag.
274
 * Used in g_parse_debug_string().
275
 */
276
typedef struct _GDebugKey GDebugKey;
277
struct _GDebugKey
278
{
279
  const gchar *key;
280
  guint        value;
281
};
282
283
/* Miscellaneous utility functions
284
 */
285
GLIB_AVAILABLE_IN_ALL
286
guint                 g_parse_debug_string (const gchar     *string,
287
              const GDebugKey *keys,
288
              guint            nkeys);
289
290
GLIB_AVAILABLE_IN_ALL
291
gint                  g_snprintf           (gchar       *string,
292
              gulong       n,
293
              gchar const *format,
294
              ...) G_GNUC_PRINTF (3, 4);
295
GLIB_AVAILABLE_IN_ALL
296
gint                  g_vsnprintf          (gchar       *string,
297
              gulong       n,
298
              gchar const *format,
299
              va_list      args)
300
              G_GNUC_PRINTF(3, 0);
301
302
GLIB_AVAILABLE_IN_ALL
303
void                  g_nullify_pointer    (gpointer    *nullify_location);
304
305
/**
306
 * GFormatSizeFlags:
307
 * @G_FORMAT_SIZE_DEFAULT: behave the same as g_format_size()
308
 * @G_FORMAT_SIZE_LONG_FORMAT: include the exact number of bytes as part
309
 *     of the returned string.  For example, "45.6 kB (45,612 bytes)".
310
 * @G_FORMAT_SIZE_IEC_UNITS: use IEC (base 1024) units with "KiB"-style
311
 *     suffixes. IEC units should only be used for reporting things with
312
 *     a strong "power of 2" basis, like RAM sizes or RAID stripe sizes.
313
 *     Network and storage sizes should be reported in the normal SI units.
314
 * @G_FORMAT_SIZE_BITS: set the size as a quantity in bits, rather than
315
 *     bytes, and return units in bits. For example, ‘Mbit’ rather than ‘MB’.
316
 *
317
 * Flags to modify the format of the string returned by g_format_size_full().
318
 */
319
typedef enum
320
{
321
  G_FORMAT_SIZE_DEFAULT     = 0,
322
  G_FORMAT_SIZE_LONG_FORMAT = 1 << 0,
323
  G_FORMAT_SIZE_IEC_UNITS   = 1 << 1,
324
  G_FORMAT_SIZE_BITS        = 1 << 2,
325
  /**
326
   * G_FORMAT_SIZE_ONLY_VALUE:
327
   *
328
   * Returns only the value, without a unit.
329
   *
330
   * This should not be used together with `G_FORMAT_SIZE_LONG_FORMAT` nor
331
   * `G_FORMAT_SIZE_ONLY_UNIT`.
332
   *
333
   * Since: 2.74
334
   */
335
  G_FORMAT_SIZE_ONLY_VALUE GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 1 << 3,
336
  /**
337
   * G_FORMAT_SIZE_ONLY_UNIT:
338
   *
339
   * Returns only the unit, without a value.
340
   *
341
   * This should not be used together with `G_FORMAT_SIZE_LONG_FORMAT` nor
342
   * `G_FORMAT_SIZE_ONLY_VALUE`.
343
   *
344
   * Since: 2.74
345
   */
346
  G_FORMAT_SIZE_ONLY_UNIT GLIB_AVAILABLE_ENUMERATOR_IN_2_74 = 1 << 4
347
} G_GNUC_FLAG_ENUM GFormatSizeFlags;
348
349
GLIB_AVAILABLE_IN_2_30
350
gchar *g_format_size_full   (guint64          size,
351
                             GFormatSizeFlags flags);
352
GLIB_AVAILABLE_IN_2_30
353
gchar *g_format_size        (guint64          size);
354
355
GLIB_DEPRECATED_IN_2_30_FOR(g_format_size)
356
gchar *g_format_size_for_display (goffset size);
357
358
#define g_ATEXIT(proc)  (atexit (proc)) GLIB_DEPRECATED_MACRO_IN_2_32
359
#define g_memmove(dest,src,len) \
360
  G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END  GLIB_DEPRECATED_MACRO_IN_2_40_FOR(memmove)
361
362
/**
363
 * GVoidFunc:
364
 *
365
 * Declares a type of function which takes no arguments
366
 * and has no return value. It is used to specify the type
367
 * function passed to g_atexit().
368
 */
369
typedef void (*GVoidFunc) (void) GLIB_DEPRECATED_TYPE_IN_2_32;
370
#define ATEXIT(proc) g_ATEXIT(proc) GLIB_DEPRECATED_MACRO_IN_2_32
371
372
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
373
GLIB_DEPRECATED
374
void  g_atexit    (GVoidFunc    func);
375
G_GNUC_END_IGNORE_DEPRECATIONS
376
377
#ifdef G_OS_WIN32
378
/* It's a bad idea to wrap atexit() on Windows. If the GLib DLL calls
379
 * atexit(), the function will be called when the GLib DLL is detached
380
 * from the program, which is not what the caller wants. The caller
381
 * wants the function to be called when it *itself* exits (or is
382
 * detached, in case the caller, too, is a DLL).
383
 */
384
#if (defined(__MINGW_H) && !defined(_STDLIB_H_)) || (defined(_MSC_VER) && !defined(_INC_STDLIB))
385
int atexit (void (*)(void));
386
#endif
387
#define g_atexit(func) atexit(func) GLIB_DEPRECATED_MACRO_IN_2_32
388
#endif
389
390
391
/* Look for an executable in PATH, following execvp() rules */
392
GLIB_AVAILABLE_IN_ALL
393
gchar*  g_find_program_in_path  (const gchar *program);
394
395
/* Bit tests
396
 *
397
 * These are defined in a convoluted way because we want the compiler to
398
 * be able to inline the code for performance reasons, but for
399
 * historical reasons, we must continue to provide non-inline versions
400
 * on our ABI.
401
 *
402
 * We define these as functions in gutils.c which are just implemented
403
 * as calls to the _impl() versions in order to preserve the ABI.
404
 */
405
406
#define g_bit_nth_lsf(mask, nth_bit) g_bit_nth_lsf_impl(mask, nth_bit)
407
#define g_bit_nth_msf(mask, nth_bit) g_bit_nth_msf_impl(mask, nth_bit)
408
#define g_bit_storage(number)        g_bit_storage_impl(number)
409
410
GLIB_AVAILABLE_IN_ALL
411
gint    (g_bit_nth_lsf)         (gulong mask,
412
                                 gint   nth_bit);
413
GLIB_AVAILABLE_IN_ALL
414
gint    (g_bit_nth_msf)         (gulong mask,
415
                                 gint   nth_bit);
416
GLIB_AVAILABLE_IN_ALL
417
guint   (g_bit_storage)         (gulong number);
418
419
static inline gint
420
g_bit_nth_lsf_impl (gulong mask,
421
                    gint   nth_bit)
422
0
{
423
0
  if (G_UNLIKELY (nth_bit < -1))
424
0
    nth_bit = -1;
425
0
  while (nth_bit < ((GLIB_SIZEOF_LONG * 8) - 1))
426
0
    {
427
0
      nth_bit++;
428
0
      if (mask & (1UL << nth_bit))
429
0
        return nth_bit;
430
0
    }
431
0
  return -1;
432
0
}
Unexecuted instantiation: caps.c:g_bit_nth_lsf_impl
Unexecuted instantiation: iq.c:g_bit_nth_lsf_impl
Unexecuted instantiation: jabber.c:g_bit_nth_lsf_impl
Unexecuted instantiation: jingle.c:g_bit_nth_lsf_impl
Unexecuted instantiation: content.c:g_bit_nth_lsf_impl
Unexecuted instantiation: iceudp.c:g_bit_nth_lsf_impl
Unexecuted instantiation: rawudp.c:g_bit_nth_lsf_impl
Unexecuted instantiation: session.c:g_bit_nth_lsf_impl
Unexecuted instantiation: transport.c:g_bit_nth_lsf_impl
Unexecuted instantiation: jutil.c:g_bit_nth_lsf_impl
Unexecuted instantiation: message.c:g_bit_nth_lsf_impl
Unexecuted instantiation: oob.c:g_bit_nth_lsf_impl
Unexecuted instantiation: parser.c:g_bit_nth_lsf_impl
Unexecuted instantiation: pep.c:g_bit_nth_lsf_impl
Unexecuted instantiation: ping.c:g_bit_nth_lsf_impl
Unexecuted instantiation: presence.c:g_bit_nth_lsf_impl
Unexecuted instantiation: roster.c:g_bit_nth_lsf_impl
Unexecuted instantiation: si.c:g_bit_nth_lsf_impl
Unexecuted instantiation: stream_management.c:g_bit_nth_lsf_impl
Unexecuted instantiation: useravatar.c:g_bit_nth_lsf_impl
Unexecuted instantiation: usermood.c:g_bit_nth_lsf_impl
Unexecuted instantiation: usernick.c:g_bit_nth_lsf_impl
Unexecuted instantiation: usertune.c:g_bit_nth_lsf_impl
Unexecuted instantiation: xdata.c:g_bit_nth_lsf_impl
Unexecuted instantiation: adhoccommands.c:g_bit_nth_lsf_impl
Unexecuted instantiation: auth.c:g_bit_nth_lsf_impl
Unexecuted instantiation: auth_digest_md5.c:g_bit_nth_lsf_impl
Unexecuted instantiation: auth_plain.c:g_bit_nth_lsf_impl
Unexecuted instantiation: auth_scram.c:g_bit_nth_lsf_impl
Unexecuted instantiation: buddy.c:g_bit_nth_lsf_impl
Unexecuted instantiation: bosh.c:g_bit_nth_lsf_impl
Unexecuted instantiation: chat.c:g_bit_nth_lsf_impl
Unexecuted instantiation: data.c:g_bit_nth_lsf_impl
Unexecuted instantiation: disco.c:g_bit_nth_lsf_impl
Unexecuted instantiation: gmail.c:g_bit_nth_lsf_impl
Unexecuted instantiation: google.c:g_bit_nth_lsf_impl
Unexecuted instantiation: google_presence.c:g_bit_nth_lsf_impl
Unexecuted instantiation: google_roster.c:g_bit_nth_lsf_impl
Unexecuted instantiation: jingleinfo.c:g_bit_nth_lsf_impl
Unexecuted instantiation: ibb.c:g_bit_nth_lsf_impl
Unexecuted instantiation: account.c:g_bit_nth_lsf_impl
Unexecuted instantiation: blist.c:g_bit_nth_lsf_impl
Unexecuted instantiation: buddyicon.c:g_bit_nth_lsf_impl
Unexecuted instantiation: cipher.c:g_bit_nth_lsf_impl
Unexecuted instantiation: circbuffer.c:g_bit_nth_lsf_impl
Unexecuted instantiation: cmds.c:g_bit_nth_lsf_impl
Unexecuted instantiation: connection.c:g_bit_nth_lsf_impl
Unexecuted instantiation: conversation.c:g_bit_nth_lsf_impl
Unexecuted instantiation: core.c:g_bit_nth_lsf_impl
Unexecuted instantiation: debug.c:g_bit_nth_lsf_impl
Unexecuted instantiation: eventloop.c:g_bit_nth_lsf_impl
Unexecuted instantiation: ft.c:g_bit_nth_lsf_impl
Unexecuted instantiation: idle.c:g_bit_nth_lsf_impl
Unexecuted instantiation: imgstore.c:g_bit_nth_lsf_impl
Unexecuted instantiation: log.c:g_bit_nth_lsf_impl
Unexecuted instantiation: network.c:g_bit_nth_lsf_impl
Unexecuted instantiation: notify.c:g_bit_nth_lsf_impl
Unexecuted instantiation: plugin.c:g_bit_nth_lsf_impl
Unexecuted instantiation: pounce.c:g_bit_nth_lsf_impl
Unexecuted instantiation: prefs.c:g_bit_nth_lsf_impl
Unexecuted instantiation: privacy.c:g_bit_nth_lsf_impl
Unexecuted instantiation: proxy.c:g_bit_nth_lsf_impl
Unexecuted instantiation: prpl.c:g_bit_nth_lsf_impl
Unexecuted instantiation: request.c:g_bit_nth_lsf_impl
Unexecuted instantiation: roomlist.c:g_bit_nth_lsf_impl
Unexecuted instantiation: savedstatuses.c:g_bit_nth_lsf_impl
Unexecuted instantiation: server.c:g_bit_nth_lsf_impl
Unexecuted instantiation: signals.c:g_bit_nth_lsf_impl
Unexecuted instantiation: smiley.c:g_bit_nth_lsf_impl
Unexecuted instantiation: dnsquery.c:g_bit_nth_lsf_impl
Unexecuted instantiation: dnssrv.c:g_bit_nth_lsf_impl
Unexecuted instantiation: status.c:g_bit_nth_lsf_impl
Unexecuted instantiation: stringref.c:g_bit_nth_lsf_impl
Unexecuted instantiation: stun.c:g_bit_nth_lsf_impl
Unexecuted instantiation: sound.c:g_bit_nth_lsf_impl
Unexecuted instantiation: sound-theme-loader.c:g_bit_nth_lsf_impl
Unexecuted instantiation: sslconn.c:g_bit_nth_lsf_impl
Unexecuted instantiation: theme-loader.c:g_bit_nth_lsf_impl
Unexecuted instantiation: theme-manager.c:g_bit_nth_lsf_impl
Unexecuted instantiation: upnp.c:g_bit_nth_lsf_impl
Unexecuted instantiation: util.c:g_bit_nth_lsf_impl
Unexecuted instantiation: value.c:g_bit_nth_lsf_impl
Unexecuted instantiation: xmlnode.c:g_bit_nth_lsf_impl
Unexecuted instantiation: des.c:g_bit_nth_lsf_impl
Unexecuted instantiation: gchecksum.c:g_bit_nth_lsf_impl
Unexecuted instantiation: hmac.c:g_bit_nth_lsf_impl
Unexecuted instantiation: md4.c:g_bit_nth_lsf_impl
Unexecuted instantiation: rc4.c:g_bit_nth_lsf_impl
Unexecuted instantiation: accountopt.c:g_bit_nth_lsf_impl
Unexecuted instantiation: certificate.c:g_bit_nth_lsf_impl
Unexecuted instantiation: nat-pmp.c:g_bit_nth_lsf_impl
Unexecuted instantiation: ntlm.c:g_bit_nth_lsf_impl
Unexecuted instantiation: sound-theme.c:g_bit_nth_lsf_impl
Unexecuted instantiation: theme.c:g_bit_nth_lsf_impl
433
434
static inline gint
435
g_bit_nth_msf_impl (gulong mask,
436
                    gint   nth_bit)
437
0
{
438
0
  if (nth_bit < 0 || G_UNLIKELY (nth_bit > GLIB_SIZEOF_LONG * 8))
439
0
    nth_bit = GLIB_SIZEOF_LONG * 8;
440
0
  while (nth_bit > 0)
441
0
    {
442
0
      nth_bit--;
443
0
      if (mask & (1UL << nth_bit))
444
0
        return nth_bit;
445
0
    }
446
0
  return -1;
447
0
}
Unexecuted instantiation: caps.c:g_bit_nth_msf_impl
Unexecuted instantiation: iq.c:g_bit_nth_msf_impl
Unexecuted instantiation: jabber.c:g_bit_nth_msf_impl
Unexecuted instantiation: jingle.c:g_bit_nth_msf_impl
Unexecuted instantiation: content.c:g_bit_nth_msf_impl
Unexecuted instantiation: iceudp.c:g_bit_nth_msf_impl
Unexecuted instantiation: rawudp.c:g_bit_nth_msf_impl
Unexecuted instantiation: session.c:g_bit_nth_msf_impl
Unexecuted instantiation: transport.c:g_bit_nth_msf_impl
Unexecuted instantiation: jutil.c:g_bit_nth_msf_impl
Unexecuted instantiation: message.c:g_bit_nth_msf_impl
Unexecuted instantiation: oob.c:g_bit_nth_msf_impl
Unexecuted instantiation: parser.c:g_bit_nth_msf_impl
Unexecuted instantiation: pep.c:g_bit_nth_msf_impl
Unexecuted instantiation: ping.c:g_bit_nth_msf_impl
Unexecuted instantiation: presence.c:g_bit_nth_msf_impl
Unexecuted instantiation: roster.c:g_bit_nth_msf_impl
Unexecuted instantiation: si.c:g_bit_nth_msf_impl
Unexecuted instantiation: stream_management.c:g_bit_nth_msf_impl
Unexecuted instantiation: useravatar.c:g_bit_nth_msf_impl
Unexecuted instantiation: usermood.c:g_bit_nth_msf_impl
Unexecuted instantiation: usernick.c:g_bit_nth_msf_impl
Unexecuted instantiation: usertune.c:g_bit_nth_msf_impl
Unexecuted instantiation: xdata.c:g_bit_nth_msf_impl
Unexecuted instantiation: adhoccommands.c:g_bit_nth_msf_impl
Unexecuted instantiation: auth.c:g_bit_nth_msf_impl
Unexecuted instantiation: auth_digest_md5.c:g_bit_nth_msf_impl
Unexecuted instantiation: auth_plain.c:g_bit_nth_msf_impl
Unexecuted instantiation: auth_scram.c:g_bit_nth_msf_impl
Unexecuted instantiation: buddy.c:g_bit_nth_msf_impl
Unexecuted instantiation: bosh.c:g_bit_nth_msf_impl
Unexecuted instantiation: chat.c:g_bit_nth_msf_impl
Unexecuted instantiation: data.c:g_bit_nth_msf_impl
Unexecuted instantiation: disco.c:g_bit_nth_msf_impl
Unexecuted instantiation: gmail.c:g_bit_nth_msf_impl
Unexecuted instantiation: google.c:g_bit_nth_msf_impl
Unexecuted instantiation: google_presence.c:g_bit_nth_msf_impl
Unexecuted instantiation: google_roster.c:g_bit_nth_msf_impl
Unexecuted instantiation: jingleinfo.c:g_bit_nth_msf_impl
Unexecuted instantiation: ibb.c:g_bit_nth_msf_impl
Unexecuted instantiation: account.c:g_bit_nth_msf_impl
Unexecuted instantiation: blist.c:g_bit_nth_msf_impl
Unexecuted instantiation: buddyicon.c:g_bit_nth_msf_impl
Unexecuted instantiation: cipher.c:g_bit_nth_msf_impl
Unexecuted instantiation: circbuffer.c:g_bit_nth_msf_impl
Unexecuted instantiation: cmds.c:g_bit_nth_msf_impl
Unexecuted instantiation: connection.c:g_bit_nth_msf_impl
Unexecuted instantiation: conversation.c:g_bit_nth_msf_impl
Unexecuted instantiation: core.c:g_bit_nth_msf_impl
Unexecuted instantiation: debug.c:g_bit_nth_msf_impl
Unexecuted instantiation: eventloop.c:g_bit_nth_msf_impl
Unexecuted instantiation: ft.c:g_bit_nth_msf_impl
Unexecuted instantiation: idle.c:g_bit_nth_msf_impl
Unexecuted instantiation: imgstore.c:g_bit_nth_msf_impl
Unexecuted instantiation: log.c:g_bit_nth_msf_impl
Unexecuted instantiation: network.c:g_bit_nth_msf_impl
Unexecuted instantiation: notify.c:g_bit_nth_msf_impl
Unexecuted instantiation: plugin.c:g_bit_nth_msf_impl
Unexecuted instantiation: pounce.c:g_bit_nth_msf_impl
Unexecuted instantiation: prefs.c:g_bit_nth_msf_impl
Unexecuted instantiation: privacy.c:g_bit_nth_msf_impl
Unexecuted instantiation: proxy.c:g_bit_nth_msf_impl
Unexecuted instantiation: prpl.c:g_bit_nth_msf_impl
Unexecuted instantiation: request.c:g_bit_nth_msf_impl
Unexecuted instantiation: roomlist.c:g_bit_nth_msf_impl
Unexecuted instantiation: savedstatuses.c:g_bit_nth_msf_impl
Unexecuted instantiation: server.c:g_bit_nth_msf_impl
Unexecuted instantiation: signals.c:g_bit_nth_msf_impl
Unexecuted instantiation: smiley.c:g_bit_nth_msf_impl
Unexecuted instantiation: dnsquery.c:g_bit_nth_msf_impl
Unexecuted instantiation: dnssrv.c:g_bit_nth_msf_impl
Unexecuted instantiation: status.c:g_bit_nth_msf_impl
Unexecuted instantiation: stringref.c:g_bit_nth_msf_impl
Unexecuted instantiation: stun.c:g_bit_nth_msf_impl
Unexecuted instantiation: sound.c:g_bit_nth_msf_impl
Unexecuted instantiation: sound-theme-loader.c:g_bit_nth_msf_impl
Unexecuted instantiation: sslconn.c:g_bit_nth_msf_impl
Unexecuted instantiation: theme-loader.c:g_bit_nth_msf_impl
Unexecuted instantiation: theme-manager.c:g_bit_nth_msf_impl
Unexecuted instantiation: upnp.c:g_bit_nth_msf_impl
Unexecuted instantiation: util.c:g_bit_nth_msf_impl
Unexecuted instantiation: value.c:g_bit_nth_msf_impl
Unexecuted instantiation: xmlnode.c:g_bit_nth_msf_impl
Unexecuted instantiation: des.c:g_bit_nth_msf_impl
Unexecuted instantiation: gchecksum.c:g_bit_nth_msf_impl
Unexecuted instantiation: hmac.c:g_bit_nth_msf_impl
Unexecuted instantiation: md4.c:g_bit_nth_msf_impl
Unexecuted instantiation: rc4.c:g_bit_nth_msf_impl
Unexecuted instantiation: accountopt.c:g_bit_nth_msf_impl
Unexecuted instantiation: certificate.c:g_bit_nth_msf_impl
Unexecuted instantiation: nat-pmp.c:g_bit_nth_msf_impl
Unexecuted instantiation: ntlm.c:g_bit_nth_msf_impl
Unexecuted instantiation: sound-theme.c:g_bit_nth_msf_impl
Unexecuted instantiation: theme.c:g_bit_nth_msf_impl
448
449
static inline guint
450
g_bit_storage_impl (gulong number)
451
0
{
452
0
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__)
453
0
  return G_LIKELY (number) ?
454
0
           ((GLIB_SIZEOF_LONG * 8U - 1) ^ (guint) __builtin_clzl(number)) + 1 : 1;
455
0
#else
456
0
  guint n_bits = 0;
457
0
458
0
  do
459
0
    {
460
0
      n_bits++;
461
0
      number >>= 1;
462
0
    }
463
0
  while (number);
464
0
  return n_bits;
465
0
#endif
466
0
}
Unexecuted instantiation: caps.c:g_bit_storage_impl
Unexecuted instantiation: iq.c:g_bit_storage_impl
Unexecuted instantiation: jabber.c:g_bit_storage_impl
Unexecuted instantiation: jingle.c:g_bit_storage_impl
Unexecuted instantiation: content.c:g_bit_storage_impl
Unexecuted instantiation: iceudp.c:g_bit_storage_impl
Unexecuted instantiation: rawudp.c:g_bit_storage_impl
Unexecuted instantiation: session.c:g_bit_storage_impl
Unexecuted instantiation: transport.c:g_bit_storage_impl
Unexecuted instantiation: jutil.c:g_bit_storage_impl
Unexecuted instantiation: message.c:g_bit_storage_impl
Unexecuted instantiation: oob.c:g_bit_storage_impl
Unexecuted instantiation: parser.c:g_bit_storage_impl
Unexecuted instantiation: pep.c:g_bit_storage_impl
Unexecuted instantiation: ping.c:g_bit_storage_impl
Unexecuted instantiation: presence.c:g_bit_storage_impl
Unexecuted instantiation: roster.c:g_bit_storage_impl
Unexecuted instantiation: si.c:g_bit_storage_impl
Unexecuted instantiation: stream_management.c:g_bit_storage_impl
Unexecuted instantiation: useravatar.c:g_bit_storage_impl
Unexecuted instantiation: usermood.c:g_bit_storage_impl
Unexecuted instantiation: usernick.c:g_bit_storage_impl
Unexecuted instantiation: usertune.c:g_bit_storage_impl
Unexecuted instantiation: xdata.c:g_bit_storage_impl
Unexecuted instantiation: adhoccommands.c:g_bit_storage_impl
Unexecuted instantiation: auth.c:g_bit_storage_impl
Unexecuted instantiation: auth_digest_md5.c:g_bit_storage_impl
Unexecuted instantiation: auth_plain.c:g_bit_storage_impl
Unexecuted instantiation: auth_scram.c:g_bit_storage_impl
Unexecuted instantiation: buddy.c:g_bit_storage_impl
Unexecuted instantiation: bosh.c:g_bit_storage_impl
Unexecuted instantiation: chat.c:g_bit_storage_impl
Unexecuted instantiation: data.c:g_bit_storage_impl
Unexecuted instantiation: disco.c:g_bit_storage_impl
Unexecuted instantiation: gmail.c:g_bit_storage_impl
Unexecuted instantiation: google.c:g_bit_storage_impl
Unexecuted instantiation: google_presence.c:g_bit_storage_impl
Unexecuted instantiation: google_roster.c:g_bit_storage_impl
Unexecuted instantiation: jingleinfo.c:g_bit_storage_impl
Unexecuted instantiation: ibb.c:g_bit_storage_impl
Unexecuted instantiation: account.c:g_bit_storage_impl
Unexecuted instantiation: blist.c:g_bit_storage_impl
Unexecuted instantiation: buddyicon.c:g_bit_storage_impl
Unexecuted instantiation: cipher.c:g_bit_storage_impl
Unexecuted instantiation: circbuffer.c:g_bit_storage_impl
Unexecuted instantiation: cmds.c:g_bit_storage_impl
Unexecuted instantiation: connection.c:g_bit_storage_impl
Unexecuted instantiation: conversation.c:g_bit_storage_impl
Unexecuted instantiation: core.c:g_bit_storage_impl
Unexecuted instantiation: debug.c:g_bit_storage_impl
Unexecuted instantiation: eventloop.c:g_bit_storage_impl
Unexecuted instantiation: ft.c:g_bit_storage_impl
Unexecuted instantiation: idle.c:g_bit_storage_impl
Unexecuted instantiation: imgstore.c:g_bit_storage_impl
Unexecuted instantiation: log.c:g_bit_storage_impl
Unexecuted instantiation: network.c:g_bit_storage_impl
Unexecuted instantiation: notify.c:g_bit_storage_impl
Unexecuted instantiation: plugin.c:g_bit_storage_impl
Unexecuted instantiation: pounce.c:g_bit_storage_impl
Unexecuted instantiation: prefs.c:g_bit_storage_impl
Unexecuted instantiation: privacy.c:g_bit_storage_impl
Unexecuted instantiation: proxy.c:g_bit_storage_impl
Unexecuted instantiation: prpl.c:g_bit_storage_impl
Unexecuted instantiation: request.c:g_bit_storage_impl
Unexecuted instantiation: roomlist.c:g_bit_storage_impl
Unexecuted instantiation: savedstatuses.c:g_bit_storage_impl
Unexecuted instantiation: server.c:g_bit_storage_impl
Unexecuted instantiation: signals.c:g_bit_storage_impl
Unexecuted instantiation: smiley.c:g_bit_storage_impl
Unexecuted instantiation: dnsquery.c:g_bit_storage_impl
Unexecuted instantiation: dnssrv.c:g_bit_storage_impl
Unexecuted instantiation: status.c:g_bit_storage_impl
Unexecuted instantiation: stringref.c:g_bit_storage_impl
Unexecuted instantiation: stun.c:g_bit_storage_impl
Unexecuted instantiation: sound.c:g_bit_storage_impl
Unexecuted instantiation: sound-theme-loader.c:g_bit_storage_impl
Unexecuted instantiation: sslconn.c:g_bit_storage_impl
Unexecuted instantiation: theme-loader.c:g_bit_storage_impl
Unexecuted instantiation: theme-manager.c:g_bit_storage_impl
Unexecuted instantiation: upnp.c:g_bit_storage_impl
Unexecuted instantiation: util.c:g_bit_storage_impl
Unexecuted instantiation: value.c:g_bit_storage_impl
Unexecuted instantiation: xmlnode.c:g_bit_storage_impl
Unexecuted instantiation: des.c:g_bit_storage_impl
Unexecuted instantiation: gchecksum.c:g_bit_storage_impl
Unexecuted instantiation: hmac.c:g_bit_storage_impl
Unexecuted instantiation: md4.c:g_bit_storage_impl
Unexecuted instantiation: rc4.c:g_bit_storage_impl
Unexecuted instantiation: accountopt.c:g_bit_storage_impl
Unexecuted instantiation: certificate.c:g_bit_storage_impl
Unexecuted instantiation: nat-pmp.c:g_bit_storage_impl
Unexecuted instantiation: ntlm.c:g_bit_storage_impl
Unexecuted instantiation: sound-theme.c:g_bit_storage_impl
Unexecuted instantiation: theme.c:g_bit_storage_impl
467
468
/* Crashes the program. */
469
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_50
470
#ifndef G_OS_WIN32
471
#  include <stdlib.h>
472
#  define g_abort() abort ()
473
#else
474
G_NORETURN GLIB_AVAILABLE_IN_2_50 void g_abort (void) G_ANALYZER_NORETURN;
475
#endif
476
#endif
477
478
/*
479
 * This macro is deprecated. This DllMain() is too complex. It is
480
 * recommended to write an explicit minimal DLlMain() that just saves
481
 * the handle to the DLL and then use that handle instead, for
482
 * instance passing it to
483
 * g_win32_get_package_installation_directory_of_module().
484
 *
485
 * On Windows, this macro defines a DllMain function that stores the
486
 * actual DLL name that the code being compiled will be included in.
487
 * STATIC should be empty or 'static'. DLL_NAME is the name of the
488
 * (pointer to the) char array where the DLL name will be stored. If
489
 * this is used, you must also include <windows.h>. If you need a more complex
490
 * DLL entry point function, you cannot use this.
491
 *
492
 * On non-Windows platforms, expands to nothing.
493
 */
494
495
#ifndef G_PLATFORM_WIN32
496
# define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name) GLIB_DEPRECATED_MACRO_IN_2_26
497
#else
498
# define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)     \
499
static char *dll_name;              \
500
                  \
501
BOOL WINAPI               \
502
DllMain (HINSTANCE hinstDLL,            \
503
   DWORD     fdwReason,           \
504
   LPVOID    lpvReserved)           \
505
{                 \
506
  wchar_t wcbfr[1000];              \
507
  char *tem;                \
508
  switch (fdwReason)              \
509
    {                 \
510
    case DLL_PROCESS_ATTACH:            \
511
      GetModuleFileNameW ((HMODULE) hinstDLL, wcbfr, G_N_ELEMENTS (wcbfr)); \
512
      tem = g_utf16_to_utf8 (wcbfr, -1, NULL, NULL, NULL);    \
513
      dll_name = g_path_get_basename (tem);       \
514
      g_free (tem);             \
515
      break;                \
516
    }                 \
517
                  \
518
  return TRUE;                \
519
} GLIB_DEPRECATED_MACRO_IN_2_26
520
#endif /* G_PLATFORM_WIN32 */
521
522
G_END_DECLS
523
524
#endif /* __G_UTILS_H__ */