* This number is pretty arbitrary, but it seems
* like too low level to make into a tuneable.
*/
- return talloc_pooled_object(ctx, unlang_stack_t, UNLANG_STACK_MAX / 4, sizeof(unlang_stack_state_t));
+ return talloc_pooled_object(ctx, unlang_stack_t, UNLANG_STACK_MAX / 4, sizeof(unlang_frame_state_t));
#else
return talloc_zero(ctx, unlang_stack_t);
#endif
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
unlang_event_t *ev;
unlang_module_call_t *sp;
- unlang_stack_state_modcall_t *ms = talloc_get_type_abort(frame->state,
- unlang_stack_state_modcall_t);
+ unlang_frame_state_modcall_t *ms = talloc_get_type_abort(frame->state,
+ unlang_frame_state_modcall_t);
rad_assert(stack->depth > 0);
rad_assert((frame->instruction->type == UNLANG_TYPE_MODULE_CALL) ||
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
unlang_event_t *ev;
unlang_module_call_t *sp;
- unlang_stack_state_modcall_t *ms = talloc_get_type_abort(frame->state,
- unlang_stack_state_modcall_t);
+ unlang_frame_state_modcall_t *ms = talloc_get_type_abort(frame->state,
+ unlang_frame_state_modcall_t);
rad_assert(stack->depth > 0);
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
unlang_t *instruction = frame->instruction;
- unlang_stack_state_modcall_t *ms;
+ unlang_frame_state_modcall_t *ms;
#ifndef NDEBUG
int unlang_indent = request->log.unlang_indent;
goto done;
}
- frame->state = ms = talloc_zero(stack, unlang_stack_state_modcall_t);
+ frame->state = ms = talloc_zero(stack, unlang_frame_state_modcall_t);
/*
* Grab the thread/module specific data if any exists.
unlang_resume_t *mr;
unlang_module_call_t *mc;
- unlang_stack_state_modcall_t *ms = NULL;
+ unlang_frame_state_modcall_t *ms = NULL;
rad_assert(stack->depth > 0);
if (!mr->signal) return;
mc = unlang_generic_to_module_call(mr->parent);
- ms = talloc_get_type_abort(frame->state, unlang_stack_state_modcall_t);
+ ms = talloc_get_type_abort(frame->state, unlang_frame_state_modcall_t);
((fr_unlang_module_signal_t)mr->signal)(request,
mc->module_instance->dl_inst->data, ms->thread->data,
unlang_resume_t *mr = unlang_generic_to_resume(instruction);
unlang_module_call_t *mc = unlang_generic_to_module_call(mr->parent);
- unlang_stack_state_modcall_t *ms = NULL;
+ unlang_frame_state_modcall_t *ms = NULL;
rad_assert(mr->parent->type == UNLANG_TYPE_MODULE_CALL);
- ms = talloc_get_type_abort(frame->state, unlang_stack_state_modcall_t);
+ ms = talloc_get_type_abort(frame->state, unlang_frame_state_modcall_t);
/*
* Lock is noop unless instance->mutex is set.
*/
typedef struct {
module_thread_instance_t *thread; //!< thread-local data for this module
-} unlang_stack_state_modcall_t;
+} unlang_frame_state_modcall_t;
/** State of a foreach loop
*
#ifndef NDEBUG
int indent; //!< for catching indentation issues
#endif
-} unlang_stack_state_foreach_t;
+} unlang_frame_state_foreach_t;
/** State of a redundant operation
*
typedef struct {
unlang_t *child;
unlang_t *found;
-} unlang_stack_state_redundant_t;
+} unlang_frame_state_redundant_t;
/** Our interpreter stack, as distinct from the C stack
*
bool top_frame : 1; //!< are we the top frame of the stack?
union {
- unlang_stack_state_foreach_t foreach; //!< Foreach iterator state.
- unlang_stack_state_redundant_t redundant; //!< Redundant section state.
+ unlang_frame_state_foreach_t foreach; //!< Foreach iterator state.
+ unlang_frame_state_redundant_t redundant; //!< Redundant section state.
};
} unlang_stack_frame_t;
typedef struct {
fr_value_box_t *result; //!< Where to store the result of the
///< xlat expansion. This is usually discarded.
-} unlang_stack_state_xlat_inline_t;
+} unlang_frame_state_xlat_inline_t;
/** State of an xlat expansion
*
///< asynchronous xlat functions.
bool alternate; //!< record which alternate branch we
///< previously took.
-} unlang_stack_state_xlat_t;
+} unlang_frame_state_xlat_t;
/** Static instruction for performing xlat evaluations
*
REQUEST *request, xlat_exp_t const *exp, bool top_frame)
{
- unlang_stack_state_xlat_t *state;
+ unlang_frame_state_xlat_t *state;
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame;
/*
* Allocate its state, and setup a cursor for the xlat nodes
*/
- frame->state = state = talloc_zero(stack, unlang_stack_state_xlat_t);
+ frame->state = state = talloc_zero(stack, unlang_frame_state_xlat_t);
state->exp = exp;
fr_cursor_init(&state->values, out);
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
- unlang_stack_state_xlat_t *xs = talloc_get_type_abort(frame->state, unlang_stack_state_xlat_t);
+ unlang_frame_state_xlat_t *xs = talloc_get_type_abort(frame->state, unlang_frame_state_xlat_t);
xlat_exp_t const *child = NULL;
xlat_action_t xa;
unlang_stack_frame_t *frame = &stack->frame[stack->depth];
unlang_t *instruction = frame->instruction;
unlang_resume_t *mr = unlang_generic_to_resume(instruction);
- unlang_stack_state_xlat_t *xs = talloc_get_type_abort(frame->state, unlang_stack_state_xlat_t);
+ unlang_frame_state_xlat_t *xs = talloc_get_type_abort(frame->state, unlang_frame_state_xlat_t);
xlat_action_t xa;
xa = xlat_frame_eval_resume(xs->ctx, &xs->values, mr->callback, xs->exp, request, &xs->result, rctx);
if (!mx->exec) {
TALLOC_CTX *pool;
- unlang_stack_state_xlat_inline_t *state;
+ unlang_frame_state_xlat_inline_t *state;
- MEM(frame->state = state = talloc_zero(stack, unlang_stack_state_xlat_inline_t));
+ MEM(frame->state = state = talloc_zero(stack, unlang_frame_state_xlat_inline_t));
MEM(pool = talloc_pool(frame->state, 1024)); /* Pool to absorb some allocs */
xlat_unlang_push(pool, &state->result, request, mx->exp, false);