/****************************************************************************
 *
 *	Copyright (C) 1984-2006 Micro Focus (IP) Limited.
 *
 *	All rights reserved.  Unpublished, all rights reserved under
 *	copyright law and international treaty.  Use of a copyright notice
 *	is precautionary only and does not imply publication or disclosure.
 *	This software contains confidential information and trade secrets of
 *	Micro Focus International Ltd, and no part of this program or
 *	publication may be reproduced, transmitted, transcribed, stored in
 *	a retrieval system, or translated into any language or computer
 *	language, in any form or by any means, electronic, mechanical,
 *	magnetic, optical, chemical, manual or otherwise, without the prior
 *	written permission of:
 *
 *	Micro Focus International Ltd,
 *	The Lawn, Old Bath Road, Newbury, Berkshire, RG14 1QN, UK.
 *	(01635) 32646
 *
 *	RESTRICTED RIGHTS LEGEND
 *	Use, duplication, or disclosure by the Government is subject to
 *	restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
 *	in Technical Data and Computer Software clause at DFARS 52.227-7013
 *	or subparagraphs (c)(1) and (2) of Commercial Computer Software -
 *	Restricted Rights at 48 CFR 52.227-19, as applicable.  Contact
 *	Micro Focus International Ltd, 701 East Middlefield Road,
 *	Mountain View, California 94043, USA.
 *
 *	Genesis Run Time System (Studio/Server 5.0 Freeze)
 *
 *	@(#)cobsetjmp.h	11.1
 *
 *	Last Modified on 05/01/28 at 10:06:17
 *
 ****************************************************************************/

/** Start of source module cobsetjmp.h **/

#ifndef _COBSETJMP_H
#define _COBSETJMP_H

/* This file, which is supplied in $COBDIR/include, prototypes the documented
 * cob prefix Cobol setjmp/longjmp routines and structures.
 */

#ifdef	__cplusplus
extern "C" {
#endif

#include <setjmp.h>

struct cobjmp_buf
{
    int		 j_size;
    int		 j_sum;
    int		 j_seg;
    void	*j_rsvp;
    void	*j_thread;
    void	*j_pc;
    jmp_buf	 j_buf;
    void	*j_expand;
};

/* New documented interface: cobsetjmp() and coblongjmp().
 * Old documented interface: cobsavenv() and coblongjmp().
 */
void	*cobsavenv(struct cobjmp_buf *save);
void 	*cobsavenv2(struct cobjmp_buf *save, int size);
void	 coblongjmp(struct cobjmp_buf *restore);

#define	 cobsetjmp(buf)	setjmp(cobsavenv2(buf, sizeof(struct cobjmp_buf)))

#ifdef	__cplusplus
}
#endif

#endif /* _COBSETJMP_H */

/** End of source module cobsetjmp.h **/
