-#ifdef TO_FILE
-/**
- * This function is used to facilitate writing important information to disk
- */
-#define to_file(file_name, ...) do {char tmp_buf[512];\
- int size;\
- size = GNUNET_snprintf(tmp_buf,sizeof(tmp_buf),__VA_ARGS__);\
- if (0 > size)\
- LOG (GNUNET_ERROR_TYPE_WARNING,\
- "Failed to create tmp_buf\n");\
- else\
- to_file_(file_name,tmp_buf);\
-} while (0);
-
-static void
-to_file_ (char *file_name, char *line)
-{
- struct GNUNET_DISK_FileHandle *f;
- char output_buffer[512];
- //size_t size;
- int size;
- size_t size2;
-
-
- if (NULL == (f = GNUNET_DISK_file_open (file_name,
- GNUNET_DISK_OPEN_APPEND |
- GNUNET_DISK_OPEN_WRITE |
- GNUNET_DISK_OPEN_CREATE,
- GNUNET_DISK_PERM_USER_WRITE)))
- {
- LOG (GNUNET_ERROR_TYPE_WARNING,
- "Not able to open file %s\n",
- file_name);
- return;
- }
- size = GNUNET_snprintf (output_buffer,
- sizeof (output_buffer),
- "%llu %s\n",
- GNUNET_TIME_absolute_get ().abs_value_us,
- line);
- if (0 > size)
- {
- LOG (GNUNET_ERROR_TYPE_WARNING,
- "Failed to write string to buffer (size: %i)\n",
- size);
- return;
- }
-
- size2 = GNUNET_DISK_file_write (f, output_buffer, size);
- if (size != size2)
- {
- LOG (GNUNET_ERROR_TYPE_WARNING,
- "Unable to write to file! (Size: %u, size2: %u)\n",
- size,
- size2);
- return;
- }
-
- if (GNUNET_YES != GNUNET_DISK_file_close (f))
- LOG (GNUNET_ERROR_TYPE_WARNING,
- "Unable to close file\n");
-}
-#endif /* TO_FILE */
-
-
-/** FIXME document */
-static struct GetPeerCls *gpc_head;
-static struct GetPeerCls *gpc_tail;
-
-