donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

donau-httpd_get-config.c (1802B)


      1 /*
      2   This file is part of TALER
      3   Copyright (C) 2024 Taler Systems SA
      4 
      5   TALER is free software; you can redistribute it and/or modify it under the
      6   terms of the GNU Affero General Public License as published by the Free Software
      7   Foundation; either version 3, or (at your option) any later version.
      8 
      9   TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11   A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
     12 
     13   You should have received a copy of the GNU Affero General Public License along with
     14   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 */
     16 /**
     17  * @file donau-httpd_get-config.c
     18  * @brief Handle /config requests
     19  * @author Christian Grothoff
     20  */
     21 #include <donau_config.h>
     22 #include <gnunet/gnunet_json_lib.h>
     23 #include <taler/taler_dbevents.h>
     24 #include "donau-httpd_get-config.h"
     25 #include <taler/taler_json_lib.h>
     26 #include <taler/taler_mhd_lib.h>
     27 #include <jansson.h>
     28 
     29 
     30 enum MHD_Result
     31 DH_handler_get_config (struct DH_RequestContext *rc,
     32                        const char *const args[])
     33 {
     34   static struct MHD_Response *resp;
     35 
     36   (void) args;
     37   if (NULL == resp)
     38   {
     39     resp = TALER_MHD_MAKE_JSON_PACK (
     40       GNUNET_JSON_pack_string ("currency",
     41                                DH_currency),
     42       GNUNET_JSON_pack_string ("name",
     43                                "donau"),
     44       GNUNET_JSON_pack_string ("legal_domain",
     45                                DH_legal_domain),
     46       GNUNET_JSON_pack_string ("version",
     47                                DONAU_PROTOCOL_VERSION));
     48   }
     49   return MHD_queue_response (rc->connection,
     50                              MHD_HTTP_OK,
     51                              resp);
     52 }
     53 
     54 
     55 /* end of donau-httpd_get-config.c */