ringbuf.h
资源名称:8202s.rar [点击查看]
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:1k
源码类别:
DVD
开发平台:
C/C++
- #ifndef __RINGBUF_H
- #define __RINGBUF_H
- /*
- ** ring buffer control
- **
- ** ..uuudddddd...
- ** B R W
- **
- */
- #if 0
- //static inline int WRAPl(int r, int s) {return (r<0) ? (r+s) : r;}
- //static inline int WRAPr(int r, int s) {return (r>=s) ? (r-s) : r;}
- #endif
- #ifdef ENABLE_INLINE
- static inline int WRAPl(int r, int s) {return (r<0) ? (r+s) : r;}
- static inline int WRAPr(int r, int s) {return (r>=s) ? (r-s) : r;}
- #else
- #define WRAPl(r,s) (((r)<0) ? ((r)+(s)) : (r))
- #define WRAPr(r,s) (((r)>=(s)) ? ((r)-(s)) : (r))
- #endif
- //#define WRAPl(r,s) (((r)<0) ? ((r)+(s)) : (r))
- //#define WRAPr(r,s) (((r)>=(s)) ? ((r)-(s)) : (r))
- int RingBufferSize(int Wp, int Rp, int L);
- int RingBufferFree(int Wp, int Bp, int L);
- #endif/*__RINGBUF_H*/