MCPcopy Create free account
hub / github.com/F-Stack/f-stack / expand_pattern_to_node

Function expand_pattern_to_node

dpdk/lib/graph/graph.c:191–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191static int
192expand_pattern_to_node(struct graph *graph, const char *pattern)
193{
194 struct node_head *node_head = node_list_head_get();
195 bool found = false;
196 struct node *node;
197
198 /* Check for pattern match */
199 STAILQ_FOREACH(node, node_head, next) {
200 if (fnmatch(pattern, node->name, 0) == 0) {
201 if (graph_node_add(graph, node))
202 goto fail;
203 found = true;
204 }
205 }
206 if (found == false)
207 SET_ERR_JMP(EFAULT, fail, "Pattern %s node not found", pattern);
208
209 return 0;
210fail:
211 return -rte_errno;
212}
213
214static void
215graph_cleanup(struct graph *graph)

Callers 1

rte_graph_createFunction · 0.85

Calls 3

node_list_head_getFunction · 0.85
graph_node_addFunction · 0.85
fnmatchFunction · 0.50

Tested by

no test coverage detected