From fefa4b9191e82bbd224009fa313bb2347832215e Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Wed, 26 Feb 2020 11:36:09 -0500 Subject: [PATCH] config-endpoint-context: add _get_length API --- modules/module-config-endpoint/context.c | 7 +++++++ modules/module-config-endpoint/context.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/modules/module-config-endpoint/context.c b/modules/module-config-endpoint/context.c index d0701895..d4ce3f1f 100644 --- a/modules/module-config-endpoint/context.c +++ b/modules/module-config-endpoint/context.c @@ -295,3 +295,10 @@ wp_config_endpoint_context_new (WpCore *core) "core", core, NULL); } + +guint +wp_config_endpoint_context_get_length (WpConfigEndpointContext *self) +{ + g_return_val_if_fail (WP_IS_CONFIG_ENDPOINT_CONTEXT (self), 0); + return g_hash_table_size (self->registered_endpoints); +} diff --git a/modules/module-config-endpoint/context.h b/modules/module-config-endpoint/context.h index b09e98ab..1336546c 100644 --- a/modules/module-config-endpoint/context.h +++ b/modules/module-config-endpoint/context.h @@ -19,6 +19,8 @@ G_DECLARE_FINAL_TYPE (WpConfigEndpointContext, wp_config_endpoint_context, WpConfigEndpointContext * wp_config_endpoint_context_new (WpCore *core); +guint wp_config_endpoint_context_get_length (WpConfigEndpointContext *self); + G_END_DECLS #endif