diff options
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); } |