diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2012-05-24 15:34:17 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2012-05-24 15:34:17 -0400 |
commit | 577c3fc31a2718461fba2e599d162de96fe838fa (patch) | |
tree | 1f45346053a5ae9db3c62761ef214a8a94095d30 /interpret.h | |
parent | c62b9d773bc064bc1dd5d8db35207fd4e6d42f1e (diff) | |
download | egawk-577c3fc31a2718461fba2e599d162de96fe838fa.tar.gz egawk-577c3fc31a2718461fba2e599d162de96fe838fa.tar.bz2 egawk-577c3fc31a2718461fba2e599d162de96fe838fa.zip |
First working version of new API mechanism (probably has memory leaks).
Diffstat (limited to 'interpret.h')
-rw-r--r-- | interpret.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/interpret.h b/interpret.h index 3ff5e929..abffbda4 100644 --- a/interpret.h +++ b/interpret.h @@ -785,9 +785,10 @@ arrayfor: case Op_ext_builtin: { int arg_count = pc->expr_count; + awk_value_t result; PUSH_CODE(pc); - r = pc->builtin(arg_count); + r = awk_value_to_node(pc->extfunc(arg_count, & result)); (void) POP_CODE(); while (arg_count-- > 0) { t1 = POP(); @@ -919,7 +920,7 @@ match_re: bc = f->code_ptr; assert(bc->opcode == Op_symbol); pc->opcode = Op_ext_builtin; /* self modifying code */ - pc->builtin = bc->builtin; + pc->extfunc = bc->extfunc; pc->expr_count = arg_count; /* actual argument count */ (pc + 1)->func_name = fname; /* name of the builtin */ (pc + 1)->expr_count = bc->expr_count; /* defined max # of arguments */ |