root/devel/scratch.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. main

   1 /*
   2  * Copyright 2004-2021 the Pacemaker project contributors
   3  *
   4  * The version control history for this file may have further details.
   5  *
   6  * This source code is licensed under the GNU General Public License version 2
   7  * or later (GPLv2+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #include <crm_internal.h>
  11 
  12 #include <sys/param.h>
  13 #include <stdio.h>
  14 #include <sys/types.h>
  15 #include <sys/stat.h>
  16 #include <unistd.h>
  17 
  18 #include <stdlib.h>
  19 #include <errno.h>
  20 #include <fcntl.h>
  21 
  22 #include <crm/crm.h>
  23 #include <crm/cib.h>
  24 
  25 #define OPTARGS "X:"
  26 
  27 int
  28 main(int argc, char **argv)
     /* [previous][next][first][last][top][bottom][index][help] */
  29 {
  30     int flag;
  31     xmlNode *top = NULL;
  32     const char *xml_file = NULL;
  33 
  34     crm_log_init(NULL, LOG_TRACE, FALSE, TRUE, argc, argv, FALSE);
  35     while (1) {
  36         flag = getopt(argc, argv, OPTARGS);
  37         if (flag == -1)
  38             break;
  39 
  40         switch (flag) {
  41             case 'X':
  42                 xml_file = optarg;
  43                 break;
  44             default:
  45                 printf("Unknown option: -%c\n", flag);
  46                 break;
  47         }
  48     }
  49 
  50     top = filename2xml(xml_file);
  51     free_xml(top);
  52     return 0;
  53 }

/* [previous][next][first][last][top][bottom][index][help] */