Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
circ_buf.h File Reference

Go to the source code of this file.

Data Structures

struct  circ_buf
 

Macros

#define CIRC_CNT(head, tail, size)   (((head) - (tail)) & ((size)-1))
 
#define CIRC_SPACE(head, tail, size)   CIRC_CNT((tail),((head)+1),(size))
 
#define CIRC_CNT_TO_END(head, tail, size)
 
#define CIRC_SPACE_TO_END(head, tail, size)
 

Macro Definition Documentation

#define CIRC_CNT (   head,
  tail,
  size 
)    (((head) - (tail)) & ((size)-1))

Definition at line 15 of file circ_buf.h.

#define CIRC_CNT_TO_END (   head,
  tail,
  size 
)
Value:
({int end = (size) - (tail); \
int n = ((head) + end) & ((size)-1); \
n < end ? n : end;})

Definition at line 25 of file circ_buf.h.

#define CIRC_SPACE (   head,
  tail,
  size 
)    CIRC_CNT((tail),((head)+1),(size))

Definition at line 20 of file circ_buf.h.

#define CIRC_SPACE_TO_END (   head,
  tail,
  size 
)
Value:
({int end = (size) - 1 - (head); \
int n = (end + (tail)) & ((size)-1); \
n <= end ? n : end+1;})

Definition at line 31 of file circ_buf.h.