| 307 | |
| 308 | |
| 309 | static int ll_loadfunc (lua_State *L, const char *path, const char *sym) { |
| 310 | void **reg = ll_register(L, path); |
| 311 | if (*reg == NULL) *reg = ll_load(L, path); |
| 312 | if (*reg == NULL) |
| 313 | return ERRLIB; /* unable to load library */ |
| 314 | else { |
| 315 | lua_CFunction f = ll_sym(L, *reg, sym); |
| 316 | if (f == NULL) |
| 317 | return ERRFUNC; /* unable to find function */ |
| 318 | lua_pushcfunction(L, f); |
| 319 | return 0; /* return function */ |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | |
| 324 | static int ll_loadlib (lua_State *L) { |
no test coverage detected