这篇教程C++ tolstream函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中tolstream函数的典型用法代码示例。如果您正苦于以下问题:C++ tolstream函数的具体用法?C++ tolstream怎么用?C++ tolstream使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了tolstream函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: f_tostringstatic int f_tostring(lua_State *L) { LStream *p = tolstream(L); if (isclosed(p)) lua_pushliteral(L, "file (closed)"); else lua_pushfstring(L, "file (%p)", p->f); return 1;}
开发者ID:Allowed,项目名称:Protheus,代码行数:8,
示例2: f_gcstatic int f_gc (lua_State *L) {#if !defined(USE_FATFS) LStream *p = tolstream(L); if (!isclosed(p) && p->f != NULL) aux_close(L); /* ignore closed and incompletely open files */#endif return 0;}
开发者ID:RonDePrez,项目名称:opentx,代码行数:8,
示例3: aux_closestatic int aux_close (lua_State *L) {#if !defined(USE_FATFS) LStream *p = tolstream(L); lua_CFunction cf = p->closef; p->closef = NULL; /* mark stream as closed */ return (*cf)(L); /* close it */#else return 0;#endif}
开发者ID:RonDePrez,项目名称:opentx,代码行数:10,
示例4: tolstreamstatic FILE *tofile (lua_State *L) { LStream *p = tolstream(L);#if defined(USE_FATFS) return &p->f;#else if (isclosed(p)) luaL_error(L, "attempt to use a closed file"); lua_assert(p->f); return p->f;#endif}
开发者ID:RonDePrez,项目名称:opentx,代码行数:11,
示例5: io_pclose/*** 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));}
开发者ID:Allowed,项目名称:Protheus,代码行数:7,
示例6: io_fclose/*** function to close regular files*/static int io_fclose(lua_State *L) { LStream *p = tolstream(L); int res = fclose(p->f); return luaL_fileresult(L, (res == 0), NULL);}
开发者ID:Allowed,项目名称:Protheus,代码行数:8,
示例7: f_gcstatic int f_gc(lua_State *L) { LStream *p = tolstream(L); if (!isclosed(p) && p->f != NULL) aux_close(L); /* ignore closed and incompletely open files */ return 0;}
开发者ID:Allowed,项目名称:Protheus,代码行数:6,
示例8: aux_closestatic int aux_close(lua_State *L) { LStream *p = tolstream(L); lua_CFunction cf = p->closef; p->closef = NULL; /* mark stream as closed */ return (*cf)(L); /* close it */}
开发者ID:Allowed,项目名称:Protheus,代码行数:6,
示例9: io_readstatic int io_read (lua_State *L) { LStream *p = tolstream(L); size_t l = (size_t)lua_tointeger(L, 2); read_chars(L, &p->f, l); return 1;}
开发者ID:RonDePrez,项目名称:opentx,代码行数:6,
注:本文中的tolstream函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ tolua_beginmodule函数代码示例 C++ tolower函数代码示例 |