2 This file is part of systemd.
4 Copyright 2012 Kay Sievers <kay.sievers@vrfy.org>
6 systemd is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
11 systemd is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 #include "sparse-endian.h"
22 #define HWDB_SIG { 'K', 'S', 'L', 'P', 'H', 'H', 'R', 'H' }
24 /* on-disk trie objects */
25 _packed_ struct trie_header_f {
28 /* version of tool which created the file */
32 /* size of structures to allow them to grow */
35 le64_t child_entry_size;
36 le64_t value_entry_size;
38 /* offset of the root trie node */
39 le64_t nodes_root_off;
41 /* size of the nodes and string section */
46 _packed_ struct trie_node_f {
47 /* prefix of lookup string, shared by all children */
49 /* size of children entry array appended to the node */
50 uint8_t children_count;
52 /* size of value entry array appended to the node */
56 /* array of child entries, follows directly the node record */
57 _packed_ struct trie_child_entry_f {
58 /* index of the child node */
61 /* offset of the child node */
65 /* array of value entries, follows directly the node record/child array */
66 _packed_ struct trie_value_entry_f {