sblocks
[oweals/gnunet.git] / src / include / gnunet_common.h
index 61b572eb86822141ba1f70265a1b1ac75a4cac14..614fd3824e2c152e764ac329c94c217983e7d669 100644 (file)
@@ -171,10 +171,11 @@ GNUNET_log_from (enum GNUNET_ErrorType kind,
 /**
  * Ignore the next n calls to the log function.
  *
- * @param n number of log calls to ignore, use 0 to
- *  assert that the log skip counter is currently zero.
+ * @param n number of log calls to ignore
+ * @param check_reset GNUNET_YES to assert that the log skip counter is currently zero
  */
-void GNUNET_log_skip (unsigned int n);
+void
+GNUNET_log_skip (unsigned int n, int check_reset);
 
 
 /**
@@ -206,6 +207,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 +229,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 +313,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.