grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / c / Shell / buffer.h
blob368d32421ac8f8739f44cd3656eddeff9d89034d
1 /*
2 Copyright (C) 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #ifndef BUFFER_H
7 #define BUFFER_H 1
9 #ifndef EXEC_TYPES_H
10 #include <exec/types.h>
11 #endif
13 typedef struct {
14 STRPTR buf;
15 ULONG len; /* write position */
16 ULONG cur; /* read position */
17 ULONG mem; /* allocated memory */
18 } Buffer;
20 LONG bufferAppend(STRPTR str, ULONG size, Buffer *out, APTR SysBase);
21 LONG bufferInsert(STRPTR str, ULONG size, Buffer *out, APTR SysBase);
23 /* read 'size' chars from 'in' and append them to 'out' */
24 LONG bufferCopy(Buffer *in, Buffer *out, ULONG size, APTR SysBase);
26 void bufferFree(Buffer *b, APTR SysBase);
28 LONG bufferReadItem(STRPTR buf, ULONG size, Buffer *in, APTR DOSBase);
30 void bufferReset(Buffer *b);
32 #endif