Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change the directory to the directory defined by the variable teshexample_dir. If...
[simgrid.git] / tools / tesh2 / include / timer.h
index fc1c710..1b37c9d 100644 (file)
@@ -1,27 +1,69 @@
-#ifndef __TIMER_H
-#define __TIMER_H
-
-#include <com.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-ttimer_t
-timer_new(command_t command);
-
-void
-timer_free(ttimer_t* timer);
-
-void
-timer_time(ttimer_t timer);
-
-void
-timer_wait(ttimer_t timer);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* !__TIMER_H */
+/*\r
+ * include/timer.h - type representing the timer object used to manage the \r
+ * time allocated to 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 timer type.\r
+ *\r
+ */\r
\r
+#ifndef __TIMER_H\r
+#define __TIMER_H\r
+\r
+#include <com.h>\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+\r
+/*! \brief timer_new - create a new timer.\r
+ *\r
+ * \param command      The command to keep a wath.\r
+ *\r
+ * \return                     If successful the function returns the newly created\r
+ *                                     timer. Otherwise the function returns NULL and sets the\r
+ *                                     global variable errno with the appropiate error code.\r
+ *\r
+ * errors :\r
+ *                                     [EINVAL] if the parameter is invalid.\r
+ *                                     [ENOMEM] if the system has not enough space to allocate\r
+ *                                              the timer.\r
+ */\r
+ttimer_t\r
+timer_new(command_t command);\r
+\r
+/*! \brief timer_free - destroy a timer object.\r
+ *\r
+ * \param ptr          A pointer to the timer 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 timer object pointed to by the parameter ptr is invalid.\r
+ *                                     \r
+ *                                     \r
+ */\r
+int\r
+timer_free(ttimer_t* ptr);\r
+\r
+void\r
+timer_time(ttimer_t timer);\r
+\r
+void\r
+timer_wait(ttimer_t timer);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /* !__TIMER_H */\r