Re: Using G_OPTION_ARG_CALLBACK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le lundi 03 avril 2006 à 12:22 +1000, Randima Niroshini a écrit :
> Hi all,
> 
> I used "G_OPTION_ARG_CALLBACK" to denote one commandline argument, but it gives
> the following error.
> 
> ./parser.cc:95: error: invalid conversion from 'gboolean (*)(const char*, const
> char*, void*, GError**)' to 'void*'
> 
> Am I missing out something here?
> 
> static gboolean
> gparse_cb (const char *key, const char *value, gpointer user_data, GError **error)
> {
>   
> 
>   return TRUE;
> }
> 
> static GOptionEntry options[] = {
>   { "verbose", 0, 0, G_OPTION_ARG_NONE, &gbverbose, "Add verbose output to
> standard log", NULL },
>   { "version", 0, 0, G_OPTION_ARG_NONE, &gbversion, "Print version information
> on standard output", NULL },
>   { "parse", 0, 0, G_OPTION_ARG_CALLBACK, gparse_cb, "Parse the program, print
> errors on standard error", NULL },   
>   {NULL}
> };

use:
  { "parse", 0, 0, G_OPTION_ARG_CALLBACK, (void*) gparse_cb, "Parse the
program, print errors on standard error", NULL },   

You might also use void gparse_cb. AFAIK, the returned value will not be
used.

_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux