fix zombie-fest
[oweals/gnunet.git] / src / include / gnunet_peer_lib.h
index b6cba7d32d0cea3609583206cf01bc9067dc492d..78d54a4a8d6d13a8779349e9f0775f2b04e55865 100644 (file)
@@ -1,10 +1,10 @@
 /*
      This file is part of GNUnet.
 /*
      This file is part of GNUnet.
-     (C) 2006, 2009 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2006, 2009 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
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
 
      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.
 */
 
 /**
 */
 
 /**
- * @file include/gnunet_peer_lib.h
- * @brief helper library for interning of peer identifiers
  * @author Christian Grothoff
  * @author Christian Grothoff
+ *
+ * @file
+ * Helper library for interning of peer identifiers
+ *
+ * @defgroup peer  Peer library
+ * Helper library for interning of peer identifiers
+ * @{
  */
 
 #ifndef GNUNET_PEER_LIB_H
  */
 
 #ifndef GNUNET_PEER_LIB_H
@@ -38,11 +43,10 @@ extern "C"
 #endif
 
 /**
 #endif
 
 /**
- * A GNUNET_PEER_Id is simply a shorter
- * version of a "struct GNUNET_PeerIdentifier"
- * that can be used inside of a GNUnet peer
- * to save memory when the same identifier
- * needs to be used over and over again.
+ * A GNUNET_PEER_Id is simply a shorter version of a "struct
+ * GNUNET_PeerIdentifier" that can be used inside of a GNUnet peer to
+ * save memory when the same identifier needs to be used over and over
+ * again.
  */
 typedef unsigned int GNUNET_PEER_Id;
 
  */
 typedef unsigned int GNUNET_PEER_Id;
 
@@ -53,7 +57,8 @@ typedef unsigned int GNUNET_PEER_Id;
  * @param pid identity to find
  * @return the interned identity or 0.
  */
  * @param pid identity to find
  * @return the interned identity or 0.
  */
-GNUNET_PEER_Id GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid);
+GNUNET_PEER_Id
+GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid);
 
 
 /**
 
 
 /**
@@ -63,7 +68,8 @@ GNUNET_PEER_Id GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid);
  * @param pid identity to intern
  * @return the interned identity.
  */
  * @param pid identity to intern
  * @return the interned identity.
  */
-GNUNET_PEER_Id GNUNET_PEER_intern (const struct GNUNET_PeerIdentity * pid);
+GNUNET_PEER_Id
+GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid);
 
 
 /**
 
 
 /**
@@ -72,17 +78,19 @@ GNUNET_PEER_Id GNUNET_PEER_intern (const struct GNUNET_PeerIdentity * pid);
  * @param id identity to change the RC of
  * @param delta how much to change the RC
  */
  * @param id identity to change the RC of
  * @param delta how much to change the RC
  */
-void GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta);
+void
+GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta);
 
 
 /**
  * Decrement multiple RCs of peer identities by one.
 
 
 /**
  * Decrement multiple RCs of peer identities by one.
- * 
+ *
  * @param ids array of PIDs to decrement the RCs of
  * @param ids array of PIDs to decrement the RCs of
- * @param count size of the ids array
+ * @param count size of the @a ids array
  */
  */
-void GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id * ids, 
-                               unsigned int count);
+void
+GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids,
+                           unsigned int count);
 
 
 /**
 
 
 /**
@@ -91,10 +99,31 @@ void GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id * ids,
  * @param id interned PID to convert
  * @param pid where to write the normal peer identity
  */
  * @param id interned PID to convert
  * @param pid where to write the normal peer identity
  */
-void GNUNET_PEER_resolve (GNUNET_PEER_Id id,
-                         struct GNUNET_PeerIdentity * pid);
+void
+GNUNET_PEER_resolve (GNUNET_PEER_Id id,
+                     struct GNUNET_PeerIdentity *pid);
+
+
+/**
+ * Convert an interned PID to a normal peer identity.
+ *
+ * @param id interned PID to convert
+ * @return pointer to peer identity, valid as long @a id is valid
+ */
+const struct GNUNET_PeerIdentity *
+GNUNET_PEER_resolve2 (GNUNET_PEER_Id id);
 
 
 
 
+#if 0                           /* keep Emacsens' auto-indent happy */
+{
+#endif
+#ifdef __cplusplus
+}
+#endif
+
 /* ifndef GNUNET_PEER_LIB_H */
 #endif
 /* ifndef GNUNET_PEER_LIB_H */
 #endif
+
+/** @} */  /* end of group */
+
 /* end of gnunet_peer_lib.h */
 /* end of gnunet_peer_lib.h */