Explorar o código

Exported function for calculating dialog hooks - used by dialog
module. This is only a little hack, in the future will all dialog
functions move into dialog module.

Vaclav Kubart %!s(int64=20) %!d(string=hai) anos
pai
achega
a6fc01ca96
Modificáronse 4 ficheiros con 7 adicións e 0 borrados
  1. 1 0
      modules/tm/dlg.h
  2. 1 0
      modules/tm/tm.c
  3. 4 0
      modules/tm/tm_load.c
  4. 1 0
      modules/tm/tm_load.h

+ 1 - 0
modules/tm/dlg.h

@@ -164,5 +164,6 @@ char* print_routeset(char* buf, dlg_t* _d);
  * added by dcm
  */
 int w_calculate_hooks(dlg_t* _d);
+typedef int (*calculate_hooks_f)(dlg_t* _d);
 
 #endif /* DLG_H */

+ 1 - 0
modules/tm/tm.c

@@ -252,6 +252,7 @@ static cmd_export_t cmds[]={
 	{"free_dlg",           (cmd_function)free_dlg,          NO_SCRIPT,   0, 0},
 	{"print_dlg",          (cmd_function)print_dlg,         NO_SCRIPT,   0, 0},
 	{T_GETT,               (cmd_function)get_t,             NO_SCRIPT,   0,0},
+	{"calculate_hooks",    (cmd_function)w_calculate_hooks, NO_SCRIPT,   0, 0},
 	{0,0,0,0,0}
 };
 

+ 4 - 0
modules/tm/tm_load.c

@@ -140,6 +140,10 @@ int load_tm( struct tm_binds *tmb)
 		LOG( L_ERR, LOAD_ERROR "'" T_GETT "' not found\n");
 		return -1;
 	}
+	if (!(tmb->calculate_hooks=(calculate_hooks_f)find_export("calculate_hooks",NO_SCRIPT,0))) {
+		LOG( L_ERR, LOAD_ERROR "' calculate_hooks ' not found\n");
+		return -1;
+	}
 
 	tmb->route_mode = &rmode;
 	return 1;

+ 1 - 0
modules/tm/tm_load.h

@@ -98,6 +98,7 @@ struct tm_binds {
 	free_dlg_f         free_dlg;
 	print_dlg_f        print_dlg;
 	tgett_f            t_gett;
+	calculate_hooks_f  calculate_hooks;
 	enum route_mode*   route_mode;
 };