Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New function: xbt_host_copy (even if it's trivial)
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 22 May 2006 18:47:04 +0000 (18:47 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 22 May 2006 18:47:04 +0000 (18:47 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2281 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/xbt/host.h
src/xbt/xbt_host.c

index 6351287..8fd25a2 100644 (file)
@@ -22,6 +22,7 @@ typedef struct {
 
 xbt_host_t xbt_host_new(const char *name, int port);
 xbt_host_t xbt_host_from_string(const char *hostport);
 
 xbt_host_t xbt_host_new(const char *name, int port);
 xbt_host_t xbt_host_from_string(const char *hostport);
+xbt_host_t xbt_host_copy(xbt_host_t h);
 void xbt_host_free(xbt_host_t host);
 void xbt_host_free_voidp(void *d);
 
 void xbt_host_free(xbt_host_t host);
 void xbt_host_free_voidp(void *d);
 
index d9c30e3..d1b3930 100644 (file)
@@ -21,6 +21,10 @@ xbt_host_t xbt_host_new(const char *name, int port)  {
    return res;
 }
 
    return res;
 }
 
+xbt_host_t xbt_host_copy(xbt_host_t h) {
+   return xbt_host_new(h->name,h->port);
+}
+
 /** \brief constructor. Argument should be of form '<hostname>:<port>'. */
 xbt_host_t xbt_host_from_string(const char *hostport)  {
    xbt_host_t res=xbt_new(s_xbt_host_t, 1);
 /** \brief constructor. Argument should be of form '<hostname>:<port>'. */
 xbt_host_t xbt_host_from_string(const char *hostport)  {
    xbt_host_t res=xbt_new(s_xbt_host_t, 1);