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))
46 *n = (row >> SEG->srowbits) * SEG->spr + (col >> SEG->scolbits);
47 *index = ((row & (SEG->srows - 1)) << SEG->scolbits) +
48 (col & (SEG->scols - 1));
63 *n = col >> SEG->scolbits;
64 *index = col - ((*n) << SEG->scolbits);
67 *index = SEG->fast_seek ? (*index << SEG->lenbits) : (*index * SEG->len);
78 off_t seg_r = row / SEG->srows;
79 off_t seg_c = col / SEG->scols;
81 *n = seg_r * SEG->spr + seg_c;
83 (row - seg_r * SEG->srows) * SEG->scols + col - seg_c * SEG->scols;
87 *n = col / SEG->scols;
88 *index = col - *n * SEG->scols;
108int seg_address(
const SEGMENT *SEG, off_t row, off_t col,
int *n,
int *index)
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)