Implement data ack in CADET MQ API
[oweals/gnunet.git] / src / include / gnunet_common.h
index dcd0c605685697ebbd7e8054ba7d3b363c7a7ddb..fdcae66fa19e9cc71dd6bc4e1bf89d03b108fa26 100644 (file)
@@ -66,7 +66,7 @@ extern "C"
 /**
  * Version of the API (for entire gnunetutil.so library).
  */
-#define GNUNET_UTIL_VERSION 0x000A0101
+#define GNUNET_UTIL_VERSION 0x000A0102
 
 
 /**
@@ -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).
@@ -652,6 +681,16 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind);
 #define GNUNET_assert_at(cond, f, l) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), f, l); GNUNET_abort_(); } } while(0)
 
 
+/**
+ * @ingroup logging
+ * Use this for fatal errors that cannot be handled
+ *
+ * @param cond Condition to evaluate
+ * @param comp Component string to use for logging
+ */
+#define GNUNET_assert_from(cond, comp) do { if (! (cond)) { GNUNET_log_from(GNUNET_ERROR_TYPE_ERROR, comp, _("Assertion failed at %s:%d.\n"), __FILE__, __LINE__); GNUNET_abort_(); } } while(0)
+
+
 /**
  * @ingroup logging
  * Use this for internal assertion violations that are