/*
* Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
* $Id: exc.h,v 1.23 2001/06/07 20:04:53 ca Exp $
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
** libsm exception handling
*/
#ifndef SM_EXC_H
# define SM_EXC_H
/*
** Exception types
*/
extern const char SmExcTypeMagic[];
struct sm_exc_type
{
const char *sm_magic;
const char *etype_category;
const char *etype_argformat;
const char *etype_printcontext;
};
extern const SM_EXC_TYPE_T SmEtypeOs;
extern const SM_EXC_TYPE_T SmEtypeErr;
extern void
/*
** Exception objects
*/
extern const char SmExcMagic[];
union sm_val
{
int v_int;
long v_long;
char *v_str;
};
struct sm_exc
{
const char *sm_magic;
};
{ \
SmExcMagic, \
0, \
type, \
argv, \
}
extern SM_EXC_T *
const SM_EXC_TYPE_T *_type,
...));
extern SM_EXC_T *
extern void
extern bool
const char *_pattern));
extern void
extern void
extern SM_DEAD(void
extern SM_DEAD(void
const SM_EXC_TYPE_T *_type,
...)));
/*
** Exception handling
*/
extern void
struct sm_exc_handler
{
int eh_state;
};
/* values for eh_state */
enum
{
SM_EH_POPPED = 0,
};
extern SM_EXC_HANDLER_T *SmExcHandler;
do { \
SmExcHandler = &_h; \
} \
break; \
} \
? SM_EH_HANDLED : SM_EH_POPPED; \
# define SM_END_TRY } \
} while (0); \
} else \
}
#endif /* SM_EXC_H */