14 #include "local_proto.h"
16 #define SEG_N_ROW_NONZERO(SEG, row, col) \
17 (((row) >> (SEG)->srowbits) * (SEG)->spr + ((col) >> (SEG)->scolbits))
19 #define SEG_INDEX_ROW_NONZERO(SEG, row, col) \
20 ((((row) & ((SEG)->srows - 1)) << (SEG)->scolbits) + \
21 ((col) & ((SEG)->scols - 1)))
23 #define SEG_N_ROW_ZERO(SEG, col) ((col) >> (SEG)->scolbits)
25 #define SEG_INDEX_ROW_ZERO(SEG, col) ((col) & ((SEG)->scols - 1))
27 #define INDEX_ADJ(SEG, i) \
28 ((SEG)->fast_seek ? ((i) << (SEG)->lenbits) : ((i) * (SEG)->len))
48 (col & (SEG->
scols - 1));
64 *index = col - ((*n) << SEG->
scolbits);
78 off_t seg_r = row / SEG->
srows;
79 off_t seg_c = col / SEG->
scols;
81 *n = seg_r * SEG->
spr + seg_c;
87 *n = col / SEG->
scols;
88 *index = col - *n * SEG->
scols;
119 return SEG->
address(SEG, row, col, n, index);
#define SEG_INDEX_ROW_NONZERO(SEG, row, col)
int seg_address_slow(const SEGMENT *SEG, off_t row, off_t col, int *n, int *index)
#define SEG_N_ROW_NONZERO(SEG, row, col)
int seg_address(const SEGMENT *SEG, off_t row, off_t col, int *n, int *index)
Internal use only.
#define SEG_INDEX_ROW_ZERO(SEG, col)
int seg_address_fast(const SEGMENT *SEG, off_t row, off_t col, int *n, int *index)
#define SEG_N_ROW_ZERO(SEG, col)
#define INDEX_ADJ(SEG, i)
int(* address)(const struct SEGMENT *, off_t, off_t, int *, int *)