Skip to content

Commit

Permalink
module interface: New func param flag: CMD_PARAM_NO_EXPAND
Browse files Browse the repository at this point in the history
This is a temporary solution, just to help speed up the porting of all
avpops functions (avpops needs major rework anyway -- no time for that
now).  NOT to be re-used in the future, as we want a uniform
behavior for all string function parameters.
  • Loading branch information
liviuchircu committed Apr 4, 2019
1 parent 9398b61 commit 7f50517
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mod_fix.c
Expand Up @@ -154,8 +154,11 @@ int fix_cmd(struct cmd_param *params, action_elem_t *elems)
ret = E_UNSPEC;
goto error;
}
if (!pve->next && pve->spec.type == PVT_NONE) {
/* no variables in the provided string */

if ((param->flags & CMD_PARAM_NO_EXPAND) ||
(!pve->next && pve->spec.type == PVT_NONE)) {

/* ignoring/no variables in the provided string */
pv_elem_free_all(pve);

if (param->fixup) {
Expand Down
1 change: 1 addition & 0 deletions sr_module.h
Expand Up @@ -117,6 +117,7 @@ typedef int (*mod_proc_wrapper)();

#define CMD_PARAM_OPT (1<<4) /* optional parameter */
#define CMD_PARAM_FIX_NULL (1<<5) /* run fixup even if optional parameter is omitted */
#define CMD_PARAM_NO_EXPAND (1<<6) /* TMPHACK: do not pv-expand strings */

struct cmd_param {
int flags; /* parameter flags */
Expand Down

0 comments on commit 7f50517

Please sign in to comment.