git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
cbddc29a9aeed1ed5cb21d5cf51fb1b898b00b19 blob 910 bytes (raw)

 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
 
#ifndef UNIQUE_PREFIX_H
#define UNIQUE_PREFIX_H

struct prefix_item {
	const char *name;
	size_t prefix_length;
};

/*
 * Find unique prefixes in a given array of strings.
 * Given a list of names, find unique prefixes (i.e. the first <n> characters
 * that uniquely identify the names) and store the lengths of the unique
 * prefixes in the 'prefix_length' field of the elements of the given array.
 *
 * Typically, the `struct prefix_item` information will be a field in the
 * actual item struct; For this reason, the `items` parameter is specified
 * as an array of pointers to the items.
 *
 * The `min_length`/`max_length` parameters define what length the unique
 * prefixes should have.
 *
 * If no unique prefix could be found for a given item, its `prefix_length`
 * will be set to 0.
 */
void find_unique_prefixes(struct prefix_item **items, size_t nr,
			  int min_length, int max_length);

#endif
debug log:

solving cbddc29a9a ...
found cbddc29a9a in https://public-inbox.org/git/20190828163419.30620-1-szeder.dev@gmail.com/

applying [1/1] https://public-inbox.org/git/20190828163419.30620-1-szeder.dev@gmail.com/
diff --git a/unique-prefix.h b/unique-prefix.h
new file mode 100644
index 0000000000..cbddc29a9a

Checking patch unique-prefix.h...
Applied patch unique-prefix.h cleanly.

index at:
100644 cbddc29a9aeed1ed5cb21d5cf51fb1b898b00b19	unique-prefix.h

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).