2 /* Copyright (c) 2009 The SimGrid Team. 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 #ifndef SURF_RESOURCE_H
9 #define SURF_RESOURCE_H
12 surf_resource_t surf_resource_new(size_t childsize,
13 surf_model_t model, char *name, xbt_dict_t props) {
14 surf_resource_t res = xbt_malloc0(childsize);
17 res->properties = props;
21 static XBT_INLINE void surf_resource_free(void* r) {
22 surf_resource_t resource = r;
25 if (resource->properties)
26 xbt_dict_free(&resource->properties);
30 static XBT_INLINE const char *surf_resource_name(const void *resource) {
31 return ((surf_resource_t)resource)->name;
34 static XBT_INLINE xbt_dict_t surf_resource_properties(const void *resource) {
35 return ((surf_resource_t)resource)->properties;
38 #endif /* SURF_RESOURCE_H */