1 /* Copyright (c) 2013-2015. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include "simgrid/host.h"
9 #include "surf/surf_routing.h" // SIMIX_HOST_LEVEL and friends FIXME: make private here
14 #include "simix/smx_host_private.h" // SIMIX_host_destroy. FIXME: killme
15 #include "msg/msg_private.h" // MSG_host_priv_free. FIXME: killme
17 SIMIX_HOST_LEVEL = xbt_lib_add_level(host_lib,SIMIX_host_destroy);
18 MSG_HOST_LEVEL = xbt_lib_add_level(host_lib, (void_f_pvoid_t) __MSG_host_priv_free);
22 // ========== MSG Layer ==============
23 msg_host_priv_t sg_host_msg(sg_host_t host) {
24 return (msg_host_priv_t) xbt_lib_get_level(host, MSG_HOST_LEVEL);
26 void sg_host_msg_set(sg_host_t host, msg_host_priv_t smx_host) {
27 xbt_lib_set(host_lib,host->key,MSG_HOST_LEVEL,smx_host);
29 void sg_host_msg_destroy(sg_host_t host) {
30 xbt_lib_unset(host_lib,host->key,MSG_HOST_LEVEL,1);
33 // ========== Simix layer =============
35 smx_host_priv_t sg_host_simix(sg_host_t host){
36 return (smx_host_priv_t) xbt_lib_get_level(host, SIMIX_HOST_LEVEL);
38 void sg_host_simix_set(sg_host_t host, smx_host_priv_t smx_host) {
39 xbt_lib_set(host_lib,host->key,SIMIX_HOST_LEVEL,smx_host);
41 void sg_host_simix_destroy(sg_host_t host) {
42 xbt_lib_unset(host_lib,host->key,SIMIX_HOST_LEVEL,1);
48 // TODO Auto-generated constructor stub
53 // TODO Auto-generated destructor stub