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

Function cmd_lookup

tools/ifconfig/ifconfig.c:932–948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

930}
931
932static const struct cmd *
933cmd_lookup(const char *name, int iscreate)
934{
935 const struct cmd *p;
936
937 for (p = cmds; p != NULL; p = p->c_next)
938 if (strcmp(name, p->c_name) == 0) {
939 if (iscreate) {
940 if (p->c_iscloneop)
941 return p;
942 } else {
943 if (!p->c_iscloneop)
944 return p;
945 }
946 }
947 return NULL;
948}
949
950struct callback {
951 callback_func *cb_func;

Callers 1

ifconfigFunction · 0.85

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected