sd-hwdb.c revision 23fbe14f503c1e98292efc4ba1238adb7dc38d80
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek This file is part of systemd.
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek Copyright 2012 Kay Sievers <kay@vrfy.org>
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek Copyright 2008 Alan Jenkins <alan.christopher.jenkins@googlemail.com>
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek Copyright 2014 Tom Gundersen <teg@jklm.no>
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek systemd is free software; you can redistribute it and/or modify it
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek under the terms of the GNU Lesser General Public License as published by
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek the Free Software Foundation; either version 2.1 of the License, or
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek (at your option) any later version.
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek systemd is distributed in the hope that it will be useful, but
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek WITHOUT ANY WARRANTY; without even the implied warranty of
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek Lesser General Public License for more details.
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering You should have received a copy of the GNU Lesser General Public License
d6170d27b26eeeace966bb9720d66fcac2a6ef1bZbigniew Jędrzejewski-Szmek along with systemd; If not, see <http://www.gnu.org/licenses/>.
char *modalias;
bool properties_modified;
struct linebuf {
return NULL;
static const struct trie_child_entry_f *trie_node_children(sd_hwdb *hwdb, const struct trie_node_f *node) {
static const struct trie_value_entry_f *trie_node_values(sd_hwdb *hwdb, const struct trie_node_f *node) {
static const struct trie_node_f *node_lookup_f(sd_hwdb *hwdb, const struct trie_node_f *node, uint8_t c) {
search.c = c;
if (child)
return NULL;
key++;
size_t i;
const char *prefix;
int err;
if (err < 0)
return err;
if (err < 0)
return err;
size_t i = 0;
int err;
while (node) {
size_t p = 0;
uint8_t c;
if (c != search[i + p])
if (child) {
if (err < 0)
return err;
if (child) {
if (err < 0)
return err;
if (child) {
if (err < 0)
return err;
size_t n;
if (err < 0)
return err;
static const char hwdb_bin_paths[] =
#ifdef HAVE_SPLIT_USR
const char *hwdb_bin_path;
if (!hwdb)
return -ENOMEM;
if (hwdb->f)
if (!hwdb->f) {
return -ENOENT;
return -EINVAL;;
return hwdb;
if (hwdb->f)
return NULL;
bool found = false;
if (!hwdb)
if (!hwdb->f)
found = true;
if (!found)
if (!mod)
return -ENOMEM;
_public_ int sd_hwdb_get(sd_hwdb *hwdb, const char *modalias, const char *key, const char **_value) {
const char *value;
if (!value)
return -ENOENT;
return -EAGAIN;
*key = k;
*value = v;