mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-01 11:26:37 +02:00
gobject: Add g_{param_spec,signal}_is_valid_name() functions
Making this validation code public allows projects to validate a GParamSpec name before creating it. While hard-coded GParamSpec don't need this, we can't afford crashing the main program for dynamically generated GParamSpec from user-created data. In such case, we will need to validate the param names and return errors instead of trying to create a GParamSpec with invalid names. Includes modifications from Philip Withnall and Emmanuele Bassi to rearrange the new function addition and split it into one function for GParamSpecs and one for GSignals.
This commit is contained in:
@@ -395,6 +395,9 @@ GLIB_AVAILABLE_IN_ALL
|
||||
GType g_param_type_register_static (const gchar *name,
|
||||
const GParamSpecTypeInfo *pspec_info);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gboolean g_param_spec_is_valid_name (const gchar *name);
|
||||
|
||||
/* For registering builting types */
|
||||
GType _g_param_type_register_static_constant (const gchar *name,
|
||||
const GParamSpecTypeInfo *pspec_info,
|
||||
|
Reference in New Issue
Block a user