| 292 | |
| 293 | |
| 294 | static int ll_loadfunc (lua_State *L, const char *path, const char *sym) { |
| 295 | void **reg = ll_register(L, path); |
| 296 | if (*reg == NULL) *reg = ll_load(L, path); |
| 297 | if (*reg == NULL) |
| 298 | return ERRLIB; /* unable to load library */ |
| 299 | else { |
| 300 | lua_CFunction f = ll_sym(L, *reg, sym); |
| 301 | if (f == NULL) |
| 302 | return ERRFUNC; /* unable to find function */ |
| 303 | lua_pushcfunction(L, f); |
| 304 | return 0; /* return function */ |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | |
| 309 | static int ll_loadlib (lua_State *L) { |
no test coverage detected