2 * include/contex.h - type representing the context execution of a command.
\r
4 * Copyright 2008,2009 Martin Quinson, Malek Cherier All right reserved.
\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
10 * This file contains all the declarations of the functions related with
\r
11 * the tesh context type.
\r
25 /*! \brief create_new - create a new context.
\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
33 context_t
\r context_new(void);
35 /*! \brief context_free - destroy a context object.
\r
37 * \param ptr A pointer to the context object to destroy.
\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
44 * [EINVAL] if the context object pointed to by the ptr parameter is invalid.
\r
47 int
\r context_free(context_t * ptr);
49 /*! \brief context_dup - duplicate a context object.
\r
51 * \param context The context to duplicate.
\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
58 * [EINVAL] if the parameter is invalid.
\r
59 * [ENOMEM] if there is not enough memory to allocate the duplicate.
\r
62 context_t
\r context_dup(context_t context);
64 /*! \brief context_reset - reset a context object.
\r
66 * \param context The context to reset.
\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
73 * [EINVAL] if the parameter is invalid.
\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);
85 #endif /* !_CONTEXT_H */
\r