Lines Matching refs:bv

93 static const struct info *dictval2info(const bitv *bv);
108 static void bitv_free(bitv *bv);
109 static void bitv_shift(bitv *bv, unsigned bits);
110 static void bitv_setlo(bitv *bv, unsigned bits, unsigned val);
111 static void bitv_shiftin(bitv *bv, unsigned bits, unsigned val);
112 static void bitv_shiftinv(bitv *bv, unsigned bits, const bitv *inbv);
113 static int bitv_bits(const bitv *bv);
114 static unsigned bitv_chunk(const bitv *bv, unsigned limbit, unsigned lobit);
115 static int bitv_mul(bitv *bv, unsigned long long val);
116 static int bitv_add(bitv *bv, unsigned long long val);
117 static int bitv_sub(bitv *bv, unsigned long long val);
118 static int bitv_ge(const bitv *bv, unsigned long long val);
587 dictval2info(const bitv *bv) in dictval2info() argument
592 if (!bitv_ge(bv, Info[i + 1].offset)) in dictval2info()
1111 struct bitv *bv = malloc(sizeof (*bv)); in bitv_alloc() local
1113 if (bv) in bitv_alloc()
1115 bv->v[i] = 0; in bitv_alloc()
1117 return (bv); in bitv_alloc()
1122 bitv_free(bitv *bv) in bitv_free() argument
1124 free(bv); in bitv_free()
1129 bitv_shift(bitv *bv, unsigned bits) in bitv_shift() argument
1140 bv->v[i] <<= iterbits; in bitv_shift()
1141 bv->v[i] |= bv->v[i - 1] >> (8 - iterbits); in bitv_shift()
1143 bv->v[0] <<= iterbits; in bitv_shift()
1151 bitv_setlo(bitv *bv, unsigned bits, unsigned val) in bitv_setlo() argument
1166 bv->v[i] &= ~mask; in bitv_setlo()
1167 bv->v[i] |= val & mask; in bitv_setlo()
1183 bitv_shiftin(bitv *bv, unsigned bits, unsigned val) in bitv_shiftin() argument
1185 bitv_shift(bv, bits); in bitv_shiftin()
1186 bitv_setlo(bv, bits, val); in bitv_shiftin()
1191 bitv_shiftinv(bitv *bv, unsigned bits, const bitv *inbv) in bitv_shiftinv() argument
1197 bitv_shiftin(bv, iterbits, inbv->v[byteindex--]); in bitv_shiftinv()
1201 bitv_shiftin(bv, 8, inbv->v[byteindex--]); in bitv_shiftinv()
1206 bitv_bits(const bitv *bv) in bitv_bits() argument
1211 if (bv->v[i]) { in bitv_bits()
1215 if ((bv->v[i] >> bit) & 1) in bitv_bits()
1227 bitv_chunk(const bitv *bv, unsigned limbit, unsigned lobit) in bitv_chunk() argument
1240 retval |= (bv->v[bit / 8] >> (bit % 8)) & 1; in bitv_chunk()
1254 bitv_mul(bitv *bv, unsigned long long val) in bitv_mul() argument
1272 bv->v[bvbyte] + k; in bitv_mul()
1293 bv->v[i] = prod[i]; in bitv_mul()
1306 bitv_add(bitv *bv, unsigned long long val) in bitv_add() argument
1314 result = cf + bv->v[i] + ((val >> (i * 8)) & 0xff); in bitv_add()
1316 result = cf + bv->v[i]; in bitv_add()
1319 bv->v[i] = result & 0xff; in bitv_add()
1337 bitv_sub(bitv *bv, unsigned long long val) in bitv_sub() argument
1345 minuend = bv->v[i]; in bitv_sub()
1356 bv->v[i] = minuend - subtrahend; in bitv_sub()
1370 bitv_ge(const bitv *bv, unsigned long long val) in bitv_ge() argument
1378 minuend = bv->v[i]; in bitv_ge()
1398 bitv *bv = bitv_alloc(); in bitv_strparse() local
1400 if (bv == NULL) { in bitv_strparse()
1432 if (bitv_mul(bv, base) < 0 || in bitv_strparse()
1433 bitv_add(bv, val) < 0 || in bitv_strparse()
1434 bitv_bits(bv) > bits) { in bitv_strparse()
1435 bitv_free(bv); in bitv_strparse()
1443 return (bv); in bitv_strparse()