#include "awk.h"Go to the source code of this file.
Functions | |
| static NODE * | do_mkarray (NODE *tree) |
| NODE * | dlload (NODE *tree, void *dl) |
|
||||||||||||
|
Definition at line 82 of file arrayparm.c. References AWKNUM, do_mkarray(), and tmp_number. 00085 { 00086 make_builtin("mkarray", do_mkarray, 3); 00087 00088 return tmp_number((AWKNUM) 0); 00089 }
|
|
|
Definition at line 43 of file arrayparm.c. References assoc_clear(), assoc_lookup(), AWKNUM, do_lint, dupnode, get_array, lintwarn, nodetype2str(), NULL, stack_ptr, tmp_number, and exp_node::type. Referenced by dlload(). 00045 { 00046 int ret = -1; 00047 NODE *var, *sub, *val; 00048 NODE **elemval; 00049 00050 if (do_lint && tree->param_cnt > 3) 00051 lintwarn("mkarray: called with too many arguments"); 00052 00053 var = get_argument(tree, 0); 00054 if (var == NULL) 00055 var = stack_ptr[0]; 00056 00057 var = get_array(var); 00058 sub = get_argument(tree, 1); 00059 val = get_argument(tree, 2); 00060 00061 printf("var->type = %s\n", nodetype2str(var->type)); 00062 printf("sub->type = %s\n", nodetype2str(sub->type)); 00063 printf("val->type = %s\n", nodetype2str(val->type)); 00064 00065 assoc_clear(var); 00066 00067 elemval = assoc_lookup(var, sub, 0); 00068 *elemval = dupnode(val); 00069 ret = 0; 00070 00071 00072 /* Set the return value */ 00073 set_value(tmp_number((AWKNUM) ret)); 00074 00075 /* Just to make the interpreter happy */ 00076 return tmp_number((AWKNUM) 0); 00077 }
|