X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7f4b9e3afcf8815f4925d9ca7dadce2ec1664fa9..05a81a473f36ee2298730ccc85d4033affad4018:/teshsuite/msg/host_on_off/host_on_off_wait.c diff --git a/teshsuite/msg/host_on_off/host_on_off_wait.c b/teshsuite/msg/host_on_off/host_on_off_wait.c index 622c3cf846..2bf8558029 100644 --- a/teshsuite/msg/host_on_off/host_on_off_wait.c +++ b/teshsuite/msg/host_on_off/host_on_off_wait.c @@ -4,22 +4,11 @@ /* 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 #include "simgrid/msg.h" /* Yeah! If you want to use msg, you need to include simgrid/msg.h */ -#include "xbt/sysdep.h" /* calloc, printf */ -#include "xbt/ex.h" -/* Create a log channel to have nice outputs. */ -#include "xbt/log.h" -#include "xbt/asserts.h" -XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, - "Messages specific for this msg example"); +XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); -int master(int argc, char *argv[]); -int slave(int argc, char *argv[]); - -/** Emitter function */ -int master(int argc, char *argv[]) +static int master(int argc, char *argv[]) { xbt_ex_t e; TRY { @@ -38,8 +27,7 @@ int master(int argc, char *argv[]) return 0; } -/** Receiver function */ -int slave(int argc, char *argv[]) +static int slave(int argc, char *argv[]) { xbt_ex_t e; TRY { @@ -56,32 +44,23 @@ int slave(int argc, char *argv[]) return 0; } -/** Main function */ int main(int argc, char *argv[]) { msg_error_t res; - const char *platform_file; - const char *application_file; MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" - "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); + "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); - platform_file = argv[1]; - application_file = argv[2]; + MSG_create_environment(argv[1]); - { /* Simulation setting */ - MSG_create_environment(platform_file); - } - { /* Application deployment */ - MSG_function_register("master", master); - MSG_function_register("slave", slave); + MSG_function_register("master", master); + MSG_function_register("slave", slave); + MSG_launch_application(argv[2]); - MSG_launch_application(application_file); - } res = MSG_main(); XBT_INFO("Simulation time %g", MSG_get_clock()); return res != MSG_OK; -} /* end_of_main */ +}