/*
* Copyright © 2009 CNRS
- * Copyright © 2009-2012 Inria. All rights reserved.
+ * Copyright © 2009-2014 Inria. All rights reserved.
* Copyright © 2009-2012 Université Bordeaux 1
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
*
* required size. hwloc_snprintf always report the actually required size. */
extern int hwloc_snprintf(char *str, size_t size, const char *format, ...) __hwloc_attribute_format(printf, 3, 4);
+extern void hwloc_obj_add_info_nodup(hwloc_obj_t obj, const char *name, const char *value, int nodup);
+
#endif /* HWLOC_PRIVATE_H */
obj->infos_count++;
}
+void hwloc_obj_add_info_nodup(hwloc_obj_t obj, const char *name, const char *value, int nodup)
+{
+ if (nodup && hwloc_obj_get_info_by_name(obj, name))
+ return;
+ hwloc_obj_add_info(obj, name, value);
+}
+
/* Free an object and all its content. */
void
hwloc_free_unlinked_object(hwloc_obj_t obj)