+/**
+ * \brief Returns the link list
+ *
+ * Use SD_link_get_number() to know the array size.
+ *
+ * \return an array of \ref SD_link_t containing all links
+ * \see SD_link_get_number()
+ */
+const SD_link_t *SD_link_get_list(void)
+{
+
+ xbt_dict_cursor_t cursor;
+ char *key;
+ void *data;
+ int i;
+
+ SD_CHECK_INIT_DONE();
+ xbt_assert0(SD_link_get_number() > 0, "There is no link!");
+
+ if (sd_global->link_list == NULL) { /* this is the first time the function is called */
+ sd_global->link_list = xbt_new(SD_link_t, sd_global->link_count);
+
+ i = 0;
+ xbt_dict_foreach(sd_global->links, cursor, key, data) {
+ sd_global->link_list[i++] = (SD_link_t) data;
+ }
+ }
+ return sd_global->link_list;
+}
+
+/**
+ * \brief Returns the number of links
+ *
+ * \return the number of existing links
+ * \see SD_link_get_list()
+ */
+int SD_link_get_number(void)
+{
+ SD_CHECK_INIT_DONE();
+ return sd_global->link_count;
+}
+