2 * charfuncs.h - Routines for dealing with character streams.
4 * Jonathan McDowell <noodles@earth.li>
6 * Copyright 2002 Project Purple
9 #ifndef __CHARFUNCS_H__
10 #define __CHARFUNCS_H__
15 * buffer_ctx - Shared with CGI buffer stuff...
16 * @buffer: The data buffer.
17 * @offset: Our current position in the buffer.
18 * @size: The size of the data buffer.
27 * buffer_fetchchar - Fetches a char from a buffer.
28 * @ctx: Our buffer context structure.
29 * @count: The number of characters to get from the buffer.
30 * @c: Where to put the characters retrieved.
32 int buffer_fetchchar(void *ctx, size_t count, void *c);
35 * buffer_putchar - Puts a char to a buffer.
36 * @ctx: Our buffer context structure.
37 * @count: The number of characters to put into the buffer.
38 * @c: The characters to add to the buffer.
40 * Adds characters to the buffer references by the buffer context. If we
41 * fill it then we double the size of the current buffer and then add the
44 int buffer_putchar(void *ctx, size_t count, void *c);
47 * file_fetchchar - Fetches a char from a file.
49 int file_fetchchar(void *fd, size_t count, void *c);
52 * file_putchar - Puts a char to a file.
54 int file_putchar(void *fd, size_t count, void *c);
57 * stdin_getchar - Gets a char from stdin.
59 int stdin_getchar(void *ctx, size_t count, void *c);
62 * stdout_putchar - Puts a char to stdout.
64 int stdout_putchar(void *ctx, size_t count, void *c);
66 #endif /* __CHARFUNCS_H__ */