Provide a getter to retrieve from a GOptionGroup the GOptionEntry it contains
Submitted by Francesco Montorsi
Link to original bug (#431021)
Description
I want to support standard GTK options in my program but I don't want to use g_option_ processing macros to parse command line.
Now, when I want to print the help of my program (in response to --help option, and using my own code), I need to be able to get a list of the GTK standard options processed by gtk_init.
Unfortunately gtk_get_option_group() returns a GOptionGroup* which however is completely opaque and has no getters!!
This means that there is no way for GTK users which do not use g_option_* parser facilities to get the list of GTK supported options.
A simple
gint g_option_group_get_entries(GOptionGroup group, GOptionEntry **p) { *p = group->entries; return group->n_entries; }
should do the job.