28#ifndef RPS_TEST_UTIL_H
29#define RPS_TEST_UTIL_H
65#define to_file(file_name, ...) do { \
66 char tmp_buf[512] = ""; \
68 if (NULL == file_name) break; \
69 size = GNUNET_snprintf (tmp_buf, sizeof(tmp_buf), __VA_ARGS__); \
72 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \
73 "Failed to create tmp_buf\n"); \
76 (void) strncat (tmp_buf, "\n", 511); \
77 GNUNET_DISK_file_write (get_file_handle (file_name), \
79 strnlen (tmp_buf, 512)); \
83#define to_file_w_len(file_name, len, ...) do { char tmp_buf [len]; \
85 memset (tmp_buf, 0, len); \
86 size = GNUNET_snprintf (tmp_buf, \
93 GNUNET_ERROR_TYPE_WARNING, \
94 "Failed to create tmp_buf\n"); \
97 (void) strncat (tmp_buf, "\n", 2); \
98 GNUNET_DISK_file_write ( \
99 get_file_handle (file_name), \
105# define to_file(file_name, ...)
106# define to_file_w_len(file_name, len, ...)
120 unsigned bits_needed);
130uint32_t
fac (uint32_t x);
141uint32_t
binom (uint32_t n, uint32_t k);
static int prefix
If printing the value of PREFIX has been requested.
static char * file_name
Dump file name.
static char * name
Name (label) of the records to list.
char * auth_key_to_string(struct GNUNET_CRYPTO_AuthKey auth_key)
uint32_t fac(uint32_t x)
Factorial.
char * store_prefix_file_name(const unsigned int index, const char *prefix)
void to_file_raw_unaligned(const char *file_name, const char *buf, size_t size_buf, unsigned bits_needed)
int close_all_files()
Close all files that were opened with get_file_handle.
void to_file_raw(const char *file_name, const char *buf, size_t size_buf)
struct GNUNET_CRYPTO_AuthKey string_to_auth_key(const char *str)
struct GNUNET_DISK_FileHandle * get_file_handle(const char *name)
Get file handle.
uint32_t binom(uint32_t n, uint32_t k)
Binomial coefficient (n choose k)
type for (message) authentication keys
Handle used to access files (and pipes).