Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics (kill unused var, and kill/improve debug outputs)
[simgrid.git] / tools / tesh2 / include / timer.h
1 /*\r
2  * include/timer.h - type representing the timer object used to manage the \r
3  * time allocated to a command.\r
4  *\r
5  * Copyright 2008,2009 Martin Quinson, Malek Cherier All right reserved. \r
6  *\r
7  * This program is free software; you can redistribute it and/or modify it \r
8  * under the terms of the license (GNU LGPL) which comes with this package.\r
9  *\r
10  * Purpose:\r
11  *              This file contains all the declarations of the functions related with\r
12  *              the tesh timer type.\r
13  *\r
14  */\r
15  \r
16 #ifndef __TIMER_H\r
17 #define __TIMER_H\r
18 \r
19 #include <com.h>\r
20 \r
21 #ifdef __cplusplus\r
22 extern "C" {\r
23 #endif\r
24 \r
25 \r
26 /*! \brief timer_new - create a new timer.\r
27  *\r
28  * \param command       The command to keep a wath.\r
29  *\r
30  * \return                      If successful the function returns the newly created\r
31  *                                      timer. Otherwise the function returns NULL and sets the\r
32  *                                      global variable errno with the appropiate error code.\r
33  *\r
34  * errors :\r
35  *                                      [EINVAL] if the parameter is invalid.\r
36  *                                      [ENOMEM] if the system has not enough space to allocate\r
37  *                                               the timer.\r
38  */\r
39 ttimer_t\r
40 timer_new(command_t command);\r
41 \r
42 /*! \brief timer_free - destroy a timer object.\r
43  *\r
44  * \param ptr           A pointer to the timer object to destroy.\r
45  *\r
46  * \return                      If successful the function returns the 0. Otherwise \r
47  *                                      the function returns -1 and sets the global variable \r
48  *                                      errno with the appropiate error code.\r
49  *\r
50  * errors :\r
51  *                                      [EINVAL] if the timer object pointed to by the parameter ptr is invalid.\r
52  *                                      \r
53  *                                      \r
54  */\r
55 int\r
56 timer_free(ttimer_t* ptr);\r
57 \r
58 void\r
59 timer_time(ttimer_t timer);\r
60 \r
61 void\r
62 timer_wait(ttimer_t timer);\r
63 \r
64 #ifdef __cplusplus\r
65 }\r
66 #endif\r
67 \r
68 \r
69 #endif /* !__TIMER_H */\r