2 * charfuncs.h - Routines for dealing with character streams.
4 * Jonathan McDowell <noodles@earth.li>
6 * Copyright 2002 Project Purple
8 * $Id: charfuncs.h,v 1.4 2003/10/04 10:21:40 noodles Exp $
11 #ifndef __CHARFUNCS_H__
12 #define __CHARFUNCS_H__
17 * buffer_ctx - Shared with CGI buffer stuff...
18 * @buffer: The data buffer.
19 * @offset: Our current position in the buffer.
20 * @size: The size of the data buffer.
29 * buffer_fetchchar - Fetches a char from a buffer.
30 * @ctx: Our buffer context structure.
31 * @count: The number of characters to get from the buffer.
32 * @c: Where to put the characters retrieved.
34 int buffer_fetchchar(void *ctx, size_t count, unsigned char *c);
37 * buffer_putchar - Puts a char to a buffer.
38 * @ctx: Our buffer context structure.
39 * @count: The number of characters to put into the buffer.
40 * @c: The characters to add to the buffer.
42 * Adds characters to the buffer references by the buffer context. If we
43 * fill it then we double the size of the current buffer and then add the
46 int buffer_putchar(void *ctx, size_t count, unsigned char *c);
49 * file_fetchchar - Fetches a char from a file.
51 int file_fetchchar(void *fd, size_t count, unsigned char *c);
54 * file_putchar - Puts a char to a file.
56 int file_putchar(void *fd, size_t count, unsigned char *c);
59 * stdin_getchar - Gets a char from stdin.
61 int stdin_getchar(void *ctx, size_t count, unsigned char *c);
64 * stdout_putchar - Puts a char to stdout.
66 int stdout_putchar(void *ctx, size_t count, unsigned char *c);
68 #endif /* __CHARFUNCS_H__ */