File:  [MW Coherent from dump] / coherent / b / STREAMS / conf / bin / src / ehand.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:36 2019 UTC (7 years, 2 months ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

#ifndef	EHAND_H
#define	EHAND_H

/*
 *-IMPORTS:
 *	<sys/compat.h>
 *		CONST
 *		EXTERN_C_BEGIN
 *		EXTERN_C_END
 *		PROTO ()
 *	<setjmp.h>
 *		jmp_buf
 *		setjmp ()
 */

#include <sys/compat.h>
#include <setjmp.h>

/*
 * Structure used for error control.
 */

typedef struct ehandler	ehand_t;

struct ehandler {
	ehand_t	      *	eh_next;
	jmp_buf		eh_buf;
};

extern ehand_t	      *	estack_base;

#define	PUSH_HANDLER(eh)	setjmp (((eh).eh_next = estack_base,\
					 estack_base = & (eh), (eh).eh_buf))
#define	POP_HANDLER(eh)		(estack_base != & (eh) ? \
				 error_error (__FILE__, __LINE__) : \
				 (void) (estack_base = (eh).eh_next))
#define	CHAIN_ERROR(eh)		(chain_error (& (eh)))


EXTERN_C_BEGIN

NO_RETURN void	throw_error	PROTO ((CONST char * _fmt, ...));
void		report_error	PROTO ((CONST char * _fmt, ...));
void		error_error	PROTO ((CONST char * _file, int _line));
void		chain_error	PROTO ((ehand_t * _ehand));

EXTERN_C_END


#endif	/* ! define (EHAND_H) */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.