Mercurial > ~mikael > mcabber > hg
view mcabber/mcabber/modules.h @ 1747:c4f67e2e675f
Randomize reconnection delay
Conforming to rfc3920bis, 4.5:
"The time that expires before an entity first seeks to reconnect MUST be
randomized"
(We should still increase the delay if the reconnection keeps failing.)
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Thu, 11 Mar 2010 22:27:36 +0100 |
parents | 5093b5ca1572 |
children | 7ee390513463 |
line wrap: on
line source
#ifndef __MCABBER_MODULES_H__ #define __MCABBER_MODULES_H__ 1 #include <glib.h> // Module loading process looks like this: // check, if module is loaded // load module (+ run g_module_check_init) // check <modulename>_info variable // check version // load dependencies // run initialization callback // module loaded // ... // run uninitialization callback // unload module (+ run g_module_unload) // unload dependencies // module unloaded typedef void (*module_init_t)(void); typedef void (*module_uninit_t)(void); // public module-describing structure typedef struct { const gchar *mcabber_version; // Contains mcabber version string, that this module is written to work with module_init_t init; // Initialization callback to be called after all dependencies will be loaded module_uninit_t uninit; // Uninitialization callback to be called before module unloading const gchar **requires; // NULL-terminated list of module names, that must be loaded before this module } module_info_t; const gchar *module_load(const gchar *name, gboolean manual, gboolean force); const gchar *module_unload(const gchar *name, gboolean manual, gboolean force); void module_list_print(void); void modules_init(void); void modules_deinit(void); #endif