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

Function db_find_variable

freebsd/ddb/db_variables.c:60–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58static struct db_variable *db_evars = db_vars + nitems(db_vars);
59
60static int
61db_find_variable(struct db_variable **varp)
62{
63 struct db_variable *vp;
64 int t;
65
66 t = db_read_token();
67 if (t == tIDENT) {
68 for (vp = db_vars; vp < db_evars; vp++) {
69 if (!strcmp(db_tok_string, vp->name)) {
70 *varp = vp;
71 return (1);
72 }
73 }
74 for (vp = db_regs; vp < db_eregs; vp++) {
75 if (!strcmp(db_tok_string, vp->name)) {
76 *varp = vp;
77 return (1);
78 }
79 }
80 }
81 db_error("Unknown variable\n");
82 return (0);
83}
84
85int
86db_get_variable(db_expr_t *valuep)

Callers 3

db_get_variableFunction · 0.85
db_set_variableFunction · 0.85
db_set_cmdFunction · 0.85

Calls 3

db_read_tokenFunction · 0.85
strcmpFunction · 0.85
db_errorFunction · 0.85

Tested by

no test coverage detected