RDEBUG2("top_frame %s", is_top_frame(frame) ? "yes" : "no");
RDEBUG2("repeat %s", is_repeatable(frame) ? "yes" : "no");
RDEBUG2("resumable %s", is_yielded(frame) ? "yes" : "no");
- RDEBUG2("cancelled %s", is_cancelled(frame) ? "yes" : "no");
+ RDEBUG2("unwind %s", is_unwinding(frame) ? "yes" : "no");
if (frame->instruction) {
RDEBUG2("control %s%s%s",
fr_table_str_by_value(mod_rcode_table, *result, "<invalid>"),
*priority);
- if (is_cancelled(frame)) {
+ if (is_unwinding(frame)) {
RDEBUG4("** [%i] %s - frame is cancelled",
stack->depth, __FUNCTION__);
frame->result = *result;
* asynchronously, and the process function
* may not be aware that it's happened.
*/
- if (is_cancelled(frame)) goto calculate_result;
+ if (is_unwinding(frame)) goto calculate_result;
switch (ua) {
case UNLANG_ACTION_STOP_PROCESSING:
* back on up the stack.
*/
- if (!is_cancelled(frame) && is_repeatable(frame)) {
+ if (!is_unwinding(frame) && is_repeatable(frame)) {
fa = UNLANG_FRAME_ACTION_NEXT;
continue;
}
* it's not cancellable, and we need to let the
* request progress normally.
*/
- if (stack && is_yielded(frame) && is_cancelled(frame) && !unlang_request_is_scheduled(request)) {
+ if (stack && is_yielded(frame) && is_unwinding(frame) && !unlang_request_is_scheduled(request)) {
unlang_interpret_mark_runnable(request);
}
}
///< interpreting and return, control then passes
///< to whatever called the interpreter.
UNLANG_FRAME_FLAG_YIELDED = 0x04, //!< frame has yielded
- UNLANG_FRAME_FLAG_CANCEL = 0x08, //!< This frame has been marked up for cancellation.
+ UNLANG_FRAME_FLAG_UNWIND = 0x08, //!< This frame should be unwound without evaluation.
} unlang_frame_flag_t;
DIAG_ON(attributes)
static inline void repeatable_set(unlang_stack_frame_t *frame) { frame->flag |= UNLANG_FRAME_FLAG_REPEAT; }
static inline void top_frame_set(unlang_stack_frame_t *frame) { frame->flag |= UNLANG_FRAME_FLAG_TOP_FRAME; }
static inline void yielded_set(unlang_stack_frame_t *frame) { frame->flag |= UNLANG_FRAME_FLAG_YIELDED; }
-static inline void cancel_set(unlang_stack_frame_t *frame) { frame->flag |= UNLANG_FRAME_FLAG_CANCEL; }
+static inline void unwind_set(unlang_stack_frame_t *frame) { frame->flag |= UNLANG_FRAME_FLAG_UNWIND; }
static inline void repeatable_clear(unlang_stack_frame_t *frame) { frame->flag &= ~UNLANG_FRAME_FLAG_REPEAT; }
static inline void top_frame_clear(unlang_stack_frame_t *frame) { frame->flag &= ~UNLANG_FRAME_FLAG_TOP_FRAME; }
static inline void yielded_clear(unlang_stack_frame_t *frame) { frame->flag &= ~UNLANG_FRAME_FLAG_YIELDED; }
-static inline void cancel_clear(unlang_stack_frame_t *frame) { frame->flag &= ~UNLANG_FRAME_FLAG_CANCEL; }
+static inline void unwind_clear(unlang_stack_frame_t *frame) { frame->flag &= ~UNLANG_FRAME_FLAG_UNWIND; }
static inline bool is_repeatable(unlang_stack_frame_t const *frame) { return frame->flag & UNLANG_FRAME_FLAG_REPEAT; }
static inline bool is_top_frame(unlang_stack_frame_t const *frame) { return frame->flag & UNLANG_FRAME_FLAG_TOP_FRAME; }
static inline bool is_yielded(unlang_stack_frame_t const *frame) { return frame->flag & UNLANG_FRAME_FLAG_YIELDED; }
-static inline bool is_cancelled(unlang_stack_frame_t const *frame) { return frame->flag & UNLANG_FRAME_FLAG_CANCEL; }
+static inline bool is_unwinding(unlang_stack_frame_t const *frame) { return frame->flag & UNLANG_FRAME_FLAG_UNWIND; }
static inline bool _instruction_has_debug_braces(unlang_t const *instruction) { return unlang_ops[instruction->type].flag & UNLANG_OP_FLAG_DEBUG_BRACES; }
static inline bool _frame_has_debug_braces(unlang_stack_frame_t const *frame) { return unlang_ops[frame->instruction->type].flag & UNLANG_OP_FLAG_DEBUG_BRACES; }
for (i = depth; i >= to_depth; i--) {
frame = &stack->frame[i];
if (!is_cancellable(frame)) continue;
- frame->flag |= UNLANG_FRAME_FLAG_CANCEL;
+ unwind_set(frame);
}
return UNLANG_ACTION_CALCULATE_RESULT;
* If the frame was cancelled, the signal function will
* have already been called.
*/
- if (!is_cancelled(frame) && is_repeatable(frame)) {
+ if (!is_unwinding(frame) && is_repeatable(frame)) {
if (frame->signal) frame->signal(request, frame, FR_SIGNAL_CANCEL);
repeatable_clear(frame);
}