Implements Patricia-Trie.
Patricia-Trie impl | Implements Patricia-Trie. |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file Patricia-Trie. |
C-kern/ | Implementation file Patricia-Trie impl. |
patriciatrie_t | |
lifetime | |
search | |
GETBIT | Returns the bit value at bitoffset. |
first_different_bit | Determines the first bit which differs in key1 and key2. |
change | |
patriciatrie_iterator_t | |
lifetime | |
iterate | |
patriciatrie_prefixiter_t | |
lifetime | |
iterate | |
Functions | |
test |
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
© 2012 Jörg Seebohn
Header file Patricia-Trie.
Implementation file Patricia-Trie impl.
lifetime | |
search | |
GETBIT | Returns the bit value at bitoffset. |
first_different_bit | Determines the first bit which differs in key1 and key2. |
change |
Returns the bit value at bitoffset. Returns (key[0]&0x80) if bitoffset is 0 and (key[0]&0x40) if it is 1 and so on. Every string has a virtual end marker of 0xFF. If bitoffset/8 equals therefore length a value of 1 is returned. If bitoffset is beyond string length and beyond virtual end marker a value of 0 is returned.
Determines the first bit which differs in key1 and key2. Virtual end markers of 0xFF at end of each string are considered. If both keys are equal the functions returns the error code EINVAL. On success 0 is returned and *bit_offset contains the bit index of the first differing bit beginning with 0.