From: Alan T. DeKok Date: Tue, 23 May 2017 19:45:29 +0000 (-0400) Subject: rename things to be simpler X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a0d1fff8a8fb4c7176a1211965dffdd7be1f33b;p=thirdparty%2Ffreeradius-server.git rename things to be simpler --- diff --git a/src/include/interpreter.h b/src/include/interpreter.h index ec1175c1290..02689ef0c3c 100644 --- a/src/include/interpreter.h +++ b/src/include/interpreter.h @@ -255,7 +255,7 @@ typedef unlang_action_t (*unlang_op_func_t)(REQUEST *request, unlang_stack_t *st typedef struct { char const *name; //!< Name of the operation. unlang_op_func_t func; //!< Function pointer, that we call to perform the operation. - bool children; //!< Whether the operation can contain children. + bool debug_braces; //!< Whether the operation needs to print braces in debug mode } unlang_op_t; extern unlang_op_t unlang_ops[]; diff --git a/src/main/unlang_interpret.c b/src/main/unlang_interpret.c index 8d8a2e1fe4a..7b230d0aa8b 100644 --- a/src/main/unlang_interpret.c +++ b/src/main/unlang_interpret.c @@ -1016,94 +1016,94 @@ unlang_op_t unlang_ops[] = { [UNLANG_TYPE_MODULE_CALL] = { .name = "module-call", .func = unlang_module_call, - .children = false + .debug_braces = false }, [UNLANG_TYPE_GROUP] = { .name = "group", .func = unlang_group, - .children = true + .debug_braces = true }, [UNLANG_TYPE_LOAD_BALANCE] = { .name = "load-balance group", .func = unlang_load_balance, - .children = true + .debug_braces = true }, [UNLANG_TYPE_REDUNDANT_LOAD_BALANCE] = { .name = "redundant-load-balance group", .func = unlang_redundant_load_balance, - .children = true + .debug_braces = true }, [UNLANG_TYPE_PARALLEL] = { .name = "parallel", .func = unlang_parallel, - .children = true + .debug_braces = true }, #ifdef WITH_UNLANG [UNLANG_TYPE_IF] = { .name = "if", .func = unlang_if, - .children = true + .debug_braces = true }, [UNLANG_TYPE_ELSE] = { .name = "else", .func = unlang_else, - .children = true + .debug_braces = true }, [UNLANG_TYPE_ELSIF] = { .name = "elsif", .func = unlang_elsif, - .children = true + .debug_braces = true }, [UNLANG_TYPE_UPDATE] = { .name = "update", .func = unlang_update, - .children = true + .debug_braces = true }, [UNLANG_TYPE_SWITCH] = { .name = "switch", .func = unlang_switch, - .children = true + .debug_braces = true }, [UNLANG_TYPE_CASE] = { .name = "case", .func = unlang_case, - .children = true + .debug_braces = true }, [UNLANG_TYPE_FOREACH] = { .name = "foreach", .func = unlang_foreach, - .children = true + .debug_braces = true }, [UNLANG_TYPE_BREAK] = { .name = "break", .func = unlang_break, - .children = false + .debug_braces = false }, [UNLANG_TYPE_RETURN] = { .name = "return", .func = unlang_return, - .children = false + .debug_braces = false }, [UNLANG_TYPE_MAP] = { .name = "map", .func = unlang_map, - .children = true + .debug_braces = true }, [UNLANG_TYPE_POLICY] = { .name = "policy", .func = unlang_policy, - .children = true + .debug_braces = true }, #endif [UNLANG_TYPE_XLAT_INLINE] = { .name = "xlat_inline", .func = unlang_xlat_inline, - .children = false + .debug_braces = false }, [UNLANG_TYPE_RESUME] = { .name = "resume", .func = unlang_resumption, - .children = false + .debug_braces = false }, [UNLANG_TYPE_MAX] = { NULL, NULL, false } }; @@ -1163,7 +1163,7 @@ redo: break; } - if ((unlang_ops[instruction->type].children) && !frame->resume) { + if ((unlang_ops[instruction->type].debug_braces) && !frame->resume) { RDEBUG2("%s {", instruction->debug_name); RINDENT(); } @@ -1210,7 +1210,7 @@ redo: } if (frame->top_frame) { - if (unlang_ops[instruction->type].children) { + if (unlang_ops[instruction->type].debug_braces) { REXDENT(); RDEBUG2("} # %s (%s)", instruction->debug_name, fr_int2str(mod_rcode_table, result, "")); @@ -1236,7 +1236,7 @@ redo: } frame->resume = false; - if (unlang_ops[instruction->type].children) { + if (unlang_ops[instruction->type].debug_braces) { REXDENT(); RDEBUG2("} # %s (%s)", instruction->debug_name, fr_int2str(mod_rcode_table, result, "")); @@ -1295,7 +1295,7 @@ redo: /* FALL-THROUGH */ case UNLANG_ACTION_CONTINUE: - if ((action == UNLANG_ACTION_CONTINUE) && unlang_ops[instruction->type].children) { + if ((action == UNLANG_ACTION_CONTINUE) && unlang_ops[instruction->type].debug_braces) { REXDENT(); RDEBUG2("}"); } @@ -1728,7 +1728,8 @@ rlm_rcode_t unlang_yield(REQUEST *request, fr_unlang_resume_t callback, frame = &stack->frame[stack->depth]; - rad_assert(frame->instruction->type == UNLANG_TYPE_MODULE_CALL); + rad_assert((frame->instruction->type == UNLANG_TYPE_MODULE_CALL) || + (frame->instruction->type == UNLANG_TYPE_RESUME)); sp = unlang_generic_to_module_call(frame->instruction); mr = talloc(request, unlang_resumption_t);