diff options
author | Steve Murphy <murf@digium.com> | 2007-06-20 20:10:19 +0000 |
---|---|---|
committer | Steve Murphy <murf@digium.com> | 2007-06-20 20:10:19 +0000 |
commit | c1bb0fc34bf52b6736a37a556a35f66e28db3f91 (patch) | |
tree | 1cc8fd8f8e629efb3ac99e3d7a2e2618f36092b4 /pbx/pbx_ael.c | |
parent | ce2c52d51906f485e6d1a0e4e7950d74ce6ff495 (diff) |
This finishes the changes for making Macro args LOCAL to the call, and allowing users to declare local variables.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx/pbx_ael.c')
-rw-r--r-- | pbx/pbx_ael.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pbx/pbx_ael.c b/pbx/pbx_ael.c index 66ea629a4..d5d58b316 100644 --- a/pbx/pbx_ael.c +++ b/pbx/pbx_ael.c @@ -315,6 +315,10 @@ static void print_pval(FILE *fin, pval *item, int depth) fprintf(fin,"%s=%s;\n", item->u1.str, item->u2.val); break; + case PV_LOCALVARDEC: + fprintf(fin,"local %s=%s;\n", item->u1.str, item->u2.val); + break; + case PV_GOTO: fprintf(fin,"goto %s", item->u1.list->u1.str); if ( item->u1.list->next ) @@ -565,6 +569,7 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f break; case PV_VARDEC: + case PV_LOCALVARDEC: /* fields: item->u1.str == variable name item->u2.val == variable value to assign */ @@ -2627,6 +2632,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) break; case PV_VARDEC: + case PV_LOCALVARDEC: /* fields: item->u1.str == variable name item->u2.val == variable value to assign */ @@ -3064,6 +3070,17 @@ static void gen_prios(struct ael_extension *exten, char *label, pval *statement, linkprio(exten, pr); break; + case PV_LOCALVARDEC: + pr = new_prio(); + pr->type = AEL_APPCALL; + snprintf(buf1,sizeof(buf1),"LOCAL(%s)=$[%s]", p->u1.str, p->u2.val); + pr->app = strdup("Set"); + remove_spaces_before_equals(buf1); + pr->appargs = strdup(buf1); + pr->origin = p; + linkprio(exten, pr); + break; + case PV_GOTO: pr = new_prio(); pr->type = AEL_APPCALL; @@ -4335,6 +4352,7 @@ void destroy_pval_item(pval *item) break; case PV_VARDEC: + case PV_LOCALVARDEC: /* fields: item->u1.str == variable name item->u2.val == variable value to assign */ |