MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / find_builtin

Function find_builtin

extern/tinyexpr/tinyexpr.c:185–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183};
184
185static const te_variable *find_builtin(const char *name, int len) {
186 int imin = 0;
187 int imax = sizeof(functions) / sizeof(te_variable) - 2;
188
189 /*Binary search.*/
190 while (imax >= imin) {
191 const int i = (imin + ((imax-imin)/2));
192 int c = strncmp(name, functions[i].name, len);
193 if (!c) c = '\0' - functions[i].name[len];
194 if (c == 0) {
195 return functions + i;
196 } else if (c > 0) {
197 imin = i + 1;
198 } else {
199 imax = i - 1;
200 }
201 }
202
203 return 0;
204}
205
206static const te_variable *find_lookup(const state *s, const char *name, int len) {
207 int iters;

Callers 1

next_tokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected