• Allison Karlitskaya's avatar
    giomodule: add a new "get default" function · 3a7b44c0
    Allison Karlitskaya authored
    _gio_module_get_default() is a very convenient function for modules
    implementing a singleton -- it finds the default module by priority
    subject to override by a given environment variable name, instantiates
    it, and caches the instance for future calls.  It also has the ability
    to query instances for being 'active' using a callback.
    
    It doesn't work very well for non-singletons (like file monitors).
    
    Add a new function _gio_module_get_default_type() that skips the
    instantiation, returning the GType instead.  As a replacement for the
    'active' callback, a vtable offset can be given for a virtual function
    to use to query if a particular backend is supported.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=592211
    3a7b44c0
giomodule-priv.h 1.61 KB