From: Pierre Veyre Date: Mon, 15 Jul 2013 17:21:37 +0000 (+0200) Subject: Update msg_storage_t structure and prepare new storage functions X-Git-Tag: v3_9_90~132 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/08d9a6809b424483f0f6579f8a1a5bcea3af40ad Update msg_storage_t structure and prepare new storage functions --- diff --git a/include/msg/datatypes.h b/include/msg/datatypes.h index 53a3c8ce5a..c01b2434c0 100644 --- a/include/msg/datatypes.h +++ b/include/msg/datatypes.h @@ -129,12 +129,8 @@ typedef struct msg_file *msg_file_t; typedef struct simdata_storage *simdata_storage_t; typedef struct msg_storage { - char *model; - char *content_type; - char *type_id; - size_t size; - xbt_dict_t properties; - simdata_storage_t simdata; /**< @brief simulator data */ + char *name; + simdata_storage_t simdata; /**< @brief simulator data */ void *data; /**< @brief user data */ } s_msg_storage_t; diff --git a/include/msg/msg.h b/include/msg/msg.h index 578e222c32..17ed281306 100644 --- a/include/msg/msg.h +++ b/include/msg/msg.h @@ -91,6 +91,8 @@ XBT_PUBLIC(void) __MSG_file_get_info(msg_file_t fd); /************************** Storage handling ***********************************/ XBT_PUBLIC(size_t) MSG_storage_get_free_size(const char* name); XBT_PUBLIC(size_t) MSG_storage_get_used_size(const char* name); +XBT_PUBLIC(msg_storage_t) MSG_storage_get_by_name(const char *name); +XBT_PUBLIC(xbt_dict_t) MSG_storage_get_properties(msg_storage_t storage); /************************** AS Router handling ************************************/ XBT_PUBLIC(const char *) MSG_as_router_get_property_value(const char* asr, const char *name); diff --git a/src/msg/msg_io.c b/src/msg/msg_io.c index 80e48e8750..331c3e3633 100644 --- a/src/msg/msg_io.c +++ b/src/msg/msg_io.c @@ -149,6 +149,8 @@ xbt_dict_t MSG_file_ls(const char *mount, const char *path) return simcall_file_ls(mount, path); } +/********************************* Storage **************************************/ + /** \ingroup msg_storage_management * \brief Return the free space size of a storage element * \param the storage name (#char*) @@ -166,3 +168,29 @@ size_t MSG_storage_get_free_size(const char* name){ size_t MSG_storage_get_used_size(const char* name){ return simcall_storage_get_used_size(name); } + +/** \ingroup msg_storage_management + * \brief Returns a xbt_dict_t consisting of the list of properties assigned to this storage + * \param storage a storage + * \return a dict containing the properties + */ +xbt_dict_t MSG_storage_get_properties(msg_storage_t storage) +{ + xbt_assert((storage != NULL), "Invalid parameters (storage is NULL)"); + + xbt_die( "Not implemented yet"); + return xbt_dict_new(); + //return (simcall_host_get_properties(storage)); +} + +/** \ingroup msg_storage_management + * \brief Finds a msg_storage_t using its name. + * \param name the name of a storage. + * \return the corresponding storage + */ +msg_storage_t MSG_storage_get_by_name(const char *name) +{ + return (msg_storage_t) xbt_lib_get_elm_or_null(host_lib,name); +} + +