Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Indent the rest of the code (examples, buildtools, doc...) except for examples/SMPI...
[simgrid.git] / tools / tesh2 / include / context.h
1 /*\r
2  * include/contex.h - type representing the context execution of a command.\r
3  *\r
4  * Copyright 2008,2009 Martin Quinson, Malek Cherier All right reserved. \r
5  *\r
6  * This program is free software; you can redistribute it and/or modify it \r
7  * under the terms of the license (GNU LGPL) which comes with this package.\r
8  *\r
9  * Purpose:\r
10  *              This file contains all the declarations of the functions related with\r
11  *              the tesh context type.\r
12  *\r
13  */  \r
14     \r
15 #ifndef _CONTEXT_H\r
16 #define _CONTEXT_H\r
17     \r
18 #include <com.h>\r
19     \r
20 #ifdef __cplusplus\r
21 extern "C" {
22   \r
23 #endif  /* \r */
24   \r
25 /*! \brief create_new - create a new context.\r
26  *\r
27  * \return                      If successful the function returns the newly created\r
28  *                                      command. Otherwise the function returns NULL and sets the\r
29  *                                      global variable errno with the appropiate error code.\r
30  *                                      [ENOMEM] if the system has not enough space to allocate\r
31  *                                               the context.\r
32  */ \r
33   context_t \r context_new(void);
34   \r\r
35 /*! \brief context_free - destroy a context object.\r
36  *\r
37  * \param ptr           A pointer to the context object to destroy.\r
38  *\r
39  * \return                      If successful the function returns the 0. Otherwise \r
40  *                                      the function returns -1 and sets the global variable \r
41  *                                      errno with the appropiate error code.\r
42  *\r
43  * errors :\r
44  *                                      [EINVAL] if the context object pointed to by the ptr parameter is invalid.\r
45  *                                      \r
46  */ \r
47   int \r context_free(context_t * ptr);
48   \r \r
49 /*! \brief context_dup - duplicate a context object.\r
50  *\r
51  * \param context       The context to duplicate.\r
52  *\r
53  * \return                      If successful the function returns the duplicate. Otherwise \r
54  *                                      the function returns NULL and sets the global variable \r
55  *                                      errno with the appropiate error code.\r
56  *\r
57  * errors :\r
58  *                                      [EINVAL] if the parameter is invalid.\r
59  *                                      [ENOMEM] if there is not enough memory to allocate the duplicate.\r
60  *                                      \r
61  */ \r
62    context_t \r context_dup(context_t context);
63   \r \r \r
64 /*! \brief context_reset - reset a context object.\r
65  *\r
66  * \param context       The context to reset.\r
67  *\r
68  * \return                      If successful the function returns 0. Otherwise \r
69  *                                      the function returns -1 and sets the global variable \r
70  *                                      errno with the appropiate error code.\r
71  *\r
72  * errors :\r
73  *                                      [EINVAL] if the parameter is invalid.\r
74  *                                      \r
75  */ \r
76   int \r context_reset(context_t context);
77   \r \r void \r context_clear(context_t context);
78   \r \r void \r context_input_write(context_t context, const char *buffer);
79   \r\rvoid \r context_ouput_read(context_t context, const char *buffer);
80   \r\r\r\r
81 #ifdef __cplusplus\r
82 extern} \r
83 #endif  /* \r */
84 \r
85 #endif  /* !_CONTEXT_H */\r