Willy Tarreau | 982b6e3 | 2009-01-25 13:49:53 +0100 | [diff] [blame] | 1 | /* |
| 2 | include/types/pipe.h |
| 3 | Pipe management. |
| 4 | |
| 5 | Copyright (C) 2000-2009 Willy Tarreau - w@1wt.eu |
| 6 | |
| 7 | This library is free software; you can redistribute it and/or |
| 8 | modify it under the terms of the GNU Lesser General Public |
| 9 | License as published by the Free Software Foundation, version 2.1 |
| 10 | exclusively. |
| 11 | |
| 12 | This library is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | Lesser General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU Lesser General Public |
| 18 | License along with this library; if not, write to the Free Software |
| 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ |
| 21 | |
| 22 | #ifndef _TYPES_PIPE_H |
| 23 | #define _TYPES_PIPE_H |
| 24 | |
| 25 | #include <common/config.h> |
| 26 | |
| 27 | /* A pipe is described by its read and write FDs, and the data remaining in it. |
| 28 | * The FDs are valid if there are data pending. The user is not allowed to |
| 29 | * change the FDs. |
| 30 | */ |
| 31 | struct pipe { |
| 32 | int data; /* number of bytes present in the pipe */ |
| 33 | int prod; /* FD the producer must write to ; -1 if none */ |
| 34 | int cons; /* FD the consumer must read from ; -1 if none */ |
| 35 | struct pipe *next; |
| 36 | }; |
| 37 | |
| 38 | #endif /* _TYPES_PIPE_H */ |
| 39 | |
| 40 | /* |
| 41 | * Local variables: |
| 42 | * c-indent-level: 8 |
| 43 | * c-basic-offset: 8 |
| 44 | * End: |
| 45 | */ |