1 /*
2 linphone
3 Copyright (C) 2012 Belledonne Communications SARL
4 
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 */
19 
20 #ifndef XML2LPC_H_
21 #define XML2LPC_H_
22 
23 #include "linphone/core.h"
24 
25 typedef struct _xml2lpc_context xml2lpc_context;
26 
27 typedef enum _xml2lpc_log_level {
28 	XML2LPC_DEBUG = 0,
29 	XML2LPC_MESSAGE,
30 	XML2LPC_WARNING,
31 	XML2LPC_ERROR
32 } xml2lpc_log_level;
33 
34 typedef void(*xml2lpc_function)(void *ctx, xml2lpc_log_level level, const char *fmt, va_list list);
35 
36 LINPHONE_PUBLIC xml2lpc_context* xml2lpc_context_new(xml2lpc_function cbf, void *ctx);
37 LINPHONE_PUBLIC void xml2lpc_context_destroy(xml2lpc_context*);
38 
39 LINPHONE_PUBLIC int xml2lpc_set_xml_file(xml2lpc_context* context, const char *filename);
40 LINPHONE_PUBLIC int xml2lpc_set_xml_fd(xml2lpc_context* context, int fd);
41 LINPHONE_PUBLIC int xml2lpc_set_xml_string(xml2lpc_context* context, const char *content);
42 
43 LINPHONE_PUBLIC int xml2lpc_set_xsd_file(xml2lpc_context* context, const char *filename);
44 LINPHONE_PUBLIC int xml2lpc_set_xsd_fd(xml2lpc_context* context, int fd);
45 LINPHONE_PUBLIC int xml2lpc_set_xsd_string(xml2lpc_context* context, const char *content);
46 
47 LINPHONE_PUBLIC int xml2lpc_validate(xml2lpc_context *context);
48 LINPHONE_PUBLIC int xml2lpc_convert(xml2lpc_context *context, LpConfig *lpc);
49 
50 
51 
52 #endif //XML2LPC_H_
53