Пример #1
0
/*
** this function has a separated environment, which defines the
** correct __close for 'popen' files
*/
static int io_pclose(lua_State * L)
{
    FILE **p = topfile(L);
    int ok = lua_pclose(L, *p);
    *p = NULL;
    return pushresult(L, ok, NULL);
}
Пример #2
0
/*
** this function has a separated environment, which defines the
** correct __close for 'popen' files
*/
static int io_pclose (lua_State *L) {
#if !USE_POPEN
  luaL_error(L, "`popen' not supported");
  return 0;
#else
  FILE **p = topfile(L);
  int ok = lua_pclose(L, *p);
  *p = NULL;
  return pushresult(L, ok, NULL);
#endif
}
Пример #3
0
/*
** function to close 'popen' files
*/
static int io_pclose(lua_State *L) {
	LStream *p = tolstream(L);
	return luaL_execresult(L, lua_pclose(L, p->f));
}
Пример #4
0
/*
** function to close 'popen' files
*/
static int io_pclose (lua_State *L) {
  int *p = tofilep(L);
  int ok = lua_pclose(L, *p);
  *p = FS_OPEN_OK - 1;
  return pushresult(L, ok, NULL);
}