frosix

Multiparty signature service (experimental)
Log | Files | Refs | README | LICENSE

frosix-config.c (2242B)


      1 /*
      2      This file is part of Frosix.
      3      Copyright (C) 2012-2021 Anastasis Systems SA
      4 
      5      Frosix is free software: you can redistribute it and/or modify it
      6      under the terms of the GNU General Public License as published
      7      by the Free Software Foundation, either version 3 of the License,
      8      or (at your option) any later version.
      9 
     10      Frosix is distributed in the hope that it will be useful, but
     11      WITHOUT ANY WARRANTY; without even the implied warranty of
     12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13      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, see <http://www.gnu.org/licenses/>.
     17 
     18      SPDX-License-Identifier: AGPL3.0-or-later
     19  */
     20 /**
     21  * @file util/frosix-config.c
     22  * @brief tool to access and manipulate Frosix configuration files
     23  * @author Christian Grothoff
     24  */
     25 #include "platform.h"
     26 #include "frosix_util_lib.h"
     27 
     28 
     29 /**
     30  * Program to manipulate configuration files.
     31  *
     32  * @param argc number of arguments from the command line
     33  * @param argv command line arguments
     34  * @return 0 ok, 1 on error
     35  */
     36 int
     37 main (int argc,
     38       char *const *argv)
     39 {
     40   struct GNUNET_CONFIGURATION_ConfigSettings cs = {
     41     .api_version = GNUNET_UTIL_VERSION,
     42     .global_ret = EXIT_SUCCESS
     43   };
     44   struct GNUNET_GETOPT_CommandLineOption options[] = {
     45     GNUNET_GETOPT_OPTION_END
     46   };
     47   enum GNUNET_GenericReturnValue ret;
     48 
     49   if (GNUNET_OK !=
     50       GNUNET_STRINGS_get_utf8_args (argc, argv,
     51                                     &argc, &argv))
     52     return EXIT_FAILURE;
     53   FROSIX_OS_init ();
     54   ret = GNUNET_PROGRAM_run (argc,
     55                             argv,
     56                             "frosix-config [OPTIONS]",
     57                             gettext_noop (
     58                               "Manipulate Frosix configuration files"),
     59                             options,
     60                             &GNUNET_CONFIGURATION_config_tool_run,
     61                             &cs);
     62   GNUNET_free_nz ((void *) argv);
     63   GNUNET_CONFIGURATION_config_settings_free (&cs);
     64   if (GNUNET_NO == ret)
     65     return 0;
     66   if (GNUNET_SYSERR == ret)
     67     return EXIT_INVALIDARGUMENT;
     68   return cs.global_ret;
     69 }
     70 
     71 
     72 /* end of frosix-config.c */