Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add tesh files to test all new collectives
[simgrid.git] / include / xbt / peer.h
1 /* peer.h - peer (remote processes) management functions                    */
2
3 /* Copyright (c) 2006, 2007, 2009, 2010. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #ifndef XBT_PEER_H
10 #define XBT_PEER_H
11
12 #include "xbt/misc.h"
13
14 SG_BEGIN_DECL()
15
16 /** @addtogroup XBT_peer
17  *  \brief Helper functions to manipulate remote hosts
18  *
19  *  This module simply introduces some rather trivial functions to manipulate remote host denomination (in the form hostname:port)
20  *
21  *  @{
22  */
23 /** @brief Object describing a remote host (as name:port) */
24 typedef struct s_xbt_peer *xbt_peer_t;
25
26 /** @brief Structure describing a remote host (as name:port) */
27 typedef struct s_xbt_peer {
28   char *name;
29   int port;
30 } s_xbt_peer_t;
31
32 XBT_PUBLIC(xbt_peer_t) xbt_peer_new(const char *name, int port);
33 XBT_PUBLIC(xbt_peer_t) xbt_peer_from_string(const char *peerport);
34 XBT_PUBLIC(xbt_peer_t) xbt_peer_copy(xbt_peer_t h);
35 XBT_PUBLIC(void) xbt_peer_free(xbt_peer_t peer);
36 XBT_PUBLIC(void) xbt_peer_free_voidp(void *d);
37
38 /** @} */
39 SG_END_DECL()
40 #endif                          /* XBT_PEER_H */