-
-#ifdef MSG_USE_DEPRECATED
-/** \ingroup msg_deprecated_functions
- *
- * \brief Return the last value returned by a MSG function (except
- * MSG_get_errno...).
- */
-msg_error_t MSG_get_errno(void)
-{
- return PROCESS_GET_ERRNO();
-}
-
-/** \ingroup msg_deprecated_functions
- * \brief Put a task on a channel of an host and waits for the end of the
- * transmission.
- *
- * This function is used for describing the behavior of a process. It
- * takes three parameter.
- * \param task a #msg_task_t to send on another location. This task
- will not be usable anymore when the function will return. There is
- no automatic task duplication and you have to save your parameters
- before calling this function. Tasks are unique and once it has been
- sent to another location, you should not access it anymore. You do
- not need to call MSG_task_destroy() but to avoid using, as an
- effect of inattention, this task anymore, you definitely should
- renitialize it with #MSG_TASK_UNINITIALIZED. Note that this task
- can be transfered iff it has been correctly created with
- MSG_task_create().
- * \param dest the destination of the message
- * \param channel the channel on which the process should put this
- task. This value has to be >=0 and < than the maximal number of
- channels fixed with MSG_set_channel_number().
- * \return #MSG_HOST_FAILURE if the host on which
- * this function was called was shut down,
- * #MSG_TRANSFER_FAILURE if the transfer could not be properly done
- * (network failure, dest failure) or #MSG_OK if it succeeded.
- */
-msg_error_t MSG_task_put(msg_task_t task, msg_host_t dest, m_channel_t channel)
-{
- XBT_WARN("DEPRECATED! Now use MSG_task_send");
- return MSG_task_put_with_timeout(task, dest, channel, -1.0);
-}
-
-/** \ingroup msg_deprecated_functions
- * \brief Does exactly the same as MSG_task_put but with a bounded transmition
- * rate.
- *
- * \sa MSG_task_put
- */
-msg_error_t
-MSG_task_put_bounded(msg_task_t task, msg_host_t dest, m_channel_t channel,
- double maxrate)
-{
- XBT_WARN("DEPRECATED! Now use MSG_task_send_bounded");
- task->simdata->rate = maxrate;
- return MSG_task_put(task, dest, channel);
-}
-
-/** \ingroup msg_deprecated_functions
- *
- * \brief Put a task on a channel of an
- * host (with a timeout on the waiting of the destination host) and
- * waits for the end of the transmission.
- *
- * This function is used for describing the behavior of a process. It
- * takes four parameter.
- * \param task a #msg_task_t to send on another location. This task
- will not be usable anymore when the function will return. There is
- no automatic task duplication and you have to save your parameters
- before calling this function. Tasks are unique and once it has been
- sent to another location, you should not access it anymore. You do
- not need to call MSG_task_destroy() but to avoid using, as an
- effect of inattention, this task anymore, you definitely should
- renitialize it with #MSG_TASK_UNINITIALIZED. Note that this task
- can be transfered iff it has been correctly created with
- MSG_task_create().
- * \param dest the destination of the message
- * \param channel the channel on which the process should put this
- task. This value has to be >=0 and < than the maximal number of
- channels fixed with MSG_set_channel_number().
- * \param timeout the maximum time to wait for a task before giving
- up. In such a case, #MSG_TRANSFER_FAILURE will be returned, \a task
- will not be modified
- * \return #MSG_HOST_FAILURE if the host on which
-this function was called was shut down,
-#MSG_TRANSFER_FAILURE if the transfer could not be properly done
-(network failure, dest failure, timeout...) or #MSG_OK if the communication succeeded.
- */
-msg_error_t
-MSG_task_put_with_timeout(msg_task_t task, msg_host_t dest,
- m_channel_t channel, double timeout)
-{
- XBT_WARN("DEPRECATED! Now use MSG_task_send_with_timeout");
- xbt_assert((channel >= 0)
- && (channel < msg_global->max_channel), "Invalid channel %d",
- channel);
-
- XBT_DEBUG("MSG_task_put_with_timout: Trying to send a task to '%s'", MSG_host_get_name(dest));
- return
- MSG_mailbox_put_with_timeout(MSG_mailbox_get_by_channel
- (dest, channel), task, timeout);
-}
-
-/** \ingroup msg_deprecated_functions
- * \brief Test whether there is a pending communication on a channel, and who sent it.
- *
- * It takes one parameter.
- * \param channel the channel on which the process should be
- listening. This value has to be >=0 and < than the maximal
- number of channels fixed with MSG_set_channel_number().
- * \return -1 if there is no pending communication and the PID of the process who sent it otherwise
- */
-int MSG_task_probe_from(m_channel_t channel)
-{
- XBT_WARN("DEPRECATED! Now use MSG_task_listen_from");
- msg_task_t task;
-
- xbt_assert((channel >= 0)
- && (channel < msg_global->max_channel), "Invalid channel %d",
- channel);
-
- if (NULL ==
- (task =
- MSG_mailbox_get_head(MSG_mailbox_get_by_channel
- (MSG_host_self(), channel))))
- return -1;
-
- return MSG_process_get_PID(task->simdata->sender);
-}
-
-/** \ingroup msg_deprecated_functions
- * \brief Test whether there is a pending communication on a channel.
- *
- * It takes one parameter.
- * \param channel the channel on which the process should be
- listening. This value has to be >=0 and < than the maximal
- number of channels fixed with MSG_set_channel_number().
- * \return 1 if there is a pending communication and 0 otherwise
- */
-int MSG_task_Iprobe(m_channel_t channel)
-{
- XBT_WARN("DEPRECATED!");
- xbt_assert((channel >= 0)
- && (channel < msg_global->max_channel), "Invalid channel %d",
- channel);
-
- return
- !MSG_mailbox_is_empty(MSG_mailbox_get_by_channel
- (MSG_host_self(), channel));
-}
-
-/** \ingroup msg_deprecated_functions
-
- * \brief Return the number of tasks waiting to be received on a \a
- channel and sent by \a host.
- *
- * It takes two parameters.
- * \param channel the channel on which the process should be
- listening. This value has to be >=0 and < than the maximal
- number of channels fixed with MSG_set_channel_number().
- * \param host the host that is to be watched.
- * \return the number of tasks waiting to be received on \a channel
- and sent by \a host.
- */
-int MSG_task_probe_from_host(int channel, msg_host_t host)
-{
- XBT_WARN("DEPRECATED! Now use MSG_task_listen_from_host");
- xbt_assert((channel >= 0)
- && (channel < msg_global->max_channel), "Invalid channel %d",
- channel);
-
- return
- MSG_mailbox_get_count_host_waiting_tasks(MSG_mailbox_get_by_channel
- (MSG_host_self(), channel),
- host);
-
-}
-
-/** \ingroup msg_deprecated_functions
- * \brief Listen on \a channel and waits for receiving a task from \a host.
- *
- * It takes three parameters.
- * \param task a memory location for storing a #msg_task_t. It will
- hold a task when this function will return. Thus \a task should not
- be equal to \c NULL and \a *task should be equal to \c NULL. If one of
- those two condition does not hold, there will be a warning message.
- * \param channel the channel on which the process should be
- listening. This value has to be >=0 and < than the maximal
- number of channels fixed with MSG_set_channel_number().
- * \param host the host that is to be watched.
- * \return a #msg_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise.
- */
-msg_error_t
-MSG_task_get_from_host(msg_task_t * task, m_channel_t channel, msg_host_t host)
-{
- XBT_WARN("DEPRECATED! Now use MSG_task_receive_from_host");
- return MSG_task_get_ext(task, channel, -1, host);
-}
-
-/** \ingroup msg_deprecated_functions
- * \brief Listen on a channel and wait for receiving a task.
- *
- * It takes two parameters.
- * \param task a memory location for storing a #msg_task_t. It will
- hold a task when this function will return. Thus \a task should not
- be equal to \c NULL and \a *task should be equal to \c NULL. If one of
- those two condition does not hold, there will be a warning message.
- * \param channel the channel on which the process should be
- listening. This value has to be >=0 and < than the maximal
- number of channels fixed with MSG_set_channel_number().
- * \return a #msg_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise.
- */
-msg_error_t MSG_task_get(msg_task_t * task, m_channel_t channel)
-{
- XBT_WARN("DEPRECATED! Now use MSG_task_receive");
- return MSG_task_get_with_timeout(task, channel, -1);
-}
-
-/** \ingroup msg_deprecated_functions
- * \brief Listen on a channel and wait for receiving a task with a timeout.
- *
- * It takes three parameters.
- * \param task a memory location for storing a #msg_task_t. It will
- hold a task when this function will return. Thus \a task should not
- be equal to \c NULL and \a *task should be equal to \c NULL. If one of
- those two condition does not hold, there will be a warning message.
- * \param channel the channel on which the process should be
- listening. This value has to be >=0 and < than the maximal
- number of channels fixed with MSG_set_channel_number().
- * \param max_duration the maximum time to wait for a task before giving
- up. In such a case, #MSG_TRANSFER_FAILURE will be returned, \a task
- will not be modified and will still be
- equal to \c NULL when returning.
- * \return a #msg_error_t indicating whether the operation was successful (#MSG_OK), or why it failed otherwise.
- */
-msg_error_t
-MSG_task_get_with_timeout(msg_task_t * task, m_channel_t channel,
- double max_duration)
-{
- XBT_WARN("DEPRECATED! Now use MSG_task_receive_with_timeout");
- return MSG_task_get_ext(task, channel, max_duration, NULL);
-}
-
-msg_error_t
-MSG_task_get_ext(msg_task_t * task, m_channel_t channel, double timeout,
- msg_host_t host)
-{
- XBT_WARN("DEPRECATED! Now use MSG_task_receive_ext");
- xbt_assert((channel >= 0)
- && (channel < msg_global->max_channel), "Invalid channel %d",
- channel);
-
- return
- MSG_mailbox_get_task_ext(MSG_mailbox_get_by_channel
- (MSG_host_self(), channel), task, host,
- timeout);
-}
-
-#endif