Pan gmime-3 / Registering a callback function

Detlef Graef <[email protected]>
Newsgroups gmane.comp.gnome.apps.pan.user
Message-ID <[email protected]>
Hi,

I'm having a look at this issue:

https://gitlab.gnome.org/GNOME/pan/issues/77

I want to register a callback function for GMimeParserOptions:

https://developer.gnome.org/gmime/stable/gmime-GMimeParserOptions.html#g-mime-parser-options-set-warning-callback

with:

g_mime_parser_options_set_warning_callback ()

Is it ok to define a function something like this:


  GMimeParserWarningFunc warning_cb (gint64 offset,
                                     GMimeParserWarning errcode,
                                     const gchar *item,
                                     gpointer user_data)
  {
    // do something with errcode
  }

// -----------

https://developer.gnome.org/gmime/stable/gmime-GMimeParserOptions.html#GMimeParserWarningFunc


How do I pass the callback function warning_cb correctly?

  gpointer user_data = NULL;
  GMimeParserOptions *gmpo  = g_mime_parser_options_new();
  g_mime_parser_options_set_warning_callback (gmpo, warning_cb, user_data);


Hoping someone has some advice for me.



Detlef
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.