示例#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
文件: liolib.c 项目: Allowed/Protheus
/*
** 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);
}