Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/dinkum_en/ecpp/setjmp.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/dinkum_en/ecpp/setjmp.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/dinkum_en/ecpp/setjmp.html on line 4

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/dinkum_en/ecpp/setjmp.html on line 4
[Previous] [Contents] [Next]

<setjmp.h>


Include the standard header <setjmp.h> to perform control transfers that bypass the normal function call and return protocol.

#define setjmp(jmp_buf env) <int rvalue>

typedef a-type jmp_buf;
void longjmp(jmp_buf env, int val);

jmp_buf

typedef a-type jmp_buf;

The type is the array type a-type of an object that you declare to hold the context information stored by setjmp and accessed by longjmp.

longjmp

void longjmp(jmp_buf env, int val);

The function causes a second return from the execution of setjmp that stored the current context value in env. If val is nonzero, the return value is val; otherwise, it is 1.

The function that was active when setjmp stored the current context value must not have returned control to its caller. An object with dynamic duration that does not have a volatile type and whose stored value has changed since the current context value was stored will have a stored value that is indeterminate.

setjmp

#define setjmp(jmp_buf env) <int rvalue>

The macro stores the current context value in the array designated by env and returns zero. A later call to longjmp that accesses the same context value causes setjmp to again return, this time with a nonzero value. You can use the macro setjmp only in an expression that:

You can write such an expression only as the expression part of a do, expression, for, if, if-else, switch,, or while statement.


See also the Table of Contents and the Index.

Copyright © 1989-2002 by P.J. Plauger and Jim Brodie. All rights reserved.

[Previous] [Contents] [Next]

Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/dinkum_en/ecpp/setjmp.html on line 104

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/dinkum_en/ecpp/setjmp.html on line 104