2 /* Copyright (c) 2009-2014. 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
12 /*FIXME:DELETEstatic XBT_INLINE
13 surf_resource_t surf_resource_new(size_t childsize,
14 surf_model_t model, const char *name,
15 xbt_dict_t props, void_f_pvoid_t free_f)
17 surf_resource_t res = xbt_malloc0(childsize);
19 res->name = xbt_strdup(name);
20 res->properties = props;
25 static XBT_INLINE void surf_resource_free(void *r)
27 surf_resource_t resource = r;
31 xbt_dict_free(&resource->properties);
35 static XBT_INLINE const char *surf_resource_name(const void *resource)
37 return ((surf_resource_t) resource)->name;
40 static XBT_INLINE xbt_dict_t surf_resource_properties(const void *resource)
42 return ((surf_resource_t) resource)->properties;
45 #endif /* SURF_RESOURCE_H */