MCPcopy Create free account
hub / github.com/Entware/Entware / file_lookup

Function file_lookup

scripts/config/util.c:13–29  ·  view source on GitHub ↗

file already present in list? If not add it */

Source from the content-addressed store, hash-verified

11
12/* file already present in list? If not add it */
13struct file *file_lookup(const char *name)
14{
15 struct file *file;
16
17 for (file = file_list; file; file = file->next) {
18 if (!strcmp(name, file->name)) {
19 return file;
20 }
21 }
22
23 file = xmalloc(sizeof(*file));
24 memset(file, 0, sizeof(*file));
25 file->name = xstrdup(name);
26 file->next = file_list;
27 file_list = file;
28 return file;
29}
30
31/* Allocate initial growable string */
32struct gstr str_new(void)

Callers 2

zconf_initscanFunction · 0.85
__zconf_nextfileFunction · 0.85

Calls 2

xmallocFunction · 0.85
xstrdupFunction · 0.85

Tested by

no test coverage detected