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

Function db_script_lookup

freebsd/ddb/db_script.c:129–140  ·  view source on GitHub ↗

* Find the existing script slot for a named script, if any. */

Source from the content-addressed store, hash-verified

127 * Find the existing script slot for a named script, if any.
128 */
129static struct ddb_script *
130db_script_lookup(const char *scriptname)
131{
132 int i;
133
134 for (i = 0; i < DB_MAXSCRIPTS; i++) {
135 if (strcmp(db_script_table[i].ds_scriptname, scriptname) ==
136 0)
137 return (&db_script_table[i]);
138 }
139 return (NULL);
140}
141
142/*
143 * Find a new slot for a script, if available. Does not mark as allocated in

Callers 4

db_script_setFunction · 0.85
db_script_unsetFunction · 0.85
db_script_execFunction · 0.85
db_script_cmdFunction · 0.85

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected