/* * XR_ThreadsDynamicEnvironment.h * Copyright Ó 1990 by Xerox Corporation. All rights reserved. * Last changed by Pavel on May 24, 1990 6:20:59 pm PDT * * Edited by Demers, July 19, 1992 2:06:58 pm PDT */ #ifndef __XR_ThreadsDynamicEnvironment_h #define __XR_ThreadsDynamicEnvironment_h #include typedef struct XR_DynFrameRep { struct XR_DynFrameRep *df_link; XR_Pointer df_key; XR_Pointer df_data[1]; } *XR_DynFrame; extern XR_DynFrame XR_GetDynamicEnvironment(void); /* Returns the current dynamic environment of the current thread. */ extern void XR_SetDynamicEnvironment(XR_DynFrame df); /* Sets the dynamic environment of the current thread to df. */ extern XR_DynFrame XR_LookupInDynamicEnvironment(XR_Pointer key, XR_DynFrame de); /* Returns the first frame in de with the given key, or NIL if there is none. */ extern XR_DynFrame XR_FirstCommonParent(XR_DynFrame de1, XR_DynFrame de2); /* Returns the first frame that is a tail of both arguments, or NIL if there is none. */ extern XR_Pointer XR_UnwindFrameKey; typedef struct XR_UnwindFrameRep { XR_DynFrame uf_link; XR_Pointer uf_key; XR_MesaProc uf_unwinder; XR_MesaProc uf_rewinder; } *XR_UnwindFrame; extern int XR_UnwindTo(XR_DynFrame target); /* Target must be a tail of the current dynamic environment. This call has the same effect as XR_SetDynamicEnvironment except that all unwinders in the difference between the current dynamic environment and target are called, each with the current dynamic environment set to what was in effect when they were pushed. Returns -1 if target is not a tail of the current dynamic environment, and 0 otherwise. NOTE that this call will not return at all if any of the unwinders that it calls does not do so. */ extern int XR_RewindTo(XR_DynFrame target); /* The current dynamic environment must be a tail of target. This call has the same effect as XR_SetDynamicEnvironment except that all rewinders in the difference between target and the current dynamic environment are called, each with the current dynamic environment set to what was in effect when they were pushed. Returns -1 if the current dynamic environment is not a tail of target, and 0 otherwise. NOTE that this call will not return at all if any of the rewinders that it calls does not do so. */ #endif /* __XR_ThreadsDynamicEnvironment_h */