taler-exchange-helper-sanctions-dummy.c (1853B)
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 <gnunet/gnunet_util_lib.h> 23 #include <jansson.h> 24 #include "taler/taler_json_lib.h" 25 #include "taler/taler_util.h" 26 27 28 /** 29 * The main function of the taler-exchange-helper-sanctions-dummy. 30 * 31 * @param argc number of arguments from the command line 32 * @param argv command line arguments 33 * @return 0 ok, non-zero on error 34 */ 35 int 36 main (int argc, 37 char *const *argv) 38 { 39 double confidence = 0.0; 40 double match = 1.0; 41 json_t *input; 42 json_error_t err; 43 44 while (NULL != (input = json_loadf (stdin, 45 JSON_DISABLE_EOF_CHECK, 46 &err))) 47 { 48 if (! json_is_object (input)) 49 { 50 json_decref (input); 51 return 1; 52 } 53 json_decref (input); 54 fprintf (stdout, 55 "%f %f dummy\n", 56 match, 57 confidence); 58 fflush (stdout); 59 } 60 return 0; 61 } 62 63 64 /* end of taler-exchange-helper-sanctions-dummy.c */