Uno/Binary/Spec/Environment Stack
Type: specification
State: draft
Feature
The Uno/Spec/Environment Stack for Binary Uno.
Uno/Binary/Spec/Environments can be:
- entered or
- left, respectively
- invoked
by a thread. The currently entered Uno/Binary/Spec/environment can be retrieved.
Multiple purpose environments can be entered/invoked at the same time.
Purposes of environment can be specified in any particular order, e.g.:
[cpp]
"uno:A:B:C"
Where the order may be relevant, depending on the purpose environments.
Rationale
API
The prototype for a callee:
[cpp]
typedef void uno_EnvCallee(va_list);
The Enterable interface, to be optionally implemented by Uno/Binary/Spec/Purpose Environments:
[cpp]
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:
[cpp]
void SAL_CALL uno_getCurrentEnvironment(uno_Environment ** ppEnv, char const * pEnv_type) SAL_THROW_EXTERN_C();
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 *