kmod/libkmod/libkmod-index.h
Lucas De Marchi d4f659e12a Drop the one line short description on sources
Some are outdated, misleading or just repeat the same thing over and
over. Remove them as they are not needed.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://lore.kernel.org/r/20240723185921.1005569-3-lucas.de.marchi@gmail.com
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
2024-07-26 13:41:56 -05:00

35 lines
1.1 KiB
C

/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2011-2013 ProFUSION embedded systems
*/
#pragma once
#include <inttypes.h>
struct index_value {
struct index_value *next;
unsigned int priority;
unsigned int len;
char value[0];
};
/* In-memory index (depmod only) */
struct index_file;
struct index_file *index_file_open(const char *filename);
void index_file_close(struct index_file *idx);
char *index_search(struct index_file *idx, const char *key);
void index_dump(struct index_file *in, int fd, const char *prefix);
struct index_value *index_searchwild(struct index_file *idx, const char *key);
void index_values_free(struct index_value *values);
/* Implementation using mmap */
struct index_mm;
int index_mm_open(const struct kmod_ctx *ctx, const char *filename,
unsigned long long *stamp, struct index_mm **pidx);
void index_mm_close(struct index_mm *index);
char *index_mm_search(struct index_mm *idx, const char *key);
struct index_value *index_mm_searchwild(struct index_mm *idx, const char *key);
void index_mm_dump(struct index_mm *idx, int fd, const char *prefix);