]>
code.delx.au - pulseaudio/blob - src/modules/bluetooth/bluez5-util.c
0f23bff2d981c99480247544b319b4da9fc27817
2 This file is part of PulseAudio.
4 Copyright 2008-2013 João Paulo Rechi Vita
6 PulseAudio is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 2.1 of the
9 License, or (at your option) any later version.
11 PulseAudio is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with PulseAudio; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 #include <pulse/xmalloc.h>
28 #include <pulsecore/core.h>
29 #include <pulsecore/macro.h>
30 #include <pulsecore/refcnt.h>
31 #include <pulsecore/shared.h>
33 #include "bluez5-util.h"
35 struct pa_bluetooth_discovery
{
41 pa_bluetooth_discovery
* pa_bluetooth_discovery_get(pa_core
*c
) {
42 pa_bluetooth_discovery
*y
;
44 if ((y
= pa_shared_get(c
, "bluetooth-discovery")))
45 return pa_bluetooth_discovery_ref(y
);
47 y
= pa_xnew0(pa_bluetooth_discovery
, 1);
51 pa_shared_set(c
, "bluetooth-discovery", y
);
56 pa_bluetooth_discovery
* pa_bluetooth_discovery_ref(pa_bluetooth_discovery
*y
) {
58 pa_assert(PA_REFCNT_VALUE(y
) > 0);
65 void pa_bluetooth_discovery_unref(pa_bluetooth_discovery
*y
) {
67 pa_assert(PA_REFCNT_VALUE(y
) > 0);
69 if (PA_REFCNT_DEC(y
) > 0)
72 pa_shared_remove(y
->core
, "bluetooth-discovery");