Ejemplo n.º 1
0
int mod_register(char *path, int *dlflags, void *p1, void *p2)
{
	if(kz_tr_init_buffers()<0)
	{
		LM_ERR("failed to initialize transformations buffers\n");
		return -1;
	}
	return register_trans_mod(path, mod_trans);
}
Ejemplo n.º 2
0
int mod_register(char *path, int *dlflags, void *p1, void *p2)
{
	sr_kemi_modules_add(sr_kemi_pvx_exports);
	if(tr_init_buffers()<0)
	{
		LM_ERR("failed to initialize transformations buffers\n");
		return -1;
	}
	return register_trans_mod(path, mod_trans);
}
Ejemplo n.º 3
0
/* registers a module,  register_f= module register  functions
 * returns <0 on error, 0 on success */
int register_module(struct module_exports* e, char* path, void* handle)
{
	int ret;
	struct sr_module* mod;

	ret=-1;

	/* add module to the list */
	if ((mod=pkg_malloc(sizeof(struct sr_module)))==0){
		LM_ERR("no more pkg memory\n");
		ret=E_OUT_OF_MEM;
		goto error;
	}
	memset(mod,0, sizeof(struct sr_module));
	mod->path=path;
	mod->handle=handle;
	mod->exports=e;
	mod->next=modules;
	modules=mod;

	/* register module pseudo-variables */
	if (e->items) {
		LM_DBG("register_pv: %s\n", e->name);
		if (register_pvars_mod(e->name, e->items)!=0) {
			LM_ERR("failed to register pseudo-variables for module %s\n",
				e->name);
			pkg_free(mod);
			return -1;
		}
	}

	/* register module transformations */
	if (e->trans) {
		LM_DBG("register_trans: %s\n", e->name);
		if (register_trans_mod(e->name, e->trans) !=0) {
			LM_ERR("failed to register transformations for module %s\n",
				e->name);
			pkg_free(mod);
			return -1;
		}
	}

	/* register all module dependencies */
	if (e->deps) {
		ret = add_module_dependencies(mod);
		if (ret != 0) {
			LM_CRIT("failed to add module dependencies [%d]\n", ret);
			return ret;
		}
	}

	return 0;
error:
	return ret;
}
Ejemplo n.º 4
0
int mod_register(char *path, int *dlflags, void *p1, void *p2)
{
	return register_trans_mod(path, mod_trans);
}
Ejemplo n.º 5
0
int mod_register(char *path, int *dlflags, void *p1, void *p2)
{
	sr_kemi_modules_add(sr_kemi_msrp_exports);
	return register_trans_mod(path, mod_trans);
}