* They help build wildcard key strings to pass to fnmatch(),
* as well as building values of matching keys.
*/
-
struct buffer {
char *bytes;
unsigned size;
buf->used++;
}
-/* like buf_pushchars(), but the string comes from a file */
static unsigned buf_freadchars(struct buffer *buf, FILE *in)
{
unsigned i = 0;
}
/*
- * Index file searching (used only by modprobe)
+ * Index file searching
*/
-
struct index_node_f {
FILE *file;
char *prefix; /* path compression */
free(idx);
}
-
static struct index_node_f *index_readroot(struct index_file *in)
{
return index_read(in->file, in->root_offset);
struct index_file;
struct index_file *index_file_open(const char *filename);
void index_file_close(struct index_file *index);
-
-/* Return value for first matching key.
- Keys must be exactly equal to match - i.e. there are no wildcard patterns
-*/
char *index_search(struct index_file *index, const char *key);
-
-/* Return values for all matching keys.
- The keys in the index are treated as wildcard patterns using fnmatch()
-*/
struct index_value *index_searchwild(struct index_file *index, const char *key);
void index_values_free(struct index_value *values);