diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2023-10-30 19:21:33 +0900 |
---|---|---|
committer | 坂本 貴史 <o-takashi@sakamocchi.jp> | 2023-10-30 21:18:53 +0900 |
commit | 9874ed60fac7281a6843259d50072266a8e57135 (patch) | |
tree | d366083910f85cfb9d34f5f0707087bd73b8bc8d | |
parent | 1d1f735a9e5da3abef5fc2b45d39a176468f18dd (diff) | |
download | libhinoko-9874ed60fac7281a6843259d50072266a8e57135.tar.gz |
fw_iso_resource: remove async suffix from allocation methods
The request of allocation generates completion event. In current
implementation, the method for request has async suffix, and the method to
wait for the event has sync suffix. However, these two keywords are often
heavy use in different contexts and sometimes unfriendly to developers and
users.
This commit renames async methods without any suffix.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r-- | src/fw_iso_resource.c | 22 | ||||
-rw-r--r-- | src/fw_iso_resource.h | 16 | ||||
-rw-r--r-- | src/fw_iso_resource_auto.c | 11 | ||||
-rw-r--r-- | src/fw_iso_resource_once.c | 10 | ||||
-rw-r--r-- | src/hinoko.map | 2 | ||||
-rw-r--r-- | tests/fw-iso-resource | 4 | ||||
-rw-r--r-- | tests/fw-iso-resource-auto | 4 | ||||
-rw-r--r-- | tests/fw-iso-resource-once | 5 |
8 files changed, 38 insertions, 36 deletions
diff --git a/src/fw_iso_resource.c b/src/fw_iso_resource.c index 1d5d8e4..325d901 100644 --- a/src/fw_iso_resource.c +++ b/src/fw_iso_resource.c @@ -168,7 +168,7 @@ gboolean hinoko_fw_iso_resource_create_source(HinokoFwIsoResource *self, GSource } /** - * hinoko_fw_iso_resource_allocate_async: + * hinoko_fw_iso_resource_allocate: * @self: A [iface@FwIsoResource]. * @channel_candidates: (array length=channel_candidates_count): The array with elements for * numeric number of isochronous channel to be allocated. @@ -183,12 +183,12 @@ gboolean hinoko_fw_iso_resource_create_source(HinokoFwIsoResource *self, GSource * * Returns: TRUE if the overall operation finishes successfully, otherwise FALSE. * - * Since: 0.7 + * Since: 1.0 */ -gboolean hinoko_fw_iso_resource_allocate_async(HinokoFwIsoResource *self, - const guint8 *channel_candidates, - gsize channel_candidates_count, - guint bandwidth, GError **error) +gboolean hinoko_fw_iso_resource_allocate(HinokoFwIsoResource *self, + const guint8 *channel_candidates, + gsize channel_candidates_count, guint bandwidth, + GError **error) { g_return_val_if_fail(HINOKO_IS_FW_ISO_RESOURCE(self), FALSE); g_return_val_if_fail(channel_candidates != NULL, FALSE); @@ -196,9 +196,9 @@ gboolean hinoko_fw_iso_resource_allocate_async(HinokoFwIsoResource *self, g_return_val_if_fail(bandwidth > 0, FALSE); g_return_val_if_fail(error == NULL || *error == NULL, FALSE); - return HINOKO_FW_ISO_RESOURCE_GET_IFACE(self)->allocate_async(self, channel_candidates, - channel_candidates_count, - bandwidth, error); + return HINOKO_FW_ISO_RESOURCE_GET_IFACE(self)->allocate(self, channel_candidates, + channel_candidates_count, + bandwidth, error); } /** @@ -234,8 +234,8 @@ gboolean hinoko_fw_iso_resource_allocate_wait(HinokoFwIsoResource *self, fw_iso_resource_waiter_init(&w, self, ALLOCATED_SIGNAL_NAME, timeout_ms); - (void)hinoko_fw_iso_resource_allocate_async(self, channel_candidates, - channel_candidates_count, bandwidth, error); + (void)hinoko_fw_iso_resource_allocate(self, channel_candidates, channel_candidates_count, + bandwidth, error); return fw_iso_resource_waiter_wait(&w, self, error); } diff --git a/src/fw_iso_resource.h b/src/fw_iso_resource.h index 144f6fa..ebcf03e 100644 --- a/src/fw_iso_resource.h +++ b/src/fw_iso_resource.h @@ -36,7 +36,7 @@ struct _HinokoFwIsoResourceInterface { GError **error); /** - * HinokoFwIsoResourceInterface::allocate_async: + * HinokoFwIsoResourceInterface::allocate: * @self: A [iface@FwIsoResource]. * @channel_candidates: (array length=channel_candidates_count): The array with elements for * numeric number of isochronous channel to be allocated. @@ -49,10 +49,10 @@ struct _HinokoFwIsoResourceInterface { * * Returns: TRUE if the overall operation finished successfully, otherwise FALSE. * - * Since: 0.7 + * Since: 1.0 */ - gboolean (*allocate_async)(HinokoFwIsoResource *self, const guint8 *channel_candidates, - gsize channel_candidates_count, guint bandwidth, GError **error); + gboolean (*allocate)(HinokoFwIsoResource *self, const guint8 *channel_candidates, + gsize channel_candidates_count, guint bandwidth, GError **error); /** * HinokoFwIsoResourceInterface::create_source: @@ -106,10 +106,10 @@ gboolean hinoko_fw_iso_resource_open(HinokoFwIsoResource *self, const gchar *pat gboolean hinoko_fw_iso_resource_create_source(HinokoFwIsoResource *self, GSource **source, GError **error); -gboolean hinoko_fw_iso_resource_allocate_async(HinokoFwIsoResource *self, - const guint8 *channel_candidates, - gsize channel_candidates_count, - guint bandwidth, GError **error); +gboolean hinoko_fw_iso_resource_allocate(HinokoFwIsoResource *self, + const guint8 *channel_candidates, + gsize channel_candidates_count, guint bandwidth, + GError **error); gboolean hinoko_fw_iso_resource_allocate_wait(HinokoFwIsoResource *self, const guint8 *channel_candidates, diff --git a/src/fw_iso_resource_auto.c b/src/fw_iso_resource_auto.c index 2c249ce..532e0be 100644 --- a/src/fw_iso_resource_auto.c +++ b/src/fw_iso_resource_auto.c @@ -190,11 +190,10 @@ static gboolean fw_iso_resource_auto_open(HinokoFwIsoResource *inst, const gchar return fw_iso_resource_state_open(&priv->state, path, open_flag, error); } -static gboolean fw_iso_resource_auto_allocate_async(HinokoFwIsoResource *inst, - const guint8 *channel_candidates, - gsize channel_candidates_count, - guint bandwidth, - GError **error) +static gboolean fw_iso_resource_auto_allocate(HinokoFwIsoResource *inst, + const guint8 *channel_candidates, + gsize channel_candidates_count, guint bandwidth, + GError **error) { HinokoFwIsoResourceAuto *self; HinokoFwIsoResourceAutoPrivate *priv; @@ -342,7 +341,7 @@ static gboolean fw_iso_resource_auto_create_source(HinokoFwIsoResource *inst, GS static void fw_iso_resource_iface_init(HinokoFwIsoResourceInterface *iface) { iface->open = fw_iso_resource_auto_open; - iface->allocate_async = fw_iso_resource_auto_allocate_async; + iface->allocate = fw_iso_resource_auto_allocate; iface->create_source = fw_iso_resource_auto_create_source; } diff --git a/src/fw_iso_resource_once.c b/src/fw_iso_resource_once.c index ff26b66..79eacf5 100644 --- a/src/fw_iso_resource_once.c +++ b/src/fw_iso_resource_once.c @@ -71,10 +71,10 @@ static gboolean fw_iso_resource_once_open(HinokoFwIsoResource *inst, const gchar return fw_iso_resource_state_open(&priv->state, path, open_flag, error); } -static gboolean fw_iso_resource_once_allocate_async(HinokoFwIsoResource *inst, - const guint8 *channel_candidates, - gsize channel_candidates_count, - guint bandwidth, GError **error) +static gboolean fw_iso_resource_once_allocate(HinokoFwIsoResource *inst, + const guint8 *channel_candidates, + gsize channel_candidates_count, + guint bandwidth, GError **error) { HinokoFwIsoResourceOnce *self; HinokoFwIsoResourceOncePrivate *priv; @@ -183,7 +183,7 @@ static gboolean fw_iso_resource_once_create_source(HinokoFwIsoResource *inst, GS static void fw_iso_resource_iface_init(HinokoFwIsoResourceInterface *iface) { iface->open = fw_iso_resource_once_open; - iface->allocate_async = fw_iso_resource_once_allocate_async; + iface->allocate = fw_iso_resource_once_allocate; iface->create_source = fw_iso_resource_once_create_source; } diff --git a/src/hinoko.map b/src/hinoko.map index 45ae687..8a56fc4 100644 --- a/src/hinoko.map +++ b/src/hinoko.map @@ -41,7 +41,6 @@ HINOKO_0_7_0 { "hinoko_fw_iso_resource_get_type"; "hinoko_fw_iso_resource_open"; "hinoko_fw_iso_resource_create_source"; - "hinoko_fw_iso_resource_allocate_async"; "hinoko_fw_iso_resource_auto_get_type"; @@ -78,6 +77,7 @@ HINOKO_0_9_0 { } HINOKO_0_8_0; HINOKO_1_0_0 { + "hinoko_fw_iso_resource_allocate"; "hinoko_fw_iso_resource_allocate_wait"; "hinoko_fw_iso_resource_once_deallocate"; diff --git a/tests/fw-iso-resource b/tests/fw-iso-resource index 3f5e2ce..52ebf68 100644 --- a/tests/fw-iso-resource +++ b/tests/fw-iso-resource @@ -16,12 +16,12 @@ props = ( methods = ( 'open', 'create_source', - 'allocate_async', + 'allocate', 'allocate_wait', ) vmethods = ( 'do_open', - 'do_allocate_async', + 'do_allocate', 'do_create_source', 'do_allocated', 'do_deallocated', diff --git a/tests/fw-iso-resource-auto b/tests/fw-iso-resource-auto index 0680e64..cbc908a 100644 --- a/tests/fw-iso-resource-auto +++ b/tests/fw-iso-resource-auto @@ -24,13 +24,13 @@ methods = ( # From interface. 'open', 'create_source', - 'allocate_async', + 'allocate', 'allocate_wait', ) vmethods = ( # From interface. 'do_open', - 'do_allocate_async', + 'do_allocate', 'do_create_source', 'do_allocated', 'do_deallocated', diff --git a/tests/fw-iso-resource-once b/tests/fw-iso-resource-once index 7e49669..2a2c0ee 100644 --- a/tests/fw-iso-resource-once +++ b/tests/fw-iso-resource-once @@ -21,11 +21,14 @@ methods = ( # From interface. 'open', 'create_source', - 'allocate_async', + 'allocate', 'allocate_wait', ) vmethods = ( # From interface. + 'do_open', + 'do_allocate', + 'do_create_source', 'do_allocated', 'do_deallocated', ) |