unit dlongjump;

interface

uses
  dobjects;

type
PLongJump = ^TLongJump;
TLongJump = object(TObject)
private
  FJumpBuf: jmp_buf;
public
  function Save: LongInt;
  procedure Jump(Code: LongInt);
end;

implementation

function TLongJump.Save: LongInt;
begin
  Result := SetJmp(FJumpBuf);
end;

procedure TLongJump.Jump(Code: LongInt);
begin
  Result := LongJmp(FJumpBuf, Code);
end;

end.
