set_jmp
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <setjmp.h> 中定义
|
||
#define setjmp(env) /* implementation-defined */ |
||
env
类型jmp_buf到一个变量保存当前的执行上下文。这个变量可以在以后用来恢复当前的执行上下文longjmp功能。即,当呼叫longjmp功能,继续执行在特定呼叫站点构造jmp_buf变量传递到longjmp。在这种情况下,setjmp回报寿值传递给longjmp原文:
Saves the current execution context into a variable
env
of type jmp_buf. This variable can later be used to restore the current execution context by longjmp function. That is, when a call to longjmp function is made, the execution continues at the particular call site that constructed the jmp_buf variable passed to longjmp. In that case setjmp returns tho value passed to longjmp.目录 |
[编辑] 参数
env | - | 变量来保存程序的执行状态.
原文: variable to save the execution state of the program to. |
[编辑] 返回值
0如果宏被称为原代码的执行上下文被保存到
env
.原文:
0 if the macro was called by the original code and the execution context was saved to
env
.如果非本地跳转非零值。在相同的返回值传递给longjmp.
原文:
Non-zero value if a non-local jump was just performed. The return value in the same as passed to longjmp.
[编辑] 示例
本章尚未完成 原因:暂无示例 |
[编辑] 另请参阅
跳转到指定位置 (函数) | |
C++ documentation for setjmp
|