Debian Codegraph @

src/libmbim-glib/mbim-utils.c

raw
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* SPDX-License-Identifier: LGPL-2.1-or-later */
3 /*
4 * libmbim-glib -- GLib/GIO based library to control MBIM devices
5 *
6 * Copyright (C) 2013 - 2019 Aleksander Morgado <[email protected]>
7 */
8
9 #include "mbim-utils.h"
10
11 /**
12 * SECTION:mbim-utils
13 * @title: Common utilities
14 * @short_description: Common utilities in the libmbim-glib library.
15 *
16 * This section exposes a set of common utilities that may be used to work
17 * with the libmbim-glib library.
18 */
19
20 static volatile gint __traces_enabled = FALSE;
21 static volatile gint __hide_personal_info = FALSE;
22
23 gboolean
24 mbim_utils_get_traces_enabled (void)
25 {
26 return (gboolean) g_atomic_int_get (&__traces_enabled);
27 }
28
29 void
30 mbim_utils_set_traces_enabled (gboolean enabled)
31 {
32 g_atomic_int_set (&__traces_enabled, enabled);
33 }
34
35 void
36 mbim_utils_set_show_personal_info (gboolean hide_personal_info)
37 {
38 g_atomic_int_set (&__hide_personal_info, hide_personal_info);
39 }
40
41 gboolean
42 mbim_utils_get_show_personal_info (void)
43 {
44 return (gboolean) g_atomic_int_get (&__hide_personal_info);
45 }