/****************************************************************************
 *
 *	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)
 *
 *	@(#)cobsignal.h	11.1
 *
 *	Last Modified on 05/01/28 at 10:06:17
 *
 ****************************************************************************/

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

#ifndef   _COBSIGNAL_H
#define   _COBSIGNAL_H

/* This file, which is supplied in $COBDIR/include, prototypes the documented
 * cob prefix signal handling routines.
 */

#ifdef	__cplusplus
extern "C" {
#endif

#ifndef	OS_SIGINFO
typedef	void 	*os_siginfo;
typedef void	*os_context;
#endif

typedef struct mf_siginfo
{
    cobuns16_t	 msi_unused;
    cobuns16_t	 msi_flags;
    void	*msi_expand;
    os_siginfo	*msi_osinfo;
    os_context	*msi_context;
    union
    {
	void	*msi_address;
    } msi_union;
} cobsiginfo_t;

#define	msi_addr	msi_union.msi_address

/* Values for msi_flags: */
#define	MSI_NONE	0		/* msi_addr unused */
#define MSI_ADDR	1		/* msi_addr set */

typedef void		*cobsigtype_t;
typedef int		(*PFI_SIG)(int sig, cobsiginfo_t *mfinfo);

cobsigtype_t cobpostsighandler(int sig, int pr, PFI_SIG hand);
void	     cobremovesighandler(cobsigtype_t handler);

/* Types for backwards compatibility with Server Express 1.0: */
typedef	cobsigtype_t	mf_sigtype;
typedef	cobsiginfo_t	mf_siginfo;

#ifdef	__cplusplus
}
#endif

#endif /* _COBSIGNAL_H */

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