gnunet-ext

Template for writing GNUnet extensions
Log | Files | Refs | README | LICENSE

gnunet-ext.c (2805B)


      1 /*
      2      This file is part of GNUnet.
      3      Copyright (C) 20xx GNUnet e.V.
      4 
      5      GNUnet is free software; you can redistribute it and/or modify
      6      it under the terms of the GNU General Public License as published
      7      by the Free Software Foundation; either version 3, or (at your
      8      option) any later version.
      9 
     10      GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
     17      Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     18      Boston, MA 02110-1301, USA.
     19 */
     20 
     21 /**
     22  * @file ext/gnunet-ext.c
     23  * @brief ext tool
     24  * @author
     25  */
     26 #include "gnunet_ext_config.h"
     27 #include <stddef.h>
     28 
     29 #if HAVE_NETINET_IN_H
     30 #include <netinet/in.h>
     31 #endif
     32 
     33 #include <gnunet/gettext.h>
     34 #include <gnunet/gnunet_util_lib.h>
     35 #include "gnunet_ext_service.h"
     36 
     37 static int ret;
     38 
     39 /**
     40  * This structure holds informations about the project.
     41  */
     42 static const struct GNUNET_OS_ProjectData gnunetext_pd =
     43   {
     44    .libname = "libgnunetext",
     45    .project_dirname = "gnunet-ext",
     46    .binary_name = "gnunet-ext",
     47    .env_varname = "GNUNET_EXT_PREFIX",
     48    .base_config_varname = "GNUNET_EXT_BASE_CONFIG",
     49    .bug_email = "gnunet-developers@gnu.org",
     50    .homepage = "http://www.gnu.org/s/gnunet/",
     51    .config_file = "gnunet-ext.conf",
     52    .user_config_file = "~/.config/gnunet-ext.conf",
     53    .version = "1.0",
     54    .is_gnu = 1,
     55    .gettext_domain = PACKAGE,
     56    .gettext_path = NULL,
     57    .agpl_url = "https://gnunet.org/git/gnunet-ext.git",
     58   };
     59 
     60 /**
     61  * Main function that will be run by the scheduler.
     62  *
     63  * @param cls closure
     64  * @param args remaining command-line arguments
     65  * @param cfgfile name of the configuration file used (for saving, can be NULL!)
     66  * @param cfg configuration
     67  */
     68 static void
     69 run (void *cls,
     70      char *const *args,
     71      const char *cfgfile,
     72      const struct GNUNET_CONFIGURATION_Handle *cfg)
     73 {
     74   ret = 0;
     75 }
     76 
     77 
     78 /**
     79  * The main function to ext.
     80  *
     81  * @param argc number of arguments from the command line
     82  * @param argv command line arguments
     83  * @return 0 ok, 1 on error
     84  */
     85 int
     86 main (int argc, char *const *argv)
     87 {
     88   static const struct GNUNET_GETOPT_CommandLineOption options[] = {
     89     GNUNET_GETOPT_OPTION_END
     90   };
     91 
     92   GNUNET_OS_init(&gnunetext_pd);
     93   
     94   return (GNUNET_OK ==
     95           GNUNET_PROGRAM_run (argc,
     96                               argv,
     97                               "gnunet-ext [options [value]]",
     98                               gettext_noop
     99                               ("ext"),
    100                               options, &run, NULL)) ? ret : 1;
    101 }
    102 
    103 /* end of gnunet-ext.c */