File: hwdb.h

package info (click to toggle)
ofono 2.18-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,064 kB
  • sloc: ansic: 224,979; sh: 5,012; python: 4,040; makefile: 956
file content (49 lines) | stat: -rw-r--r-- 1,119 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * Embedded Linux library
 * Copyright (C) 2011-2014  Intel Corporation
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#ifndef __ELL_HWDB_H
#define __ELL_HWDB_H

#include <stdarg.h>

#ifdef __cplusplus
extern "C" {
#endif

struct l_hwdb;

struct l_hwdb *l_hwdb_new(const char *pathname);
struct l_hwdb *l_hwdb_new_default(void);

struct l_hwdb *l_hwdb_ref(struct l_hwdb *hwdb);
void l_hwdb_unref(struct l_hwdb *hwdb);

struct l_hwdb_entry {
	const char *key;
	const char *value;
	struct l_hwdb_entry *next;
};

struct l_hwdb_entry *l_hwdb_lookup(struct l_hwdb *hwdb, const char *format, ...)
					__attribute__((format(printf, 2, 3)));
struct l_hwdb_entry *l_hwdb_lookup_valist(struct l_hwdb *hwdb,
					const char *format, va_list args)
					__attribute__((format(printf, 2, 0)));
void l_hwdb_lookup_free(struct l_hwdb_entry *entries);

typedef void (*l_hwdb_foreach_func_t)(const char *modalias,
					struct l_hwdb_entry *entries,
							void *user_data);

bool l_hwdb_foreach(struct l_hwdb *hwdb, l_hwdb_foreach_func_t func,
							void *user_data);

#ifdef __cplusplus
}
#endif

#endif /* __ELL_HWDB_H */