mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 22:46:15 +01:00
Add the G_OPTION_ENTRY_NULL macro to properly initialize GOptionEntry arrays
This commit is contained in:
parent
c0b339372c
commit
2e4524cd36
@ -1649,6 +1649,7 @@ GOptionArg
|
|||||||
GOptionFlags
|
GOptionFlags
|
||||||
G_OPTION_REMAINING
|
G_OPTION_REMAINING
|
||||||
GOptionEntry
|
GOptionEntry
|
||||||
|
G_OPTION_ENTRY_NULL
|
||||||
g_option_context_add_main_entries
|
g_option_context_add_main_entries
|
||||||
GOptionGroup
|
GOptionGroup
|
||||||
g_option_context_add_group
|
g_option_context_add_group
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
* { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
|
* { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
|
||||||
* { "beep", 'b', 0, G_OPTION_ARG_NONE, &beep, "Beep when done", NULL },
|
* { "beep", 'b', 0, G_OPTION_ARG_NONE, &beep, "Beep when done", NULL },
|
||||||
* { "rand", 0, 0, G_OPTION_ARG_NONE, &randomize, "Randomize the data", NULL },
|
* { "rand", 0, 0, G_OPTION_ARG_NONE, &randomize, "Randomize the data", NULL },
|
||||||
* { NULL }
|
* G_OPTION_ENTRY_NULL
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* int
|
* int
|
||||||
|
@ -286,6 +286,24 @@ struct _GOptionEntry
|
|||||||
*/
|
*/
|
||||||
#define G_OPTION_REMAINING ""
|
#define G_OPTION_REMAINING ""
|
||||||
|
|
||||||
|
/**
|
||||||
|
* G_OPTION_ENTRY_NULL:
|
||||||
|
*
|
||||||
|
* A #GOptionEntry array requires a %NULL terminator, this macro can
|
||||||
|
* be used as terminator instead of an explicit `{ 0 }` but it cannot
|
||||||
|
* be assigned to a variable.
|
||||||
|
*
|
||||||
|
* |[
|
||||||
|
* GOptionEntry option[] = { G_OPTION_ENTRY_NULL };
|
||||||
|
* ]|
|
||||||
|
*
|
||||||
|
* Since: 2.70
|
||||||
|
*/
|
||||||
|
#define G_OPTION_ENTRY_NULL \
|
||||||
|
GLIB_AVAILABLE_MACRO_IN_2_70 \
|
||||||
|
{ NULL, 0, 0, 0, NULL, NULL, NULL }
|
||||||
|
|
||||||
|
|
||||||
GLIB_AVAILABLE_IN_ALL
|
GLIB_AVAILABLE_IN_ALL
|
||||||
GOptionContext *g_option_context_new (const gchar *parameter_string);
|
GOptionContext *g_option_context_new (const gchar *parameter_string);
|
||||||
GLIB_AVAILABLE_IN_ALL
|
GLIB_AVAILABLE_IN_ALL
|
||||||
|
Loading…
Reference in New Issue
Block a user