2 This file is part of GNUnet.
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero 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.
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 Affero General Public License for more details.
17 * @file rps/rps-test_util.h
18 * @brief Some utils faciliating the view into the internals for the sampler
19 * needed for evaluation
20 * @author Julius Bünger
23 #ifndef RPS_TEST_UTIL_H
24 #define RPS_TEST_UTIL_H
32 to_file_ (const char *file_name, char *line);
35 auth_key_to_string (struct GNUNET_CRYPTO_AuthKey auth_key);
37 struct GNUNET_CRYPTO_AuthKey
38 string_to_auth_key (const char *str);
41 create_file (const char *name);
44 * This function is used to facilitate writing important information to disk
47 # define to_file(file_name, ...) do {char tmp_buf[512];\
49 size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),__VA_ARGS__);\
51 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
52 "Failed to create tmp_buf\n");\
54 to_file_(file_name,tmp_buf);\
56 # define to_file_w_len(file_name, len, ...) do {char tmp_buf[len];\
58 size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),__VA_ARGS__);\
60 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
61 "Failed to create tmp_buf\n");\
63 to_file_(file_name,tmp_buf);\
66 # define to_file(file_name, ...)
67 # define to_file_w_len(file_name, len, ...)
71 store_prefix_file_name (const struct GNUNET_PeerIdentity *peer,
74 #endif /* RPS_TEST_UTIL_H */
75 /* end of gnunet-service-rps.c */