]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rename xlat to xlat_inline
authorAlan T. DeKok <aland@freeradius.org>
Fri, 11 Nov 2016 16:37:34 +0000 (11:37 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 11 Nov 2016 16:37:34 +0000 (11:37 -0500)
in preparation for including xlats into the unlang interpreter

src/include/interpreter.h
src/main/interpreter.c
src/main/modcall.c

index 8becb25b9b24fa804327a69c2c1522246f31e9f9..7527ae57b732a9c6a1d6edc2adc3139f06e2b00b 100644 (file)
@@ -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;
 }
index 69b5499ca03f5a50d91d38bce36fbcbcb91398c9..c3cd20d866724e6088fa92da234b86d42dc72451 100644 (file)
@@ -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] = {
index 82dc46fdeedad1057582fe7227535a3d9d4abe4a..d2a32b62dbe15026aa355b0c78cadeacb0babe95 100644 (file)
@@ -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);
                }
        }