Merge branch 'master' of ssh://gnunet.org/gnunet
[oweals/gnunet.git] / src / include / gnunet_common.h
index 62ae499e221d9f9698503a8d41408a4b3b670a59..bda011fb2b6579c2c634ad5b0ad50ee70bebb42a 100644 (file)
@@ -391,7 +391,7 @@ GNUNET_get_log_call_status (int caller_level,
  */
 void
 GNUNET_log_nocheck (enum GNUNET_ErrorType kind, const char *message, ...)
-  __attribute__ ((format (printf, 2, 3)));
+  __attribute__ ((format (gnu_printf, 2, 3)));
 
 /* from glib */
 #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
@@ -556,6 +556,19 @@ GNUNET_logger_remove (GNUNET_Logger logger,
                       void *logger_cls);
 
 
+/**
+ * @ingroup logging
+ * Convert a short 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 shc the hash code
+ * @return string
+ */
+const char *
+GNUNET_sh2s (const struct GNUNET_ShortHashCode *shc);
+
+
 /**
  * @ingroup logging
  * Convert a hash value to a string (for printing debug messages).
@@ -597,6 +610,22 @@ const char *
 GNUNET_i2s (const struct GNUNET_PeerIdentity *pid);
 
 
+/**
+ * @ingroup logging
+ * 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
+ * NOT reentrant!  Identical to #GNUNET_i2s(), except that another
+ * buffer is used so both #GNUNET_i2s() and #GNUNET_i2s2() can be
+ * used within the same log statement.
+ *
+ * @param pid the peer identity
+ * @return string form of the pid; will be overwritten by next
+ *         call to #GNUNET_i2s().
+ */
+const char *
+GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid);
+
+
 /**
  * @ingroup logging
  * Convert a peer identity to a string (for printing debug messages).
@@ -655,7 +684,7 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind);
 /**
  * @ingroup logging
  * Use this for fatal errors that cannot be handled
- * 
+ *
  * @param cond Condition to evaluate
  * @param comp Component string to use for logging
  */