diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-11-18 23:00:31 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-11-18 23:00:31 +0200 |
commit | 6f3612539c425da2bc1d34db621696e6a273b01c (patch) | |
tree | 9623b3ac2c54a93e5eed3be2b1dda7f4e4bf0e47 /extension/dl.c | |
parent | 4e3701015635401df2fc4da58abaab7645f4ebd3 (diff) | |
download | egawk-6f3612539c425da2bc1d34db621696e6a273b01c.tar.gz egawk-6f3612539c425da2bc1d34db621696e6a273b01c.tar.bz2 egawk-6f3612539c425da2bc1d34db621696e6a273b01c.zip |
Bring latest byte code gawk into git. Hurray!
Diffstat (limited to 'extension/dl.c')
-rw-r--r-- | extension/dl.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/extension/dl.c b/extension/dl.c index 60f104fa..49938fc8 100644 --- a/extension/dl.c +++ b/extension/dl.c @@ -32,8 +32,7 @@ static void *sdl = NULL; static NODE * -zaxxon(tree) -NODE *tree; +zaxxon(int nargs) { NODE *obj; int i; @@ -42,11 +41,11 @@ NODE *tree; /* * Print the arguments */ - printf("External linkage %s(", tree->param); + printf("External linkage zaxxon("); - for (i = 0; i < tree->param_cnt; i++) { + for (i = 0; i < nargs; i++) { - obj = get_argument(tree, i); + obj = get_scalar_argument(i, TRUE); if (obj == NULL) break; @@ -54,7 +53,6 @@ NODE *tree; force_string(obj); printf(comma ? ", %s" : "%s", obj->stptr); - free_temp(obj); comma = 1; } @@ -63,7 +61,7 @@ NODE *tree; /* * Do something useful */ - obj = get_argument(tree, 0); + obj = get_scalar_argument(0, FALSE); if (obj != NULL) { force_string(obj); @@ -75,14 +73,10 @@ NODE *tree; dlclose(sdl); sdl = NULL; } - free_temp(obj); } /* Set the return value */ - set_value(tmp_number((AWKNUM) 3.14)); - - /* Just to make the interpreter happy */ - return tmp_number((AWKNUM) 0); + return make_number((AWKNUM) 3.14); } NODE * @@ -92,5 +86,5 @@ void *dl; { sdl = dl; make_builtin("zaxxon", zaxxon, 4); - return tmp_number((AWKNUM) 0); + return make_number((AWKNUM) 0); } |