Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Also add config.log to checkall.log to get configure option used for the test, at...
[simgrid.git] / tools / tesh2 / include / command.h
index 9f39202..1d57cb1 100644 (file)
-#ifndef __COMMAND_H
-#define __COMMAND_H
-
-#include <com.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-command_t
-command_new(unit_t unit, context_t context, xbt_os_mutex_t mutex);
-
-void
-command_free(command_t* command);
-
-void
-command_run(command_t command);
-
-void
-command_exec(command_t command, const char* command_line);
-
-void
-command_wait(command_t command);
-
-void
-command_interrupt(command_t command);
-
-void
-command_display_status(command_t command);
-
-void
-command_handle_failure(command_t command, cs_reason_t reason);
-
-void command_kill(command_t command);
-
-void
-command_check(command_t command);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_COMMAND_H */
+/*\r
+ * include/command.h - type representing a command.\r
+ *\r
+ * Copyright 2008,2009 Martin Quinson, Malek Cherier All right reserved. \r
+ *\r
+ * This program is free software; you can redistribute it and/or modify it \r
+ * under the terms of the license (GNU LGPL) which comes with this package.\r
+ *\r
+ * Purpose:\r
+ *             This file contains all the declarations of the functions related with\r
+ *             the tesh command type.\r
+ *\r
+ */\r
\r
+#ifndef __COMMAND_H\r
+#define __COMMAND_H\r
+\r
+#include <com.h>\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*! \brief command_new - create a new fstream.\r
+ *\r
+ * \param unit                 The unit contained the command.\r
+ * \param context              The context of the excecution of the command.\r
+ * \param mutex                        A mutex to synchronize the access of the properties of its unit.\r
+ *\r
+ * \return                             If successful the function returns the newly created\r
+ *                                             command. Otherwise the function returns NULL and sets the\r
+ *                                             global variable errno with the appropiate error code.\r
+ * remarks:\r
+ *                                             If the parameter directory is NULL, the parameter name\r
+ *                                             must be `stdin`.\r
+ *\r
+ * errors :\r
+ *                                             [EINVAL] if one of the parameters is invalid.\r
+ *                                             [ENOMEM] if the system has not enough space to allocate\r
+ *                                                              the command.\r
+ */\r
+command_t\r
+command_new(unit_t unit, context_t context, xbt_os_mutex_t mutex);\r
+\r
+/*! \brief command_free - destroy a command object.\r
+ *\r
+ * \param ptr                  A pointer to the command object to destroy.\r
+ *\r
+ * \return                             If successful the function returns the 0. Otherwise \r
+ *                                             the function returns -1 and sets the global variable \r
+ *                                             errno with the appropiate error code.\r
+ *\r
+ * errors :\r
+ *                                             [EINVAL] if the command object pointed to by the ptr parameter is invalid.\r
+ *                                     \r
+ */\r
+int\r
+command_free(command_t* ptr);\r
+\r
+/*! \brief command_run - run a command object.\r
+ *\r
+ * \param command              The command to run.\r
+ *\r
+ * \return                             If successful the function returns the 0. Otherwise \r
+ *                                             the function returns -1 and sets the global variable \r
+ *                                             errno with the appropiate error code.\r
+ *\r
+ * errors :\r
+ *                                             [EINVAL] if the parameter is invalid.\r
+ *\r
+ * remarks :\r
+ *                                             The type of running (asynchonus or no) depend of the\r
+ *                                             context of the command.\r
+ *                                     \r
+ */\r
+int\r
+command_run(command_t command);\r
+\r
+/*! \brief command_exec - execute a command object.\r
+ *\r
+ * \param command              The command object to run.\r
+ * \param command_line The command line of the process to create.                              \r
+ */\r
+void\r
+command_exec(command_t command, const char* command_line);\r
+\r
+/*! \brief command_wait - wait for the end of a command.\r
+ *\r
+ * \param command              The command object to wait for.         \r
+ */\r
+void\r
+command_wait(command_t command);\r
+\r
+/*! \brief command_interrupt - wait for the end of a command.\r
+ *\r
+ * \param command              The command object to interrupt.                \r
+ */\r
+void\r
+command_interrupt(command_t command);\r
+\r
+/*! \brief command_summarize - print the summary of the execution of a command.\r
+ *\r
+ * \param command              The command object to display the summary.      \r
+ *\r
+ * remark:\r
+ *                                             The summary of the command is displayed only if the user\r
+ *                                             specifies both summary and detail-summary options on the\r
+ *                                             tesh command line.\r
+ */\r
+void\r
+command_summarize(command_t command);\r
+\r
+/*! \brief command_handle_failure - handle a failure caused by a command.\r
+ *\r
+ * \param command              The command to handle the failure.      \r
+ *\r
+ * remark:\r
+ *                                             The behavior of the command failure handling depends\r
+ *                                             of the specification of the options keep-going and\r
+ *                                             keep-going-unit. If the user has specified the option\r
+ *                                             keep-going on the command line of tesh, only the unit \r
+ *                                             containing the failed command is interrupted and all \r
+ *                                             other units continue.\r
+ */\r
+void\r
+command_handle_failure(command_t command, cs_reason_t reason);\r
+\r
+void command_kill(command_t command);\r
+\r
+void\r
+command_check(command_t command);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* !_COMMAND_H */\r