MCPcopy Create free account
hub / github.com/KratosMultiphysics/Kratos / find_builtin

Function find_builtin

external_libraries/tinyexpr/tinyexpr/tinyexpr.c:221–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219};
220
221static const te_variable *find_builtin(const char *name, int len) {
222 int imin = 0;
223 int imax = sizeof(functions) / sizeof(te_variable) - 2;
224
225 /*Binary search.*/
226 while (imax >= imin) {
227 const int i = (imin + ((imax-imin)/2));
228 int c = strncmp(name, functions[i].name, len);
229 if (!c) c = '\0' - functions[i].name[len];
230 if (c == 0) {
231 return functions + i;
232 } else if (c > 0) {
233 imin = i + 1;
234 } else {
235 imax = i - 1;
236 }
237 }
238
239 return 0;
240}
241
242static const te_variable *find_lookup(const state *s, const char *name, int len) {
243 int iters;

Callers 1

next_tokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected