echo_d.h 1.43 KB
#ifndef __echo_d_h__
#define __echo_d_h__
/*HEADER******************************************************************
**************************************************************************
*** 
*** Copyright (c) 2001-2002 ARC International.
*** All rights reserved                                          
***                                                              
*** This software embodies materials and concepts which are      
*** confidential to ARC International and is made
*** available solely pursuant to the terms of a written license   
*** agreement with ARC International             
***
*** $Workfile:echo_d.h$
*** $Revision: 1.4 $
*** $Date: 2003/08/04 23:30:36 $
***
*** Description:      
***  This file contains the VUSBH32 Echo example application header
***                                                               
**************************************************************************
*END*********************************************************************/

#define BUFFERSIZE      64

typedef struct buffer_struct { /* Body */
   uint_8      buf[BUFFERSIZE];
   uint_32     len;
} BUFFER_STRUCT, _PTR_ BUFFER_STRUCT_PTR;

#define INIT_BUF(b)	((b.len) = 0)

#define SPACE_BUF(b)	(BUFFERSIZE - ((b).len))
#define DATA_BUF(b)	((b).len)
#define DBUF(b)		(&((b).buf[(b).len]))
#define ADD_BUF(b,l)	((b).len += l)
#define TRIM_BUF(b,l)	(bcopy(&((b).buf[l]), &((b).buf[0]), l), (b).len -= l)
 
#endif /* __echo_d_h__ */