3 Copyright (C) 2012 Belledonne Communications SARL
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 void cb_function(void *ctx, lpc2xml_log_level level, const char *msg, va_list list) {
24 const char *header = "";
39 fprintf(stdout, "%s - ", header);
40 vfprintf(stdout, msg, list);
41 fprintf(stdout, "\n");
44 void show_usage(int argc, char *argv[]) {
45 fprintf(stderr, "usage %s convert <lpc_file> <xml_file>\n",
49 int main(int argc, char *argv[]) {
51 show_usage(argc, argv);
55 lpc2xml_context *ctx = lpc2xml_context_new(cb_function, NULL);
56 LpConfig *lpc = lp_config_new(argv[2]);
57 lpc2xml_set_lpc(ctx, lpc);
58 if(strcmp("convert", argv[1]) == 0) {
59 lpc2xml_convert_file(ctx, argv[3]);
61 show_usage(argc, argv);
63 lp_config_destroy(lpc);
64 lpc2xml_context_destroy(ctx);