2 * include/reader.h - type representing the object used to read from the stdin
\r
3 * (redirected) of a command.
\r
5 * Copyright 2008,2009 Martin Quinson, Malek Cherier All right reserved.
\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
11 * This file contains all the declarations of the functions related with
\r
12 * the tesh writer type.
\r
26 /*! \brief reader_new - create a new reader.
\r
28 * \param command The command owning the stdout readed by the reader.
\r
30 * \return If successful the function returns the newly created
\r
31 * reader. Otherwise the function returns NULL and sets the
\r
32 * global variable errno with the appropiate error code.
\r
35 * [EINVAL] if the parameter is invalid.
\r
36 * [ENOMEM] if the system has not enough space to allocate
\r
40 reader_new(command_t command);
\r
42 /*! \brief reader_free - destroy a reader object.
\r
44 * \param ptr A pointer to the reader object to destroy.
\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
51 * [EINVAL] if the reader object pointed to by the parameter ptr is invalid.
\r
56 reader_free(reader_t* ptr);
\r
59 reader_read(reader_t reader);
\r
62 reader_wait(reader_t reader);
\r
68 #endif /* !__READER_H */
\r