10 #define __AFW_XCTX_H__
31 #define AFW_XCTX_Q_NAME_BASE "base"
34 #define AFW_XCTX_s_NAME_BASE afw_s_base
37 #define AFW_XCTX_Q_NAME_REQUEST_THREAD "request_thread"
40 #define AFW_XCTX_s_NAME_REQUEST_THREAD afw_s_request_thread
43 #define AFW_XCTX_Q_NAME_REQUEST_SESSION "request_session"
46 #define AFW_XCTX_s_NAME_REQUEST_SESSION afw_s_request_session
78 #define afw_xctx_evaluation_stack_push_value(VALUE, xctx) \
79 afw_stack_push_direct(xctx->evaluation_stack, xctx); \
80 (xctx)->evaluation_stack->top->value = VALUE
88 #define afw_xctx_evaluation_stack_push_parameter_number( \
89 PARAMETER_NUMBER, xctx) \
90 afw_stack_push_direct(xctx->evaluation_stack, xctx); \
91 (xctx)->evaluation_stack->top->parameter_number =PARAMETER_NUMBER; \
92 afw_stack_push_direct(xctx->evaluation_stack, xctx); \
93 (xctx)->evaluation_stack->top->entry_id = &afw_s_parameter_number
100 #define afw_xctx_evaluation_stack_pop(xctx) \
101 if (xctx->evaluation_stack->top->entry_id == &afw_s_parameter_number) { \
102 afw_stack_pop(xctx->evaluation_stack, xctx); \
104 afw_stack_pop(xctx->evaluation_stack, xctx)
113 #define afw_xctx_evaluation_stack_pop_value(xctx) \
114 afw_stack_pop(xctx->evaluation_stack, xctx)
124 #define afw_xctx_evaluation_stack_pop_parameter_number(xctx) \
125 afw_stack_pop(xctx->evaluation_stack, xctx); \
126 afw_stack_pop(xctx->evaluation_stack, xctx)
133 #define afw_xctx_evaluation_stack_save_top(xctx) \
134 afw_xctx_evaluation_stack_entry_t *evaluation_stack_save_top = \
135 xctx->evaluation_stack->top
142 #define afw_xctx_evaluation_stack_restore_top(xctx) \
143 xctx->evaluation_stack->top = evaluation_stack_save_top
175 return xctx->env->terminating;
185 #define afw_xctx_calloc(size, xctx) \
186 afw_pool_calloc((xctx)->p, (size), (xctx))
199 #define afw_xctx_calloc_type(type, xctx) \
200 (type *) afw_pool_calloc((xctx)->p, sizeof(type), (xctx))
209 #define afw_xctx_malloc(size, xctx) \
210 afw_pool_malloc((xctx)->p, (size), (xctx))
223 #define afw_xctx_malloc_type(type, xctx) \
224 (type *) afw_pool_malloc((xctx)->p, sizeof(type), (xctx))
239 #define AFW_XCTX_SECURE_BEGIN \
241 afw_boolean_t this_SCOPE_save_secure = xctx->secure; \
242 xctx->secure = true; \
250 #define AFW_XCTX_SECURE_END \
252 xctx->secure = this_SCOPE_save_secure; \
328 AFW_DEFINE_STATIC_INLINE(
int)
332 xctx->current_frame_index = xctx->stack->nelts;
333 return xctx->stack->nelts;
342 AFW_DEFINE_STATIC_INLINE(
void)
346 xctx->stack->nelts = top;
347 xctx->current_frame_index = top;
507 #define AFW_XCTX_AUTHORIZATION_MODE_BEGIN(modeId) \
508 const afw_value_t *this_PREVIOUS_MODE = \
509 xctx->mode = afw_authorization_mode_id_ ## modeId ## _value; \
518 #define AFW_XCTX_AUTHORIZATION_MODE_END \
520 xctx->mode = this_PREVIOUS_MODE; \
AFW_DEFINE(const afw_object_t *)
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
#define AFW_STACK_STRUCT(struct_name, entry_type)
Define a struct for a stack with the specified entry type.
apr_size_t afw_size_t
size_t.
const afw_value_t *(* afw_xctx_get_variable_t)(const afw_xctx_qualifier_stack_entry_t *entry, const afw_utf8_t *name, afw_xctx_t *xctx)
Typedef for function to get a qualified variable.
apr_int64_t afw_integer_t
typedef for big signed int.
void afw_xctx_define_variable(const afw_utf8_t *name, const afw_value_t *value, afw_xctx_t *xctx)
Defined a variable in current xctx frame.
int afw_xctx_begin_stack_frame(afw_xctx_t *xctx)
Begin stack frame.
afw_xctx_qualifiers_object_create(afw_boolean_t for_testing, const afw_pool_t *p, afw_xctx_t *xctx)
Create object to access active qualified variables.
void afw_xctx_set_local_variable(const afw_utf8_t *name, const afw_value_t *value, afw_xctx_t *xctx)
Set a variable then current xctx frame.
const afw_value_t * afw_xctx_get_qualified_variable(const afw_utf8_t *qualifier, const afw_utf8_t *name, afw_xctx_t *xctx)
Get a variable from xctx stack.
int afw_xctx_get_qualifier_stack_top(afw_xctx_t *xctx)
Get qualifier stack top.
void afw_xctx_push_qualifier_object(const afw_utf8_t *qualifier_name, const afw_object_t *qualifier_object, afw_boolean_t secure, const afw_pool_t *p, afw_xctx_t *xctx)
Push qualifier object on to stack.
afw_boolean_t afw_xctx_environment_is_terminating(afw_xctx_t *xctx)
Test for environment terminating.
afw_xctx_qualifier_object_create(const afw_utf8_t *qualifier, afw_boolean_t for_testing, const afw_pool_t *p, afw_xctx_t *xctx)
Create object to access active variables for a qualifier.
void afw_xctx_push_qualifiers_object(const afw_object_t *context_object, afw_boolean_t secure, const afw_pool_t *p, afw_xctx_t *xctx)
Push qualifiers object on to stack.
void afw_xctx_set_qualifier_stack_top(int top, afw_xctx_t *xctx)
Set stack top index.
void afw_xctx_end_stack_frame(int top, afw_xctx_t *xctx)
Set stack top.
afw_xctx_t * afw_xctx_create(const afw_utf8_t *name, afw_integer_t number, afw_xctx_t *xctx)
Create an Adaptive Framework xctx.
void afw_xctx_set_defined_variable(const afw_utf8_t *name, const afw_value_t *value, afw_xctx_t *xctx)
Set a defined variable in xctx.
afw_xctx_qualifier_stack_entry_t * afw_xctx_push_qualifier(const afw_utf8_t *qualifier, const afw_object_t *qualifier_object, afw_boolean_t secure, afw_xctx_get_variable_t get, void *data, const afw_pool_t *p, afw_xctx_t *xctx)
Push qualifier on to stack.
Interface afw_object public struct.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Interface afw_value public struct.
The execution context (xctx) evaluation stack entry.
const afw_object_t * qualifier_object
qualifier_object. This may be NULL now.
void * data
Data that will be passed to get/set.
const afw_pool_t * p
Pool used while processing entry.
afw_utf8_t qualifier
qualifier or len=0 if unqualified.
afw_xctx_get_variable_t get
Get routine or NULL if get not allowed.
void * wa
Work area used by get/set.
afw_boolean_t secure
Secure access to this qualifier is allowed.
Interface afw_xctx public struct.