2 Copyright 2008 Kristian Nielsen
4 This file is part of BeeDB.
6 Foobar is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
11 Foobar is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Foobar. If not, see <http://www.gnu.org/licenses/>.
23 #include "packed_mask.h"
25 uint64_t read1(uint64_t *base
, uint count
)
28 pack_ptr_mask
p(base
);
36 uint64_t read2(uint64_t *base
, uint count
)
39 pack_ptr_mask
p(base
);
47 int main(int argc
, char *argv
[])
49 uint64_t word
= 0xfedcba9876543210UL
;
50 pack_ptr_mask
p(&word
);
51 printf("%lx\n", (unsigned long)p
.getbits(3));
52 printf("%lx\n", (unsigned long)p
.getbits(7));