h2s_full, useful for testing
[oweals/gnunet.git] / src / include / gnunet_common.h
index 1a6111e27566fd98a690626993f1d4089bf9d574..8703dc3b7870b4b690df43644d76ab07ccc99b0c 100644 (file)
 #ifndef GNUNET_COMMON_H
 #define GNUNET_COMMON_H
 
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef MINGW
+#include "winproc.h"
+#endif
+
 /**
  * Version of the API (for entire gnunetutil.so library).
  */
 #define GNUNET_UTIL_VERSION 0x00000000
 
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/ip.h> /* superset of previous */
-
 /**
  * Name used for "services" that are actually command-line
  * programs invoked by the end user.
@@ -222,6 +228,16 @@ void GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls);
  */
 const char *GNUNET_h2s (const GNUNET_HashCode *hc);
 
+/**
+ * Convert a hash value to a string (for printing debug messages).
+ * This prints all 104 characters of a hashcode!
+ * This is one of the very few calls in the entire API that is
+ * NOT reentrant!
+ *
+ * @param hc the hash code
+ * @return string
+ */
+const char *GNUNET_h2s_full (const GNUNET_HashCode *hc);
 
 /**
  * Convert a peer identity to a string (for printing debug messages).