- fix coverity
[oweals/gnunet.git] / src / cadet / cadet.h
index 757f8c5014e8044c96b678f3b446638992771647..df0f02a22b60125760b1e3d758aacf855ad3935b 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2001 - 2011 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2001 - 2011 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 
 /**
@@ -271,7 +271,7 @@ GNUNET_NETWORK_STRUCT_END
  * @return String representing FWD or BCK.
  */
 char *
-GM_f2s (int fwd);
+GC_f2s (int fwd);
 
 
 /**
@@ -283,7 +283,7 @@ GM_f2s (int fwd);
  * @return True if bigger (arg1) has a higher value than smaller (arg 2).
  */
 int
-GM_is_pid_bigger (uint32_t bigger, uint32_t smaller);
+GC_is_pid_bigger (uint32_t bigger, uint32_t smaller);
 
 
 /**
@@ -295,7 +295,7 @@ GM_is_pid_bigger (uint32_t bigger, uint32_t smaller);
  * @return Highest ACK value from the two.
  */
 uint32_t
-GM_max_pid (uint32_t a, uint32_t b);
+GC_max_pid (uint32_t a, uint32_t b);
 
 
 /**
@@ -307,7 +307,7 @@ GM_max_pid (uint32_t a, uint32_t b);
  * @return Lowest ACK value from the two.
  */
 uint32_t
-GM_min_pid (uint32_t a, uint32_t b);
+GC_min_pid (uint32_t a, uint32_t b);
 
 
 /**
@@ -319,14 +319,27 @@ GM_min_pid (uint32_t a, uint32_t b);
  * @return A HashCode containing the original 256 bit hash right-padded with 0.
  */
 const struct GNUNET_HashCode *
-GM_h2hc (const struct GNUNET_CADET_Hash *id);
+GC_h2hc (const struct GNUNET_CADET_Hash *id);
 
 /**
  * Get a string from a Cadet Hash (256 bits).
  * WARNING: Not reentrant (based on GNUNET_h2s).
  */
 const char *
-GM_h2s (const struct GNUNET_CADET_Hash *id);
+GC_h2s (const struct GNUNET_CADET_Hash *id);
+
+
+/**
+ * Allocate a string with a hexdump of any binary data.
+ *
+ * @param bin Arbitrary binary data.
+ * @param len Length of @a bin in bytes.
+ * @param output Where to write the output (if *output be NULL it's allocated).
+ *
+ * @return The size of the output.
+ */
+size_t
+GC_bin2s (void *bin, unsigned int len, char **output);
 
 /**
  * Convert a message type into a string to help debug
@@ -339,7 +352,7 @@ GM_h2s (const struct GNUNET_CADET_Hash *id);
  * @return Human readable string description.
  */
 const char *
-GM_m2s (uint16_t m);
+GC_m2s (uint16_t m);
 
 #if 0                           /* keep Emacsens' auto-indent happy */
 {