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

Function function_expand

scripts/config/preprocess.c:202–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200#define FUNCTION_MAX_ARGS 16
201
202static char *function_expand(const char *name, int argc, char *argv[])
203{
204 const struct function *f;
205 int i;
206
207 for (i = 0; i < ARRAY_SIZE(function_table); i++) {
208 f = &function_table[i];
209 if (strcmp(f->name, name))
210 continue;
211
212 if (argc < f->min_args)
213 pperror("too few function arguments passed to '%s'",
214 name);
215
216 if (argc > f->max_args)
217 pperror("too many function arguments passed to '%s'",
218 name);
219
220 return f->func(argc, argv);
221 }
222
223 return NULL;
224}
225
226/*
227 * Variables (and user-defined functions)

Callers 1

eval_clauseFunction · 0.85

Calls 1

pperrorFunction · 0.85

Tested by

no test coverage detected