version 1.18, 2016/03/16 15:36:26 |
version 1.19, 2016/09/17 15:06:41 |
|
|
* Macros to manipulate the list of buffers in thisfile->buflist. |
* Macros to manipulate the list of buffers in thisfile->buflist. |
*/ |
*/ |
#define FOR_BUFS(bn) \ |
#define FOR_BUFS(bn) \ |
for ((bn) = ch_bufhead; (bn) != END_OF_CHAIN; (bn) = (bn)->next) |
for ((bn) = ch_bufhead; (bn) != END_OF_CHAIN; (bn) = (bn)->next) |
|
|
#define BUF_RM(bn) \ |
#define BUF_RM(bn) \ |
(bn)->next->prev = (bn)->prev; \ |
(bn)->next->prev = (bn)->prev; \ |
|
|
* Macros to manipulate the list of buffers in thisfile->hashtbl[n]. |
* Macros to manipulate the list of buffers in thisfile->hashtbl[n]. |
*/ |
*/ |
#define FOR_BUFS_IN_CHAIN(h, bn) \ |
#define FOR_BUFS_IN_CHAIN(h, bn) \ |
for ((bn) = thisfile->hashtbl[h].hnext; \ |
for ((bn) = thisfile->hashtbl[h].hnext; \ |
(bn) != END_OF_HCHAIN(h); (bn) = (bn)->hnext) |
(bn) != END_OF_HCHAIN(h); (bn) = (bn)->hnext) |
|
|
#define BUF_HASH_RM(bn) \ |
#define BUF_HASH_RM(bn) \ |
|
|
BLOCKNUM nblocks; |
BLOCKNUM nblocks; |
|
|
nblocks = (ch_fpos + LBUFSIZE - 1) / LBUFSIZE; |
nblocks = (ch_fpos + LBUFSIZE - 1) / LBUFSIZE; |
for (block = 0; block < nblocks; block++) { |
for (block = 0; block < nblocks; block++) { |
int wrote = FALSE; |
int wrote = FALSE; |
FOR_BUFS(bn) { |
FOR_BUFS(bn) { |
bp = bufnode_buf(bn); |
bp = bufnode_buf(bn); |