X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/41ac7e58ef132dea8cea9addf213671ae38229ac..f06041cf2c450457a0b47a49b66b19cb9133c18e:/examples/msg/chainsend/messages.c diff --git a/examples/msg/chainsend/messages.c b/examples/msg/chainsend/messages.c index c91243c9a4..28a92fb49c 100644 --- a/examples/msg/chainsend/messages.c +++ b/examples/msg/chainsend/messages.c @@ -1,30 +1,36 @@ +/* Copyright (c) 2012-2014. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + #include "messages.h" -msg_task_t task_message_new(e_message_type type, unsigned int len, const char *issuer_hostname, const char *mailbox) +msg_task_t task_message_new(e_message_type type, unsigned int len) { message_t msg = xbt_new(s_message_t, 1); msg->type = type; - msg->issuer_hostname = issuer_hostname; - msg->mailbox = mailbox; + msg->prev_hostname = NULL; + msg->next_hostname = NULL; msg_task_t task = MSG_task_create(NULL, 0, len, msg); return task; } -msg_task_t task_message_chain_new(const char *issuer_hostname, const char *mailbox, const char* prev, const char *next, const unsigned int num_pieces) +msg_task_t task_message_chain_new(const char* prev, const char *next, const unsigned int num_pieces) { - msg_task_t task = task_message_new(MESSAGE_BUILD_CHAIN, MESSAGE_BUILD_CHAIN_SIZE, issuer_hostname, mailbox); + msg_task_t task = task_message_new(MESSAGE_BUILD_CHAIN, MESSAGE_BUILD_CHAIN_SIZE); message_t msg = MSG_task_get_data(task); - msg->prev_hostname = prev; - msg->next_hostname = next; + msg->prev_hostname = xbt_strdup(prev); + msg->next_hostname = xbt_strdup(next); msg->num_pieces = num_pieces; return task; } -msg_task_t task_message_data_new(const char *issuer_hostname, const char *mailbox, const char *block, unsigned int len) +msg_task_t task_message_data_new(const char *block, unsigned int len) { - msg_task_t task = task_message_new(MESSAGE_SEND_DATA, MESSAGE_SEND_DATA_HEADER_SIZE + len, issuer_hostname, mailbox); + msg_task_t task = task_message_new(MESSAGE_SEND_DATA, MESSAGE_SEND_DATA_HEADER_SIZE + len); message_t msg = MSG_task_get_data(task); msg->data_block = block; msg->data_length = len;