along with this program. If not, see <http://www.gnu.org/licenses/>.
SPDX-License-Identifier: AGPL3.0-or-later
-*/
+ */
/**
* @file rps/rps-test_util.h
char *
-auth_key_to_string (struct GNUNET_CRYPTO_AuthKey auth_key);
+auth_key_to_string(struct GNUNET_CRYPTO_AuthKey auth_key);
struct GNUNET_CRYPTO_AuthKey
-string_to_auth_key (const char *str);
+string_to_auth_key(const char *str);
/**
* @return File handle
*/
struct GNUNET_DISK_FileHandle *
-get_file_handle (const char *name);
+get_file_handle(const char *name);
/**
* @brief Close all files that were opened with #get_file_handle
* @return Success of iterating over files
*/
int
-close_all_files ();
+close_all_files();
/**
* This function is used to facilitate writing important information to disk
*/
#ifdef TO_FILE
#define to_file(file_name, ...) do { \
- char tmp_buf[512] = "";\
- int size;\
- if (NULL == file_name) break; \
- size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),__VA_ARGS__);\
- if (0 > size)\
- {\
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
- "Failed to create tmp_buf\n");\
- break;\
- }\
- (void) strncat(tmp_buf,"\n",512);\
- GNUNET_DISK_file_write (get_file_handle (file_name),\
- tmp_buf,\
- strnlen (tmp_buf, 512));\
+ char tmp_buf[512] = ""; \
+ int size; \
+ if (NULL == file_name) break; \
+ size = GNUNET_snprintf (tmp_buf, sizeof(tmp_buf), __VA_ARGS__); \
+ if (0 > size) \
+ { \
+ GNUNET_log(GNUNET_ERROR_TYPE_WARNING, \
+ "Failed to create tmp_buf\n"); \
+ break; \
+ } \
+ (void)strncat(tmp_buf, "\n", 512); \
+ GNUNET_DISK_file_write(get_file_handle(file_name), \
+ tmp_buf, \
+ strnlen(tmp_buf, 512)); \
} while (0);
-#define to_file_w_len(file_name, len, ...) do {char tmp_buf[len];\
- int size;\
- memset (tmp_buf, 0, len);\
- size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),__VA_ARGS__);\
- if (0 > size)\
- {\
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,\
- "Failed to create tmp_buf\n");\
- break;\
- }\
- (void) strncat(tmp_buf,"\n",len);\
- GNUNET_DISK_file_write (get_file_handle (file_name),\
- tmp_buf,\
- strnlen (tmp_buf, len));\
+#define to_file_w_len(file_name, len, ...) do { char tmp_buf [len]; \
+ int size; \
+ memset(tmp_buf, 0, len); \
+ size = GNUNET_snprintf(tmp_buf, sizeof(tmp_buf), __VA_ARGS__); \
+ if (0 > size) \
+ { \
+ GNUNET_log(GNUNET_ERROR_TYPE_WARNING, \
+ "Failed to create tmp_buf\n"); \
+ break; \
+ } \
+ (void)strncat(tmp_buf, "\n", len); \
+ GNUNET_DISK_file_write(get_file_handle(file_name), \
+ tmp_buf, \
+ strnlen(tmp_buf, len)); \
} while (0);
#else /* TO_FILE */
# define to_file(file_name, ...)
#endif /* TO_FILE */
char *
-store_prefix_file_name (const unsigned int index,
- const char *prefix);
+store_prefix_file_name(const unsigned int index,
+ const char *prefix);
void
-to_file_raw (const char *file_name, const char *buf, size_t size_buf);
+to_file_raw(const char *file_name, const char *buf, size_t size_buf);
void
-to_file_raw_unaligned (const char *file_name,
- const char *buf,
- size_t size_buf,
- unsigned bits_needed);
+to_file_raw_unaligned(const char *file_name,
+ const char *buf,
+ size_t size_buf,
+ unsigned bits_needed);
/**
*
* @return Factorial of @a x
*/
-uint32_t fac (uint32_t x);
+uint32_t fac(uint32_t x);
/**
*
* @return Binomial coefficient of @a n and @a k
*/
-uint32_t binom (uint32_t n, uint32_t k);
+uint32_t binom(uint32_t n, uint32_t k);
#endif /* RPS_TEST_UTIL_H */
/* end of gnunet-service-rps.c */