本文整理汇总了C++中pushresult函数的典型用法代码示例。如果您正苦于以下问题:C++ pushresult函数的具体用法?C++ pushresult怎么用?C++ pushresult使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pushresult函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Paug_load
static int Paug_load(lua_State *L)
{
augeas *a = Paug_checkarg(L, 1);
return pushresult(L, aug_load(a), a, NULL);
}
开发者ID:ncopa,项目名称:lua-augeas,代码行数:5,代码来源:laugeas.c
示例2: f_flush
static int f_flush (lua_State *L) {
return pushresult(L, fflush(tofile(L)) == 0, NULL);
}
开发者ID:JDuverge,项目名称:windirstat,代码行数:3,代码来源:liolib.c
示例3: io_rename
static void io_rename (void)
{
pushresult(rename(luaL_check_string(1),
luaL_check_string(2)) == 0);
}
开发者ID:jeske,项目名称:hz,代码行数:5,代码来源:liolib.c
示例4: io_pclose
/*
** function to close 'popen' files
*/
static int io_pclose (lua_State *L) {
FILE **p = tofilep(L);
int ok = lua_pclose(L, *p);
*p = NULL;
return pushresult(L, ok, NULL);
}
开发者ID:JDuverge,项目名称:windirstat,代码行数:9,代码来源:liolib.c
示例5: io_tmpfile
static int io_tmpfile (lua_State *L) {
FILE **pf = newfile(L);
*pf = tmpfile();
return (*pf == NULL) ? pushresult(L, 0, NULL) : 1;
}
开发者ID:JDuverge,项目名称:windirstat,代码行数:5,代码来源:liolib.c
示例6: io_remove
static int io_remove (lua_State *L) {
const char *filename = luaL_checkstring(L, 1);
SAFE_CHECK_FILE_DATA(L, 1);
return pushresult(L, remove(filename) == 0, filename);
}
开发者ID:zlandau,项目名称:lua-safe,代码行数:5,代码来源:liolib.c
示例7: io_rename
static int io_rename (lua_State *L) {
return pushresult(L, rename(luaL_check_string(L, 1),
luaL_check_string(L, 2)) == 0);
}
开发者ID:AnthonyNystrom,项目名称:GenXSource,代码行数:4,代码来源:liolib.c
示例8: Pwait
static int Pwait(lua_State *L) /** wait([pid]) */
{
pid_t pid = luaL_optint(L, 1, -1);
return pushresult(L, waitpid(pid, NULL, 0), NULL);
}
开发者ID:xiongyunkun,项目名称:mcs,代码行数:5,代码来源:lposix.c
示例9: Psetgid
static int Psetgid(lua_State *L) /** setgid(name or id) */
{
return pushresult(L, setgid(mygetgid(L, 1)), NULL);
}
开发者ID:xiongyunkun,项目名称:mcs,代码行数:4,代码来源:lposix.c
示例10: pipe_close
/*
** function to close 'popen' files
*/
static int pipe_close (lua_State *L) {
FILE **p = tofilep(L);
int ok = fclose(*p);
*p = NULL;
return pushresult(L, ok, NULL);
}
开发者ID:ClowReed32,项目名称:Cthugha-Engine-Demos,代码行数:9,代码来源:ex.c
示例11: Psymlink
static int Psymlink(lua_State *L) /** symlink(oldpath,newpath) */
{
const char *oldpath = luaL_checkstring(L, 1);
const char *newpath = luaL_checkstring(L, 2);
return pushresult(L, symlink(oldpath, newpath), NULL);
}
开发者ID:xiongyunkun,项目名称:mcs,代码行数:6,代码来源:lposix.c
示例12: fork
/***
Fork this program.
@function fork
@treturn[1] int `0` in the resulting child process
@treturn[2] int process id of child, in the calling process
@return[3] nil
@treturn[3] string error message
@treturn[3] int errnum
@see fork(2)
@see fork.lua
@see fork2.lua
@usage
local unistd = require "posix.unistd"
local pid, errmsg = unistd.fork ()
if pid == nil then
error (errmsg)
elseif pid == 0 then
print ("in child:", unistd.getpid "pid")
else
print (require "posix.sys.wait".wait (pid))
end
os.exit ()
*/
static int
Pfork(lua_State *L)
{
checknargs(L, 0);
return pushresult(L, fork(), NULL);
}
开发者ID:Nlcke,项目名称:luaposix,代码行数:30,代码来源:unistd.c
示例13: tcgetpgrp
/***
Get id of foreground process group of terminal *fd*.
@function tcgetpgrp
@int fd the file descriptor of the controlling terminal of the current process
@treturn[1] int id of foreground process group
@return[2] nil
@treturn[2] string error message
@treturn[2] int errnum
@see tcgetpgrp(2)
*/
static int
Ptcgetpgrp(lua_State *L)
{
int fd = checkint(L, 1);
return pushresult(L, tcgetpgrp(fd), NULL);
}
开发者ID:Nlcke,项目名称:luaposix,代码行数:16,代码来源:unistd.c
示例14: msgget
/***
Get a message queue identifier
@function msgget
@int key message queue id, or `IPC_PRIVATE` for a new queue
@int[opt=0] flags bitwise OR of zero or more from `IPC_CREAT` and `IPC_EXCL`,
and access permissions `S_IRUSR`, `S_IWUSR`, `S_IRGRP`, `S_IWGRP`, `S_IROTH`
and `S_IWOTH` (from @{posix.sys.stat})
@treturn[1] int message queue identifier, if successful
@return[2] nil
@treturn[2] string error message
@treturn[2] int errnum
@see msgget(2)
*/
static int
Pmsgget(lua_State *L)
{
checknargs (L, 2);
return pushresult(L, msgget(checkint(L, 1), optint(L, 2, 0)), "msgget");
}
开发者ID:batrick,项目名称:luaposix,代码行数:19,代码来源:msg.c
示例15: io_flush
static int io_flush (lua_State *L) {
SAFE_CHECK_FILE_MOD(L);
return pushresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL);
}
开发者ID:zlandau,项目名称:lua-safe,代码行数:4,代码来源:liolib.c
示例16: io_remove
static int io_remove (lua_State *L) {
const char *filename = luaL_checkstring(L, 1);
// return pushresult(L, remove(filename) == 0, filename);
return pushresult(L, 0, filename);
}
开发者ID:foreverlikeyou9999,项目名称:kos-ports,代码行数:5,代码来源:liolib.c
示例17: f_flush
static int f_flush (lua_State *L) {
SAFE_CHECK_FILE_MOD(L);
return pushresult(L, fflush(tofile(L, 1)) == 0, NULL);
}
开发者ID:zlandau,项目名称:lua-safe,代码行数:4,代码来源:liolib.c
示例18: io_rename
static int io_rename (lua_State *L) {
const char *fromname = luaL_checkstring(L, 1);
const char *toname = luaL_checkstring(L, 2);
// return pushresult(L, rename(fromname, toname) == 0, fromname);
return pushresult(L, 0, fromname);
}
开发者ID:foreverlikeyou9999,项目名称:kos-ports,代码行数:6,代码来源:liolib.c
示例19: io_close
static int io_close (lua_State *L) {
IOCtrl *ctrl = (IOCtrl *)lua_touserdata(L, -1);
lua_pop(L, 1); /* remove upvalue */
return pushresult(L, closefile(L, ctrl, getnonullfile(L, ctrl, 1)));
}
开发者ID:AnthonyNystrom,项目名称:GenXSource,代码行数:5,代码来源:liolib.c
示例20: Prmdir
static int Prmdir(lua_State *L) /** rmdir(path) */
{
const char *path = luaL_checkstring(L, 1);
return pushresult(L, rmdir(path), path);
}
开发者ID:Sciumo,项目名称:luaposix,代码行数:5,代码来源:lposix.c
注:本文中的pushresult函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论