From: Murray Cumming Date: Sat, 5 Mar 2011 13:53:52 +0000 (+0100) Subject: gtk_init*(): Document that argc/argv can be 0,NULL. X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=5b347db1af73e19d41016a7e3d699c262d147c18;p=~andy%2Fgtk gtk_init*(): Document that argc/argv can be 0,NULL. * gtk/gtkmain.c: (gtk_init): Mention that argc and argv can be 0, using the new text from the g_applicatoin_run() documentation. There was already introspection annotation about that. (gtk_init_check, gtk_init_with_args): Use the same text here. See bug #643649 comment 2. --- diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 47af37774..9eda5a9f4 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -985,9 +985,12 @@ gtk_get_option_group (gboolean open_default_display) /** * gtk_init_with_args: - * @argc: a pointer to the number of command line arguments - * @argv: (inout) (array length=argc): a pointer to the array of - * command line arguments + * @argc: (inout): Address of the argc parameter of + * your main() function (or 0 if @argv is %NULL). This will be changed if + * any arguments were handled. + * @argv: (array length=argc) (inout) (allow-none): Address of the + * argv parameter of main(), or %NULL. Any options + * understood by GTK+ are stripped before return. * @parameter_string: a string which is displayed in * the first line of output, after * programname [OPTION...] @@ -1102,10 +1105,11 @@ gtk_parse_args (int *argc, /** * gtk_init_check: * @argc: (inout): Address of the argc parameter of - * your main() function. Changed if any arguments were handled + * your main() function (or 0 if @argv is %NULL). This will be changed if + * any arguments were handled. * @argv: (array length=argc) (inout) (allow-none): Address of the - * argv parameter of main() - * Any parameters understood by gtk_init() are stripped before return + * argv parameter of main(), or %NULL. Any options + * understood by GTK+ are stripped before return. * * This function does the same work as gtk_init() with only a single * change: It does not terminate the program if the windowing system @@ -1135,15 +1139,20 @@ gtk_init_check (int *argc, /** * gtk_init: * @argc: (inout): Address of the argc parameter of - * your main() function. Changed if any arguments were handled + * your main() function (or 0 if @argv is %NULL). This will be changed if + * any arguments were handled. * @argv: (array length=argc) (inout) (allow-none): Address of the - * argv parameter of main(). Any options + * argv parameter of main(), or %NULL. Any options * understood by GTK+ are stripped before return. * * Call this function before using any other GTK+ functions in your GUI * applications. It will initialize everything needed to operate the * toolkit and parses some standard command line options. * + * Although you are expected to pass the @argc, @argv parameters from main() to + * this function, it is possible to pass %NULL if @argv is not available or + * commandline handling is not required. + * * @argc and @argv are adjusted accordingly so your own code will * never see those standard arguments. *