[BACK]Return to buf.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

Diff for /src/usr.bin/make/buf.h between version 1.5 and 1.6

version 1.5, 1998/12/05 00:06:27 version 1.6, 1999/12/06 22:24:31
Line 51 
Line 51 
   
 #include    "sprite.h"  #include    "sprite.h"
   
 typedef char Byte;  
   
 typedef struct Buffer {  typedef struct Buffer {
     int     size;       /* Current size of the buffer */      size_t  size;       /* Current size of the buffer */
     int     left;       /* Space left (== size - (inPtr - buffer)) */      size_t  left;       /* Space left (== size - (inPtr - buffer)) */
     Byte    *buffer;    /* The buffer itself */      char    *buffer;    /* The buffer itself */
     Byte    *inPtr;     /* Place to write to */      char    *inPtr;     /* Place to write to */
     Byte    *outPtr;    /* Place to read from */      char    *outPtr;    /* Place to read from */
 } *Buffer;  } *Buffer;
   
 /* Buf_AddByte adds a single byte to a buffer. */  /* Buf_AddChar adds a single char to a buffer. */
 #define Buf_AddByte(bp, byte) \  #define Buf_AddChar(bp, byte) \
         (void) (--(bp)->left <= 0 ? Buf_OvAddByte(bp, byte), 1 : \          (void) (--(bp)->left == 0 ? Buf_OvAddChar(bp, byte), 1 : \
                 (*(bp)->inPtr++ = (byte), *(bp)->inPtr = 0), 1)                  (*(bp)->inPtr++ = (byte), *(bp)->inPtr = 0), 1)
   
 #define BUF_ERROR 256  #define BUF_ERROR 256
   
 void Buf_OvAddByte __P((Buffer, int));  void Buf_OvAddChar __P((Buffer, char));
 void Buf_AddBytes __P((Buffer, int, const Byte *));  void Buf_AddChars __P((Buffer, size_t, const char *));
 void Buf_UngetByte __P((Buffer, int));  char *Buf_GetAll __P((Buffer, size_t *));
 void Buf_UngetBytes __P((Buffer, int, Byte *));  void Buf_Discard __P((Buffer, size_t));
 int Buf_GetByte __P((Buffer));  
 int Buf_GetBytes __P((Buffer, int, Byte *));  
 Byte *Buf_GetAll __P((Buffer, int *));  
 void Buf_Discard __P((Buffer, int));  
 int Buf_Size __P((Buffer));  int Buf_Size __P((Buffer));
 Buffer Buf_Init __P((int));  Buffer Buf_Init __P((size_t));
 void Buf_Destroy __P((Buffer, Boolean));  void Buf_Destroy __P((Buffer, Boolean));
 void Buf_ReplaceLastByte __P((Buffer, int));  void Buf_ReplaceLastChar __P((Buffer, char));
   
 #endif /* _BUF_H */  #endif /* _BUF_H */

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6