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.
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * @file rps/rps-test_util.h
21 * @brief Some utils faciliating the view into the internals for the sampler
22 * needed for evaluation
23 * @author Julius Bünger
26 #ifndef RPS_TEST_UTIL_H
27 #define RPS_TEST_UTIL_H
33 to_file_ (const char *file_name, char *line);
36 auth_key_to_string (struct GNUNET_CRYPTO_AuthKey auth_key);
38 struct GNUNET_CRYPTO_AuthKey
39 string_to_auth_key (const char *str);
42 create_file (const char *name);
45 * This function is used to facilitate writing important information to disk
48 # define to_file(file_name, ...) do {char tmp_buf[512];\
50 size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),__VA_ARGS__);\
52 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
53 "Failed to create tmp_buf\n");\
55 to_file_(file_name,tmp_buf);\
57 # define to_file_w_len(file_name, len, ...) do {char tmp_buf[len];\
59 size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),__VA_ARGS__);\
61 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
62 "Failed to create tmp_buf\n");\
64 to_file_(file_name,tmp_buf);\
67 # define to_file(file_name, ...)
68 # define to_file_w_len(file_name, len, ...)
72 store_prefix_file_name (const struct GNUNET_PeerIdentity *peer,
76 to_file_raw (const char *file_name, const char *buf, size_t size_buf);
79 to_file_raw_unaligned (const char *file_name,
82 unsigned bits_needed);
84 #endif /* RPS_TEST_UTIL_H */
85 /* end of gnunet-service-rps.c */