Beispiel #1
0
static int luaB_dofile (lua_State *L) {
  const char *fname = luaL_optstring(L, 1, NULL);
  lua_settop(L, 1);
  if (luaL_loadfile(L, fname) != LUA_OK) lua_error(L);
  lua_callk(L, 0, LUA_MULTRET, 0, dofilecont);
  return dofilecont(L);
}
static int luaB_dofile (lua_State *L) {
  const char *fname = luaL_optstring(L, 1, NULL);
  lua_settop(L, 1);
  #if defined( LUA_USES_LOADF )
  if (luaL_loadfile(L, fname) != LUA_OK)
    return lua_error(L);
  #else
  if (luaL_loadfsfile(L, fname) != LUA_OK)
    return lua_error(L);
  #endif
  lua_callk(L, 0, LUA_MULTRET, 0, dofilecont);
  return dofilecont(L, 0, 0);
}