# define XLAT_DEBUG(...)
#endif
+typedef ssize_t (*xlat_print_t)(fr_sbuff_t *in, xlat_exp_t const *self, void *inst, fr_sbuff_escape_rules_t const *e_rules);
+
+
typedef enum {
XLAT_EXPR_TYPE_NONE,
XLAT_EXPR_TYPE_UNARY,
size_t thread_inst_size; //!< Size of the thread instance data to pre-allocate.
void *thread_uctx; //!< uctx to pass to instantiation functions.
+ xlat_print_t print; //!< function to call when printing
+
xlat_flags_t flags; //!< various flags
xlat_input_type_t input_type; //!< Type of input used.
xlat->internal = true;
}
+/** Set a print routine for an xlat function.
+ *
+ * @param[in] xlat to mark as internal.
+ */
+static inline void xlat_print_set(xlat_t *xlat, xlat_print_t func)
+{
+ xlat->print = func;
+}
+
+
/** Walker callback for xlat_walk()
*
* @param[in] exp being evaluated.
case XLAT_FUNC:
if (node->call.func->input_type != XLAT_INPUT_ARGS) break;
+ /*
+ * We have a callback for printing this node, go
+ * call it.
+ */
+ if (node->call.func->print) {
+ slen = node->call.func->print(out, node, node->call.inst->data, e_rules);
+ goto done;
+ }
+
if (!node->call.func->internal || (node->call.func->expr_type == XLAT_EXPR_TYPE_NONE)) break;
/*