From: Alan T. DeKok Date: Fri, 11 Nov 2016 16:37:34 +0000 (-0500) Subject: rename xlat to xlat_inline X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71659e136644ae0eb06b9cda6dc7bc2cdc885238;p=thirdparty%2Ffreeradius-server.git rename xlat to xlat_inline in preparation for including xlats into the unlang interpreter --- diff --git a/src/include/interpreter.h b/src/include/interpreter.h index 8becb25b9b2..7527ae57b73 100644 --- a/src/include/interpreter.h +++ b/src/include/interpreter.h @@ -69,7 +69,7 @@ typedef enum { //!< values from a #map_proc_t call). #endif UNLANG_TYPE_POLICY, //!< Policy section. - UNLANG_TYPE_XLAT, //!< Bare xlat statement. + UNLANG_TYPE_XLAT_INLINE, //!< xlat statement, inline in "unlang" UNLANG_TYPE_RESUME, //!< where to resume something. UNLANG_TYPE_MAX } unlang_type_t; @@ -179,7 +179,7 @@ typedef struct { unlang_t self; int exec; char *xlat_name; -} unlang_xlat_t; +} unlang_xlat_inline_t; /** State of a foreach loop * @@ -281,13 +281,13 @@ static inline unlang_t *unlang_group_to_generic(unlang_group_t *p) return (unlang_t *)p; } -static inline unlang_xlat_t *unlang_generic_to_xlat(unlang_t *p) +static inline unlang_xlat_inline_t *unlang_generic_to_xlat_inline(unlang_t *p) { - rad_assert(p->type == UNLANG_TYPE_XLAT); - return (unlang_xlat_t *)p; + rad_assert(p->type == UNLANG_TYPE_XLAT_INLINE); + return (unlang_xlat_inline_t *)p; } -static inline unlang_t *unlang_xlat_to_generic(unlang_xlat_t *p) +static inline unlang_t *unlang_xlat_inline_to_generic(unlang_xlat_inline_t *p) { return (unlang_t *)p; } diff --git a/src/main/interpreter.c b/src/main/interpreter.c index 69b5499ca03..c3cd20d8667 100644 --- a/src/main/interpreter.c +++ b/src/main/interpreter.c @@ -463,12 +463,12 @@ static unlang_action_t unlang_foreach(REQUEST *request, unlang_stack_t *stack, return UNLANG_ACTION_PUSHED_CHILD; } -static unlang_action_t unlang_xlat(REQUEST *request, unlang_stack_t *stack, - UNUSED rlm_rcode_t *presult, UNUSED int *priority) +static unlang_action_t unlang_xlat_inline(REQUEST *request, unlang_stack_t *stack, + UNUSED rlm_rcode_t *presult, UNUSED int *priority) { unlang_stack_frame_t *frame = &stack->frame[stack->depth]; unlang_t *instruction = frame->instruction; - unlang_xlat_t *mx = unlang_generic_to_xlat(instruction); + unlang_xlat_inline_t *mx = unlang_generic_to_xlat_inline(instruction); char buffer[128]; if (!mx->exec) { @@ -945,9 +945,9 @@ unlang_op_t unlang_ops[] = { .children = true }, #endif - [UNLANG_TYPE_XLAT] = { - .name = "xlat", - .func = unlang_xlat, + [UNLANG_TYPE_XLAT_INLINE] = { + .name = "xlat_inline", + .func = unlang_xlat_inline, .children = false }, [UNLANG_TYPE_RESUME] = { diff --git a/src/main/modcall.c b/src/main/modcall.c index 82dc46fdeed..d2a32b62dbe 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -2200,20 +2200,20 @@ static unlang_t *compile_break(unlang_t *parent, unlang_compile_t *unlang_ctx, C } #endif -static unlang_t *compile_xlat(unlang_t *parent, - unlang_compile_t *unlang_ctx, char const *fmt) +static unlang_t *compile_xlat_inline(unlang_t *parent, + unlang_compile_t *unlang_ctx, char const *fmt) { unlang_t *c; - unlang_xlat_t *mx; + unlang_xlat_inline_t *mx; - mx = talloc_zero(parent, unlang_xlat_t); + mx = talloc_zero(parent, unlang_xlat_inline_t); - c = unlang_xlat_to_generic(mx); + c = unlang_xlat_inline_to_generic(mx); c->parent = parent; c->next = NULL; c->name = "expand"; c->debug_name = c->name; - c->type = UNLANG_TYPE_XLAT; + c->type = UNLANG_TYPE_XLAT_INLINE; (void) compile_action_defaults(c, unlang_ctx, UNLANG_GROUP_TYPE_SIMPLE); @@ -2806,7 +2806,7 @@ static unlang_t *compile_item(unlang_t *parent, unlang_compile_t *unlang_ctx, CO */ if (((modrefname[0] == '%') && (modrefname[1] == '{')) || (modrefname[0] == '`')) { - return compile_xlat(parent, unlang_ctx, modrefname); + return compile_xlat_inline(parent, unlang_ctx, modrefname); } }