Commit cdb0b713 authored by Slava Monich's avatar Slava Monich

[gsupplicant] Added new macros. JB#41874

  gsupplicant_bss_remove_all_handlers
  gsupplicant_interface_remove_all_handlers
  gsupplicant_network_remove_all_handlers
  gsupplicant_remove_all_handlers
parent e23a610f
/*
* Copyright (C) 2015-2017 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2015-2018 Jolla Ltd.
* Copyright (C) 2015-2018 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
......@@ -13,9 +13,9 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Jolla Ltd nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
......@@ -115,14 +115,14 @@ gsupplicant_unref(
gulong
gsupplicant_add_handler(
GSupplicant* self,
GSupplicant* supplicant,
GSUPPLICANT_PROPERTY prop,
GSupplicantFunc fn,
void* data);
gulong
gsupplicant_add_property_changed_handler(
GSupplicant* self,
GSupplicant* supplicant,
GSUPPLICANT_PROPERTY property,
GSupplicantPropertyFunc fn,
void* data);
......@@ -179,6 +179,9 @@ gsupplicant_keymgmt_suite_name(
guint keymgmt_suites,
guint* keymgmt_suite);
#define gsupplicant_remove_all_handlers(supplicant, ids) \
gsupplicant_remove_handlers(supplicant, ids, G_N_ELEMENTS(ids))
G_END_DECLS
#endif /* GSUPPLICANT_H */
......
/*
* Copyright (C) 2015-2017 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2015-2018 Jolla Ltd.
* Copyright (C) 2015-2018 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
......@@ -13,9 +13,9 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Jolla Ltd nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
......@@ -206,6 +206,9 @@ gsupplicant_bss_connect(
GSupplicantBSSStringResultFunc fn,
void* data);
#define gsupplicant_bss_remove_all_handlers(bss, ids) \
gsupplicant_bss_remove_handlers(bss, ids, G_N_ELEMENTS(ids))
G_END_DECLS
#endif /* GSUPPLICANT_BSS_H */
......
/*
* Copyright (C) 2015-2017 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2015-2018 Jolla Ltd.
* Copyright (C) 2015-2018 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
......@@ -13,9 +13,9 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Jolla Ltd nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
......@@ -439,6 +439,9 @@ G_INLINE_FUNC const char*
gsupplicant_interface_get_state_name(GSupplicantInterface* iface)
{ return iface ? gsupplicant_interface_state_name(iface->state) : NULL; }
#define gsupplicant_interface_remove_all_handlers(iface, ids) \
gsupplicant_interface_remove_handlers(iface, ids, G_N_ELEMENTS(ids))
G_END_DECLS
#endif /* GSUPPLICANT_INTERFACE_H */
......
/*
* Copyright (C) 2015-2018 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2015-2018 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
......@@ -13,9 +13,9 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Jolla Ltd nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
......@@ -112,9 +112,12 @@ gsupplicant_network_remove_handlers(
gboolean
gsupplicant_network_set_enabled(
GSupplicantNetwork* self,
GSupplicantNetwork* network,
gboolean enabled);
#define gsupplicant_network_remove_all_handlers(network, ids) \
gsupplicant_network_remove_handlers(network, ids, G_N_ELEMENTS(ids))
G_END_DECLS
#endif /* GSUPPLICANT_NETWORK_H */
......
/*
* Copyright (C) 2015-2017 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2015-2018 Jolla Ltd.
* Copyright (C) 2015-2018 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
......@@ -13,9 +13,9 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Jolla Ltd nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
......@@ -1450,8 +1450,8 @@ gsupplicant_bss_dispose(
g_object_unref(priv->proxy);
priv->proxy = NULL;
}
gsupplicant_interface_remove_handlers(self->iface, priv->iface_handler_id,
G_N_ELEMENTS(priv->iface_handler_id));
gsupplicant_interface_remove_all_handlers(self->iface,
priv->iface_handler_id);
G_OBJECT_CLASS(SUPER_CLASS)->dispose(object);
}
......
/*
* Copyright (C) 2015-2018 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2015-2018 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
......@@ -13,9 +13,9 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Jolla Ltd nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
......@@ -1145,8 +1145,8 @@ gsupplicant_interface_add_network_call_dispose(
{
/* May be invoked twice */
if (call->network) {
gsupplicant_network_remove_handlers(call->network,
call->network_event_id, G_N_ELEMENTS(call->network_event_id));
gsupplicant_network_remove_all_handlers(call->network,
call->network_event_id);
gsupplicant_network_unref(call->network);
call->network = NULL;
}
......
/*
* Copyright (C) 2015-2017 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2015-2018 Jolla Ltd.
* Copyright (C) 2015-2018 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
......@@ -13,9 +13,9 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Jolla Ltd nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
* 3. Neither the names of the copyright holders nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
......@@ -718,8 +718,8 @@ gsupplicant_network_dispose(
g_object_unref(priv->proxy);
priv->proxy = NULL;
}
gsupplicant_interface_remove_handlers(self->iface, priv->iface_handler_id,
G_N_ELEMENTS(priv->iface_handler_id));
gsupplicant_interface_remove_all_handlers(self->iface,
priv->iface_handler_id);
G_OBJECT_CLASS(SUPER_CLASS)->dispose(object);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment