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 / reader.h
diff --git a/tools/tesh2/include/reader.h b/tools/tesh2/include/reader.h
new file mode 100644 (file)
index 0000000..623f1ff
--- /dev/null
@@ -0,0 +1,68 @@
+/*\r
+ * include/reader.h - type representing the object used to read from the stdin \r
+ * (redirected) of 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 writer type.\r
+ *\r
+ */\r
\r
+#ifndef __READER_H\r
+#define __READER_H\r
+\r
+#include <com.h>\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+\r
+/*! \brief reader_new - create a new reader.\r
+ *\r
+ * \param command      The command owning the stdout readed by the reader.\r
+ *\r
+ * \return                     If successful the function returns the newly created\r
+ *                                     reader. 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 reader.\r
+ */\r
+reader_t\r
+reader_new(command_t command);\r
+\r
+/*! \brief reader_free - destroy a reader object.\r
+ *\r
+ * \param ptr          A pointer to the reader 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 reader object pointed to by the parameter ptr is invalid.\r
+ *                                     \r
+ *                                     \r
+ */\r
+int\r
+reader_free(reader_t* ptr);\r
+\r
+void\r
+reader_read(reader_t reader);\r
+\r
+void\r
+reader_wait(reader_t reader);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* !__READER_H */\r