#include <freeradius-devel/unlang/unlang_priv.h>
#include "edit_priv.h"
+#undef XDEBUG
#if 1
-#undef DEBUG
-#define DEBUG(...)
+#define XDEBUG(...)
+#else
+#define XDEBUG DEBUG2
#endif
typedef struct {
tmpl_dcursor_ctx_t cc;
fr_dcursor_t cursor;
+ XDEBUG("apply_edits_to_list %s", map->lhs->name);
+
/*
* RHS is a sublist, go apply that.
*/
bool single = false, pair = false;
map_t const *map = current->map;
+ XDEBUG("apply_edits_to_list %s", map->lhs->name);
+
if (!tmpl_is_attr(current->lhs.vpt)) {
REDEBUG("%s[%d] The left side of an assignment must be an attribute reference", MAP_INFO);
return -1;
{
map_t const *map = current->map;
- DEBUG("%s map %s %s ...", __FUNCTION__, map->lhs->name, fr_tokens[map->op]);
+ XDEBUG("%s map %s %s ...", __FUNCTION__, map->lhs->name, fr_tokens[map->op]);
/*
* := is "remove all matching, and then add". So if even if we don't add anything, we still remove things.
map_t const *map = current->map;
edit_map_t *child;
- DEBUG("%s map %s %s ...", __FUNCTION__, map->lhs->name, fr_tokens[map->op]);
+ XDEBUG("%s map %s %s ...", __FUNCTION__, map->lhs->name, fr_tokens[map->op]);
/*
* If there's no RHS tmpl, then the RHS is a child list.
if (!map->rhs) return expand_rhs_list(request, state, current);
- DEBUG("%s map %s %s %s", __FUNCTION__, map->lhs->name, fr_tokens[map->op], map->rhs->name);
+ XDEBUG("%s map %s %s %s", __FUNCTION__, map->lhs->name, fr_tokens[map->op], map->rhs->name);
/*
* Turn the RHS into a tmpl_t. This can involve just referencing an existing
fr_assert(current->parent);
- DEBUG("%s map %s", __FUNCTION__, map->lhs->name);
+ XDEBUG("%s map %s", __FUNCTION__, map->lhs->name);
if (tmpl_is_data(map->lhs)) {
vpt = map->lhs;
fr_assert(current->parent != NULL);
- DEBUG("%s map %s", __FUNCTION__, map->lhs->name);
+ XDEBUG("%s map %s", __FUNCTION__, map->lhs->name);
/*
* Don't create the leaf. The apply_edits_to_leaf() function will create them after the RHS has
int rcode;
map_t const *map = current->map;
- DEBUG("%s map %s %s ...", __FUNCTION__, map->lhs->name, fr_tokens[map->op]);
+ XDEBUG("%s map %s %s ...", __FUNCTION__, map->lhs->name, fr_tokens[map->op]);
fr_assert(fr_value_box_list_empty(¤t->lhs.result)); /* Should have been consumed */
fr_assert(fr_value_box_list_empty(¤t->rhs.result)); /* Should have been consumed */
int rcode;
if (!state->current->map->rhs) {
- DEBUG("MAP %s ...", state->current->map->lhs->name);
+ XDEBUG("MAP %s ...", state->current->map->lhs->name);
} else {
- DEBUG("MAP %s ... %s", state->current->map->lhs->name, state->current->map->rhs->name);
+ XDEBUG("MAP %s ... %s", state->current->map->lhs->name, state->current->map->rhs->name);
- DEBUG("\t%08x", state->current->map->rhs->type);
+ XDEBUG("\t%08x", state->current->map->rhs->type);
}
rcode = state->current->func(request, state, state->current);