Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix copyright headers
[simgrid.git] / src / msg / deployment.c
index aa7783a..9d662f2 100644 (file)
@@ -1,8 +1,5 @@
-/*     $Id$      */
-
-/* Copyright (c) 2002-2007 Arnaud Legrand.                                  */
-/* Copyright (c) 2007 Bruno Donassolo.                                      */
-/* All rights reserved.                                                     */
+/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. 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. */
  * \param file a filename of a xml description of the application. This file 
  * follows this DTD :
  *
- *     \include surfxml.dtd
+ *     \include simgrid.dtd
  *
  * Here is a small example of such a platform 
  *
- *     \include small_deployment.xml
+ *     \include msg/masterslave/deployment_masterslave.xml
  *
  * Have a look in the directory examples/msg/ to have a bigger example.
  */
@@ -31,10 +28,7 @@ void MSG_launch_application(const char *file)
 {
 
   xbt_assert0(msg_global,
-             "MSG_global_init_args has to be called before MSG_launch_application.");
-  SIMIX_function_register_process_create(_MSG_process_create_from_SIMIX);
-  SIMIX_function_register_process_cleanup(__MSG_process_cleanup);
-  SIMIX_function_register_process_kill(_MSG_process_kill_from_SIMIX);
+              "MSG_global_init_args has to be called before MSG_launch_application.");
 
   SIMIX_launch_application(file);
 
@@ -55,6 +49,17 @@ void MSG_function_register(const char *name, xbt_main_func_t code)
   return;
 }
 
+/** \ingroup msg_easier_life
+ * \brief Registers a function as the default main function of agents.
+ *
+ * Registers a code function as being the default value. This function will get used by MSG_launch_application() when there is no registered function of the requested name in.
+ * \param code the function (must have the same prototype than the main function of any C program: int ..(int argc, char *argv[]))
+ */
+void MSG_function_register_default(xbt_main_func_t code)
+{
+  SIMIX_function_register_default(code);
+}
+
 /** \ingroup msg_easier_life
  * \brief Retrieves a registered main function
  *