MCPcopy Create free account
hub / github.com/crownengine/crown / find_builtin

Function find_builtin

3rdparty/tinyexpr/tinyexpr.c:195–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193};
194
195static const te_variable *find_builtin(const char *name, int len) {
196 int imin = 0;
197 int imax = sizeof(functions) / sizeof(te_variable) - 2;
198
199 /*Binary search.*/
200 while (imax >= imin) {
201 const int i = (imin + ((imax-imin)/2));
202 int c = strncmp(name, functions[i].name, len);
203 if (!c) c = '\0' - functions[i].name[len];
204 if (c == 0) {
205 return functions + i;
206 } else if (c > 0) {
207 imin = i + 1;
208 } else {
209 imax = i - 1;
210 }
211 }
212
213 return 0;
214}
215
216static const te_variable *find_lookup(const state *s, const char *name, int len) {
217 int iters;

Callers 1

next_tokenFunction · 0.85

Calls 1

strncmpFunction · 0.85

Tested by

no test coverage detected