taler-exchange-helper-sanctions-dummy.c (1921B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2025 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 taler-exchange-helper-sanctions-dummy.c 18 * @brief sanction list evaluation simulator with a dummy implementation 19 * @author Christian Grothoff 20 * @defgroup request Request handling routines 21 */ 22 #include "taler/platform.h" 23 #include <gnunet/gnunet_util_lib.h> 24 #include <jansson.h> 25 #include "taler/taler_json_lib.h" 26 #include "taler/taler_templating_lib.h" 27 #include "taler/taler_util.h" 28 29 30 /** 31 * The main function of the taler-exchange-helper-sanctions-dummy. 32 * 33 * @param argc number of arguments from the command line 34 * @param argv command line arguments 35 * @return 0 ok, non-zero on error 36 */ 37 int 38 main (int argc, 39 char *const *argv) 40 { 41 double confidence = 0.0; 42 double match = 1.0; 43 json_t *input; 44 json_error_t err; 45 46 while (NULL != (input = json_loadf (stdin, 47 JSON_DISABLE_EOF_CHECK, 48 &err))) 49 { 50 if (! json_is_object (input)) 51 { 52 json_decref (input); 53 return 1; 54 } 55 json_decref (input); 56 fprintf (stdout, 57 "%f %f dummy\n", 58 match, 59 confidence); 60 fflush (stdout); 61 } 62 return 0; 63 } 64 65 66 /* end of taler-exchange-helper-sanctions-dummy.c */