1 /*
2 * Copyright 2004-2013 the Pacemaker project contributors
3 *
4 * The version control history for this file may have further details.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This software is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <crm_internal.h>
22
23 #include <sys/param.h>
24 #include <stdio.h>
25 #include <sys/types.h>
26 #include <sys/stat.h>
27 #include <unistd.h>
28
29 #include <stdlib.h>
30 #include <errno.h>
31 #include <fcntl.h>
32
33 #include <crm/crm.h>
34 #include <crm/cib.h>
35
36 #define OPTARGS "X:"
37
38 int
39 main(int argc, char **argv)
/* ![[previous]](../icons/n_left.png)
![[next]](../icons/n_right.png)
![[first]](../icons/n_first.png)
![[last]](../icons/n_last.png)
![[top]](../icons/top.png)
![[bottom]](../icons/bottom.png)
![[index]](../icons/index.png)
*/
40 {
41 int flag;
42 xmlNode *top = NULL;
43 const char *xml_file = NULL;
44
45 crm_log_init(NULL, LOG_TRACE, FALSE, TRUE, argc, argv, FALSE);
46 while (1) {
47 flag = getopt(argc, argv, OPTARGS);
48 if (flag == -1)
49 break;
50
51 switch (flag) {
52 case 'X':
53 xml_file = optarg;
54 break;
55 default:
56 printf("Unknown option: -%c\n", flag);
57 break;
58 }
59 }
60
61 top = filename2xml(xml_file);
62 free_xml(top);
63 return 0;
64 }