From: mquinson Date: Mon, 22 May 2006 18:47:04 +0000 (+0000) Subject: New function: xbt_host_copy (even if it's trivial) X-Git-Tag: v3.3~3077 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f21b4400e959778d4a1200e1b0c1a942715bb95d?hp=951ea664c4e8c3c71712d729fb7abf9115193676 New function: xbt_host_copy (even if it's trivial) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2281 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/xbt/host.h b/include/xbt/host.h index 63512871e5..8fd25a20eb 100644 --- a/include/xbt/host.h +++ b/include/xbt/host.h @@ -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_copy(xbt_host_t h); void xbt_host_free(xbt_host_t host); void xbt_host_free_voidp(void *d); diff --git a/src/xbt/xbt_host.c b/src/xbt/xbt_host.c index d9c30e3770..d1b3930e66 100644 --- a/src/xbt/xbt_host.c +++ b/src/xbt/xbt_host.c @@ -21,6 +21,10 @@ xbt_host_t xbt_host_new(const char *name, int port) { 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 ':'. */ xbt_host_t xbt_host_from_string(const char *hostport) { xbt_host_t res=xbt_new(s_xbt_host_t, 1);