Browse code

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 authored on 26/10/2005 07:14:54
Showing 4 changed files
... ...
@@ -164,5 +164,6 @@ char* print_routeset(char* buf, dlg_t* _d);
164 164
  * added by dcm
165 165
  */
166 166
 int w_calculate_hooks(dlg_t* _d);
167
+typedef int (*calculate_hooks_f)(dlg_t* _d);
167 168
 
168 169
 #endif /* DLG_H */
... ...
@@ -252,6 +252,7 @@ static cmd_export_t cmds[]={
252 252
 	{"free_dlg",           (cmd_function)free_dlg,          NO_SCRIPT,   0, 0},
253 253
 	{"print_dlg",          (cmd_function)print_dlg,         NO_SCRIPT,   0, 0},
254 254
 	{T_GETT,               (cmd_function)get_t,             NO_SCRIPT,   0,0},
255
+	{"calculate_hooks",    (cmd_function)w_calculate_hooks, NO_SCRIPT,   0, 0},
255 256
 	{0,0,0,0,0}
256 257
 };
257 258
 
... ...
@@ -140,6 +140,10 @@ int load_tm( struct tm_binds *tmb)
140 140
 		LOG( L_ERR, LOAD_ERROR "'" T_GETT "' not found\n");
141 141
 		return -1;
142 142
 	}
143
+	if (!(tmb->calculate_hooks=(calculate_hooks_f)find_export("calculate_hooks",NO_SCRIPT,0))) {
144
+		LOG( L_ERR, LOAD_ERROR "' calculate_hooks ' not found\n");
145
+		return -1;
146
+	}
143 147
 
144 148
 	tmb->route_mode = &rmode;
145 149
 	return 1;
... ...
@@ -98,6 +98,7 @@ struct tm_binds {
98 98
 	free_dlg_f         free_dlg;
99 99
 	print_dlg_f        print_dlg;
100 100
 	tgett_f            t_gett;
101
+	calculate_hooks_f  calculate_hooks;
101 102
 	enum route_mode*   route_mode;
102 103
 };
103 104