xref: /original-bsd/usr.bin/make/buf.h (revision 4ec22e22)
1 /*
2  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
3  * Copyright (c) 1988, 1989 by Adam de Boor
4  * Copyright (c) 1989 by Berkeley Softworks
5  * All rights reserved.
6  *
7  * This code is derived from software contributed to Berkeley by
8  * Adam de Boor.
9  *
10  * %sccs.include.redist.c%
11  *
12  *	@(#)buf.h	5.3 (Berkeley) 06/01/90
13  */
14 
15 /*-
16  * buf.h --
17  *	Header for users of the buf library.
18  */
19 
20 #ifndef _BUF_H
21 #define _BUF_H
22 
23 #include    "sprite.h"
24 
25 typedef struct Buffer *Buffer;
26 typedef unsigned char Byte;
27 
28 Buffer	    	  Buf_Init();	    /* Initialize a buffer */
29 void	    	  Buf_Destroy();    /* Destroy a buffer */
30 void	    	  Buf_AddByte();    /* Add a single byte to a buffer */
31 void	    	  Buf_AddBytes();   /* Add a range of bytes to a buffer */
32 int	    	  Buf_GetByte();    /* Get a byte from a buffer */
33 int	    	  Buf_GetBytes();   /* Get multiple bytes */
34 void		  Buf_UngetByte();  /* Push a byte back into the buffer */
35 void		  Buf_UngetBytes(); /* Push many bytes back into the buf */
36 Byte	    	  *Buf_GetAll();    /* Get them all */
37 void	    	  Buf_Discard();    /* Throw away some of the bytes */
38 int	    	  Buf_Size();	    /* See how many are there */
39 
40 #define BUF_ERROR 256
41 
42 #endif _BUF_H
43