dl_instance_t const *parent; //!< Parent module's instance (if any).
};
-#define DL_DICT_PRIORITY 11 //!< Callback priority for dictionary autoloading
-#define DL_DICT_ATTR_PRIORITY 10 //!< Callback priority for attribute resolution
-#define DL_INSTANTIATE_PRIORITY 5 //!< Callback priority for bootstrap callback
-
+/** Callback priorities
+ *
+ * The higher the priority, the earlier in callback gets called.
+ */
+#define DL_PRIORITY_DICT 30 //!< Callback priority for dictionary autoloading
+#define DL_PRIORITY_DICT_ATTR 20 //!< Callback priority for attribute resolution
+#define DL_PRIORITY_INSTANTIATE 10 //!< Callback priority for bootstrap callback
int dl_loader_init(TALLOC_CTX *ctx, char const *lib_dir);
goto error;
}
- if (dl_symbol_init_cb_register(DL_INSTANTIATE_PRIORITY, NULL, dl_load_func, NULL) < 0) {
+ if (dl_symbol_init_cb_register(DL_PRIORITY_INSTANTIATE, NULL, dl_load_func, NULL) < 0) {
ERROR("Failed registering load() callback");
goto error;
}
- if (dl_symbol_free_cb_register(DL_INSTANTIATE_PRIORITY, NULL, dl_unload_func, NULL) < 0) {
+ if (dl_symbol_free_cb_register(DL_PRIORITY_INSTANTIATE, NULL, dl_unload_func, NULL) < 0) {
ERROR("Failed registering unload() callback");
goto error;
}
/*
* Register dictionary autoload callbacks
*/
- dl_symbol_init_cb_register(DL_DICT_ATTR_PRIORITY, "dict_attr", _module_dict_attr_autoload, NULL);
- dl_symbol_init_cb_register(DL_DICT_PRIORITY, "dict", _module_dict_autoload, NULL);
- dl_symbol_free_cb_register(DL_DICT_PRIORITY, "dict", _module_dict_autofree, NULL);
+ dl_symbol_init_cb_register(DL_PRIORITY_DICT_ATTR, "dict_attr", _module_dict_attr_autoload, NULL);
+ dl_symbol_init_cb_register(DL_PRIORITY_DICT, "dict", _module_dict_autoload, NULL);
+ dl_symbol_free_cb_register(DL_PRIORITY_DICT, "dict", _module_dict_autofree, NULL);
/* Read the configuration file */
snprintf(buffer, sizeof(buffer), "%.200s/%.50s.conf", config->raddb_dir, config->name);