passes
[oweals/gnunet.git] / src / include / gnunet_common.h
index 61b572eb86822141ba1f70265a1b1ac75a4cac14..aacf6328a84a72f07938f59f5e5757e3b64df9f9 100644 (file)
@@ -206,6 +206,17 @@ void GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls);
 void GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls);
 
 
+/**
+ * Convert a hash value to a string (for printing debug messages).
+ * 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 (const GNUNET_HashCode *hc);
+
+
 /**
  * Convert a peer identity to a string (for printing debug messages).
  * This is one of the very few calls in the entire API that is
@@ -217,6 +228,20 @@ void GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls);
  */
 const char *GNUNET_i2s (const struct GNUNET_PeerIdentity *pid);
 
+
+/**
+ * Convert a "struct sockaddr*" (IPv4 or IPv6 address) to a string
+ * (for printing debug messages).  This is one of the very few calls
+ * in the entire API that is NOT reentrant!
+ *
+ * @param addr the address
+ * @param addrlen the length of the address
+ * @return nicely formatted string for the address
+ *  will be overwritten by next call to GNUNET_a2s.
+ */
+const char *GNUNET_a2s (const struct sockaddr *addr,
+                       socklen_t addrlen);
+
 /**
  * Convert error type to string.
  *
@@ -287,7 +312,7 @@ unsigned long long GNUNET_htonll (unsigned long long n);
 /**
  * Maximum allocation with GNUNET_malloc macro.
  */
-#define GNUNET_MAX_GNUNET_MALLOC_CHECKED (1024 * 1024 * 40)
+#define GNUNET_MAX_MALLOC_CHECKED (1024 * 1024 * 40)
 
 /**
  * Wrapper around malloc. Allocates size bytes of memory.