Uno/Binary/Spec/Environment Stack
From Apache OpenOffice Wiki
state: draft
type: specification
Environment Stack
Feature
Environments can be:
- entered or
- left, respectively
- invoked
by a thread. The current threads environment can be asked for.
Multiple purpose environments can be entered/invoked at the same time. Purposes of environment can be specified in any particular order:
"uno:A:B:C"
Where the order may be relevant, depending on the purpose environments.
Rationale
API
The Enterable interface, optionally be implemented by purp environments:
typedef void uno_Enterable_enter (void * context); typedef void uno_Enterable_leave (void * context); typedef void uno_Enterable_callInto_v(void * context, uno_EnvCallee * pCallee, va_list param); typedef void uno_Enterable_callOut_v (void * context, uno_EnvCallee * pCallee, va_list param); typedef int uno_Enterable_isValid_v (void * context, rtl_uString ** ppReason); typedef struct { uno_Enterable_enter * m_enter; uno_Enterable_leave * m_leave; uno_Enterable_callInto_v * m_callInto_v; uno_Enterable_callOut_v * m_callOut_v; uno_Enterable_isValid_v * m_isValid; } uno_Enterable;
The client API, which is thread affine:
void SAL_CALL uno_getCurrentEnvironment(uno_Environment ** ppEnv, char const * pEnv_type) SAL_THROW_EXTERN_C(); typedef void uno_EnvCallee(va_list); void SAL_CALL uno_Environment_invoke_v(uno_Environment * pEnv, uno_EnvCallee * pCallee, va_list param) SAL_THROW_EXTERN_C(); void SAL_CALL uno_Environment_invoke (uno_Environment * pEnv, uno_EnvCallee * pCallee, ...) SAL_THROW_EXTERN_C(); void SAL_CALL uno_Environment_enter(uno_Environment * pEnv) SAL_THROW_EXTERN_C(); int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pReason) SAL_THROW_EXTERN_C(); uno_Environment->pReserved == uno_Enterable *
Dependencies
- None.