Fix an off-by-one bug.
[paraslash.git] / stdin.h
1 /*
2 * Copyright (C) 2006-2007 Andre Noll <maan@systemlinux.org>
3 *
4 * Licensed under the GPL v2. For licencing details see COPYING.
5 */
6
7 /** \file stdin.h The standard in task structure. */
8
9 /** The task structure used for reading from stdin. */
10 struct stdin_task {
11 /** Input buffer. */
12 char *buf;
13 /** The size of \a buf. */
14 size_t bufsize;
15 /** Number of bytes currently loaded in \a buf. */
16 size_t loaded;
17 /** Whether \p STDIN_FILENO was included in the read fd set. */
18 int check_fd;
19 /** The task structure. */
20 struct task task;
21 /** Non-zero on read error, or if a read from stdin returned zero. */
22 int eof;
23 };
24
25 void stdin_set_defaults(struct stdin_task *sit);