}
de->inplace_cb_delete_wrapped = &inplace_cb_delete_wrapped;
de->inplace_cb_register_wrapped = &inplace_cb_register_wrapped;
- de->func_init(env, id);
- return 1;
+ return de->func_init(env, id);
}
/** dynlib module deinit */
* Global state for the module.
*/
-typedef void (*func_init_t)(struct module_env*, int);
+typedef int (*func_init_t)(struct module_env*, int);
typedef void (*func_deinit_t)(struct module_env*, int);
typedef void (*func_operate_t)(struct module_qstate*, enum module_ev, int, struct outbound_entry*);
typedef void (*func_inform_t)(struct module_qstate*, int, struct module_qstate*);
/* Init is called when the module is first loaded. It should be used to set up
* the environment for this module and do any other initialisation required. */
-EXPORT void init(struct module_env* env, int id) {
+EXPORT int init(struct module_env* env, int id) {
log_info("dynlib: hello world from init");
struct dynlibmod_env* de = (struct dynlibmod_env*) env->modinfo[id];
de->inplace_cb_register_wrapped(&reply_callback,
NULL, env, id);
struct dynlibmod_env* local_env = env->modinfo[id];
local_env->dyn_env = NULL;
+ return 1;
}
/* Deinit is run as the program is shutting down. It should be used to clean up