| 2687 | |
| 2688 | #ifdef notyet |
| 2689 | staticfn int |
| 2690 | opencheckpat(lua_State *L, const char *ename, int param) |
| 2691 | { |
| 2692 | /* careful - we're using 2 different and unrelated Lua states */ |
| 2693 | const char *string; |
| 2694 | int rv; |
| 2695 | |
| 2696 | lua_pushliteral(luapat, "matches"); /* function -0,+1 */ |
| 2697 | |
| 2698 | string = lua_tolstring(L, param, NULL); /* mode or filename -0,+0 */ |
| 2699 | lua_pushstring(luapat, string); /* -0,+1 */ |
| 2700 | |
| 2701 | |
| 2702 | (void) lua_getfield(L, -1, ename); /* pattern -0,+1 */ |
| 2703 | lua_pop(L, 1); /* -1,+0 */ |
| 2704 | string = lua_tolstring(L, -1, NULL); /* -0,+0 */ |
| 2705 | lua_pushstring(luapat, string); /* -0,+1 */ |
| 2706 | |
| 2707 | if (nhl_pcall(luapat, 2, 1)) { /* -3,+1 */ |
| 2708 | /* impossible("access check internal error"); */ |
| 2709 | return NHL_SBRV_FAIL; |
| 2710 | } |
| 2711 | rv = lua_toboolean(luapat, -1); /* -0,+0 */ |
| 2712 | #if 0 |
| 2713 | if (lua_resetthread(luapat) != LUA_OK) |
| 2714 | return NHL_SBRV_FAIL; |
| 2715 | is pop sufficient? XXX or wrong - look at the balance |
| 2716 | #else |
| 2717 | lua_pop(luapat, 1); /* -1,+0 */ |
| 2718 | #endif |
| 2719 | return rv ? NHL_SBRV_ACCEPT : NHL_SBRV_DENY; |
| 2720 | } |
| 2721 | #endif |
| 2722 | |
| 2723 | /* put the table open uses to check its arguments on the top of the stack, |
no test coverage detected