3 /* xbt_host_t management functions */
5 /* Copyright (c) 2006 Martin Quinson. All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
10 #include "xbt/sysdep.h"
14 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(host,xbt,"Host management");
16 /** \brief constructor */
17 xbt_host_t xbt_host_new(const char *name, int port) {
18 xbt_host_t res=xbt_new(s_xbt_host_t, 1);
19 res->name = xbt_strdup(name);
24 /** \brief destructor */
25 void xbt_host_free(xbt_host_t host) {
27 if (host->name) free(host->name);
32 /** \brief Freeing function for dynars of xbt_host_t */
33 void xbt_host_free_voidp(void *d) {
34 xbt_host_free( (xbt_host_t) *(void**)d );