Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add the new integrated files version (use xbt data structures instead my own data...
[simgrid.git] / tools / tesh2 / include / writer.h
1 /*\r
2  * include/witer.h - type representing the object used to write to the stdin \r
3  * (redirected) of 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 writer type.\r
13  *\r
14  */\r
15  \r
16 #ifndef __WRITER_H\r
17 #define __WRITER_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 /*! \brief writer_new - create a new writer.\r
26  *\r
27  * \param command       The command owning the stdin written by the writer.\r
28  *\r
29  * \return                      If successful the function returns the newly created\r
30  *                                      writer. Otherwise the function returns NULL and sets the\r
31  *                                      global variable errno with the appropiate error code.\r
32  *\r
33  * errors :\r
34  *                                      [EINVAL] if the parameter is invalid.\r
35  *                                      [ENOMEM] if the system has not enough space to allocate\r
36  *                                               the writer.\r
37  */\r
38 writer_t\r
39 writer_new(command_t command);\r
40 \r
41 \r
42 /*! \brief writer_free - destroy a writer object.\r
43  *\r
44  * \param ptr           A pointer to the writer 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 writer object pointed to by the parameter ptr is invalid.\r
52  *                                      \r
53  *                                      \r
54  */\r
55 int\r
56 writer_free(writer_t* ptr);\r
57 \r
58 void\r
59 writer_write(writer_t writer);\r
60 \r
61 void\r
62 writer_wait(writer_t writer);\r
63 \r
64 #ifdef __cplusplus\r
65 }\r
66 #endif\r
67 \r
68 #endif /* !__WRITER_H */\r