canonical type, property and signal names and ways to make checking/fixup conditional
Submitted by Stefan Sauer (gstreamer, gtkdoc dev)
Link to original bug (#632034)
Description
1.) Rules for signal, property and type names could be aligned.
types: Such an identifier needs to be at least three characters long. There is no upper length limit. The first character needs to be a letter (a-z or A-Z) or an underscore '_'. Subsequent characters can be letters, numbers or any of '-_+'.
parameters: Parameter names need to start with a letter (a-z or A-Z). Subsequent characters can be letters, numbers or a '-'. All other characters are replaced by a '-' during construction.
signals: A signal name consists of segments consisting of ASCII letters and digits, separated by either the '-' or '_' character. The first character of a signal name must be a letter.
2.) Is it okay to have warnings in all code paths that need to fixup the names? (If okay I make patches).
3.) Can we deprecate alternatives (use either '-' or '_', but don't treat them as alternatives).
4.) Ultimately we could wrap the checking/canonicalization in #ifdef G_DISABLE_CHECKS. any opinions?
Some code pointers:
types (gtype.c): check_type_name_I()
parameters (gparam.c): canonicalize_key() is_canonical()
signals (gsignal.c): g_signal_newv()