The earthshaking new logo.
[paraslash.git] / stdin.h
1 /*
2  * Copyright (C) 2006 Andre Noll <maan@systemlinux.org>
3  *
4  * Licensed under the GPL v2. For licencing details see COPYING.
5  */
6
7 /** \file stdin.h the stdin task structure and exported symbols from stdin.c */
8
9 /**
10  * the task structure used for reading from stdin
11  */
12 struct stdin_task {
13         /** input buffer */
14         char *buf;
15         /** the size of \a buf */
16         size_t bufsize;
17         /** number of bytes currently loaded in \a buf */
18         size_t loaded;
19         /** whether \p STDIN_FILENO was included in the read fd set */
20         int check_fd;
21         /** the task structure */
22         struct task task;
23         /** non-zero on read error, or if a read from stdin returned zero */
24         int eof;
25 };
26
27 void stdin_pre_select(struct sched *s, struct task *t);
28 void stdin_post_select(struct sched *s, struct task *t);
29 void stdin_set_defaults(struct stdin_task *sit);