1 /*
2  * This file is part of kamailio, a free SIP server.
3  *
4  * kamailio is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * kamailio is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  *
18  */
19 
20 #ifndef TEXTOPSX_API_H_
21 #define TEXTOPSX_API_H_
22 #include "../../core/str.h"
23 #include "../../core/sr_module.h"
24 
25 
26 /*
27  * Struct with the textopsx api.
28  */
29 typedef struct textopsx_binds
30 {
31 	cmd_function msg_apply_changes;
32 } textopsx_api_t;
33 
34 typedef int (*bind_textopsx_f)(textopsx_api_t *);
35 
36 /*
37  * Function to be called direclty from other modules to load
38  * the textops API.
39  */
load_textopsx_api(textopsx_api_t * tob)40 inline static int load_textopsx_api(textopsx_api_t *tob)
41 {
42 	bind_textopsx_f bind_textopsx_exports;
43 	if(!(bind_textopsx_exports =
44 					   (bind_textopsx_f)find_export("bind_textopsx", 1, 0))) {
45 		LM_ERR("Failed to import bind_textopsx\n");
46 		return -1;
47 	}
48 	return bind_textopsx_exports(tob);
49 }
50 
51 #endif /*TEXTX_OPS_API_H_*/
52