-changed permissions for created file
[oweals/gnunet.git] / src / rps / rps-test_util.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C)
4
5      GNUnet is free software; you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published
7      by the Free Software Foundation; either version 3, or (at your
8      option) any later version.
9
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      General Public License for more details.
14
15      You should have received a copy of the GNU General Public License
16      along with GNUnet; see the file COPYING.  If not, write to the
17      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18      Boston, MA 02111-1307, USA.
19 */
20
21 /**
22  * @file rps/rps-test_util.h
23  * @brief Some utils faciliating the view into the internals for the sampler
24  *        needed for evaluation
25  * @author Julius Bünger
26  */
27
28 #ifndef RPS_TEST_UTIL_H
29 #define RPS_TEST_UTIL_H
30
31 #ifndef TO_FILE
32 #define TO_FILE
33 #endif /* TO_FILE */
34
35
36 void
37 to_file_ (char *file_name, char *line);
38
39 char * 
40 auth_key_to_string (struct GNUNET_CRYPTO_AuthKey auth_key);
41
42 char * 
43 create_file (const char *name);
44
45 /**
46  * This function is used to facilitate writing important information to disk
47  */
48 #ifdef TO_FILE
49 #  define to_file(file_name, ...) do {char tmp_buf[512];\
50     int size;\
51     size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),__VA_ARGS__);\
52     if (0 > size)\
53       LOG (GNUNET_ERROR_TYPE_WARNING,\
54            "Failed to create tmp_buf\n");\
55     else\
56       to_file_(file_name,tmp_buf);\
57   } while (0);
58 #else /* TO_FILE */
59 #  define to_file(file_name, ...)
60 #endif /* TO_FILE */
61
62 #endif /* RPS_TEST_UTIL_H */
63 /* end of gnunet-service-rps.c */