2 /* Copyright (c) 2009, 2010. The SimGrid Team.
3 * All rights reserved. */
5 /* This program is free software; you can redistribute it and/or modify it
6 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #ifndef SURF_RESOURCE_H
10 #define SURF_RESOURCE_H
13 surf_resource_t surf_resource_new(size_t childsize,
14 surf_model_t model, const char *name,
17 surf_resource_t res = xbt_malloc0(childsize);
19 res->name = xbt_strdup(name);
20 res->properties = props;
23 static XBT_INLINE void routing_storage_type_free(void *r)
25 storage_type_t stype = r;
28 xbt_dict_free(&(stype->properties));
29 xbt_dict_free(&(stype->content));
33 static XBT_INLINE void routing_storage_host_free(void *r)
39 static XBT_INLINE void surf_resource_free(void *r)
41 surf_resource_t resource = r;
43 xbt_dict_free(&resource->properties);
47 static XBT_INLINE const char *surf_resource_name(const void *resource)
49 return ((surf_resource_t) resource)->name;
52 static XBT_INLINE xbt_dict_t surf_resource_properties(const void *resource)
54 return ((surf_resource_t) resource)->properties;
57 #endif /* SURF_RESOURCE_H */