Lines Matching refs:bv

95 static const struct info *dictval2info(const bitv *bv);
110 static void bitv_free(bitv *bv);
111 static void bitv_shift(bitv *bv, unsigned bits);
112 static void bitv_setlo(bitv *bv, unsigned bits, unsigned val);
113 static void bitv_shiftin(bitv *bv, unsigned bits, unsigned val);
114 static void bitv_shiftinv(bitv *bv, unsigned bits, const bitv *inbv);
115 static int bitv_bits(const bitv *bv);
116 static unsigned bitv_chunk(const bitv *bv, unsigned limbit, unsigned lobit);
117 static int bitv_mul(bitv *bv, unsigned long long val);
118 static int bitv_add(bitv *bv, unsigned long long val);
119 static int bitv_sub(bitv *bv, unsigned long long val);
120 static int bitv_ge(const bitv *bv, unsigned long long val);
589 dictval2info(const bitv *bv) in dictval2info() argument
594 if (!bitv_ge(bv, Info[i + 1].offset)) in dictval2info()
1113 struct bitv *bv = malloc(sizeof (*bv)); in bitv_alloc() local
1115 if (bv) in bitv_alloc()
1117 bv->v[i] = 0; in bitv_alloc()
1119 return (bv); in bitv_alloc()
1124 bitv_free(bitv *bv) in bitv_free() argument
1126 free(bv); in bitv_free()
1131 bitv_shift(bitv *bv, unsigned bits) in bitv_shift() argument
1142 bv->v[i] <<= iterbits; in bitv_shift()
1143 bv->v[i] |= bv->v[i - 1] >> (8 - iterbits); in bitv_shift()
1145 bv->v[0] <<= iterbits; in bitv_shift()
1153 bitv_setlo(bitv *bv, unsigned bits, unsigned val) in bitv_setlo() argument
1168 bv->v[i] &= ~mask; in bitv_setlo()
1169 bv->v[i] |= val & mask; in bitv_setlo()
1185 bitv_shiftin(bitv *bv, unsigned bits, unsigned val) in bitv_shiftin() argument
1187 bitv_shift(bv, bits); in bitv_shiftin()
1188 bitv_setlo(bv, bits, val); in bitv_shiftin()
1193 bitv_shiftinv(bitv *bv, unsigned bits, const bitv *inbv) in bitv_shiftinv() argument
1199 bitv_shiftin(bv, iterbits, inbv->v[byteindex--]); in bitv_shiftinv()
1203 bitv_shiftin(bv, 8, inbv->v[byteindex--]); in bitv_shiftinv()
1208 bitv_bits(const bitv *bv) in bitv_bits() argument
1213 if (bv->v[i]) { in bitv_bits()
1217 if ((bv->v[i] >> bit) & 1) in bitv_bits()
1229 bitv_chunk(const bitv *bv, unsigned limbit, unsigned lobit) in bitv_chunk() argument
1242 retval |= (bv->v[bit / 8] >> (bit % 8)) & 1; in bitv_chunk()
1256 bitv_mul(bitv *bv, unsigned long long val) in bitv_mul() argument
1274 bv->v[bvbyte] + k; in bitv_mul()
1295 bv->v[i] = prod[i]; in bitv_mul()
1308 bitv_add(bitv *bv, unsigned long long val) in bitv_add() argument
1316 result = cf + bv->v[i] + ((val >> (i * 8)) & 0xff); in bitv_add()
1318 result = cf + bv->v[i]; in bitv_add()
1321 bv->v[i] = result & 0xff; in bitv_add()
1339 bitv_sub(bitv *bv, unsigned long long val) in bitv_sub() argument
1347 minuend = bv->v[i]; in bitv_sub()
1358 bv->v[i] = minuend - subtrahend; in bitv_sub()
1372 bitv_ge(const bitv *bv, unsigned long long val) in bitv_ge() argument
1380 minuend = bv->v[i]; in bitv_ge()
1400 bitv *bv = bitv_alloc(); in bitv_strparse() local
1402 if (bv == NULL) { in bitv_strparse()
1434 if (bitv_mul(bv, base) < 0 || in bitv_strparse()
1435 bitv_add(bv, val) < 0 || in bitv_strparse()
1436 bitv_bits(bv) > bits) { in bitv_strparse()
1437 bitv_free(bv); in bitv_strparse()
1445 return (bv); in bitv_strparse()