RAD Studio
ContentsIndex
PreviousUpNext
setjmp.h

The following functions, macros, and classes are provided in setjmp.h:

Name 
Description 
Header File
setjmp.h
Category
Miscellaneous Routines
Prototype
void longjmp(jmp_buf jmpb, int retval);
Description
Performs nonlocal goto.
A call to longjmp restores the task state captured by the last call to setjmp with the argument jmpb. It then returns in such a way that setjmp appears to have returned with the value retval.
A Win32 task state includes:
  • Register variables
  • EBX, EDI, ESI
  • Stack pointer (ESP)
  • Frame pointer (EBP)
  • No segment registers are saved
  • Flags are not saved
A task state is complete enough that setjmp and longjmp can be used to implement co-routines.
setjmp must be called before longjmp. The... more 
Header File
setjmp.h
Category
Miscellaneous Routines
Prototype
int setjmp(jmp_buf jmpb);
Description
Sets up for nonlocal goto.
setjmp captures the complete task state in jmpb and returns 0.
A later call to longjmp with jmpb restores the captured task state and returns in such a way that setjmp appears to have returned with the value val.
Under Win32, a task state includes:
  • No segment registers are saved
  • Register variables
  • EBX, EDI, ESI
  • Stack pointer (ESP)
  • Frame pointer (EBP)
  • Flags are not saved
A task state is complete enough that setjmp can be used to implement co-routines.
setjmp must be called before... more 
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!