set_jmp

来自cppreference.com

 
 
程序支持实用程序
程序终止
Original:
Program termination
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
abort
exit
quick_exit(C++11)
_Exit(C++11)
与环境沟通
Original:
Communicating with the environment
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
信号
Original:
Signals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
信号类型
Original:
Signal types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
SIGABRT
SIGFPE
SIGILL
SIGINT
SIGSEGV
SIGTERM
非本地跳跃
Original:
Non-local jumps
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
setjmp
longjmp
类型
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
jmp_buf
 
Defined in header <setjmp.h>
#define setjmp(env) /* implementation-defined */
env类型jmp_buf到一个变量保存当前的执行上下文。这个变量可以在以后用来恢复当前的执行上下文longjmp功能。即,当呼叫longjmp功能,继续执行在特定呼叫站点构造jmp_buf变量传递到longjmp。在这种情况下,setjmp回报寿值传递给longjmp
Original:
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.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目录

[编辑] 参数

env -
变量来保存程序的执行状态.
Original:
variable to save the execution state of the program to.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 返回值

0如果宏被称为原代码的执行上下文被保存到env.
Original:
0 if the macro was called by the original code and the execution context was saved to env.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
如果非本地跳转非零值。在相同的返回值传递给longjmp.
Original:
Non-zero value if a non-local jump was just performed. The return value in the same as passed to longjmp.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 为例

[编辑] 另请参阅

跳转到指定的位置
Original:
jumps to specified location
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数) [edit]