]>
git.ipfire.org Git - thirdparty/kmod.git/blob - libkmod/libkmod-index.h
2 * libkmod - interface to kernel module operations
4 * Copyright (C) 2011-2013 ProFUSION embedded systems
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library 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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
25 struct index_value
*next
;
26 unsigned int priority
;
31 /* In-memory index (depmod only) */
33 struct index_file
*index_file_open(const char *filename
);
34 void index_file_close(struct index_file
*idx
);
35 char *index_search(struct index_file
*idx
, const char *key
);
36 void index_dump(struct index_file
*in
, int fd
, const char *prefix
);
37 struct index_value
*index_searchwild(struct index_file
*idx
, const char *key
);
39 void index_values_free(struct index_value
*values
);
41 /* Implementation using mmap */
43 struct index_mm
*index_mm_open(struct kmod_ctx
*ctx
, const char *filename
,
44 unsigned long long *stamp
);
45 void index_mm_close(struct index_mm
*index
);
46 char *index_mm_search(struct index_mm
*idx
, const char *key
);
47 struct index_value
*index_mm_searchwild(struct index_mm
*idx
, const char *key
);
48 void index_mm_dump(struct index_mm
*idx
, int fd
, const char *prefix
);