From 3d7b35bb37c066489546751e100c2c2b823ccba3 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 19 Oct 2008 17:48:21 +0000 Subject: refs and syms --- src/core/function.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/function.c') diff --git a/src/core/function.c b/src/core/function.c index fda40b8..c25834d 100644 --- a/src/core/function.c +++ b/src/core/function.c @@ -575,6 +575,9 @@ function_is_buildin(Token *p_token_ident) { if (strcmp("not", token_get_val(p_token_ident)) == 0) return (true); + if (strcmp("refs", token_get_val(p_token_ident)) == 0) + return (true); + return (false); } @@ -812,6 +815,14 @@ function_process_buildin(Interpret *p_interpret, Token *p_token_ident, break; NO_DEFAULT; } + + } else if (strcmp("refs", token_get_val(p_token_ident)) == 0) { + if (0 == stack_size(p_stack_args)) + _FUNCTION_ERROR("No argument given", p_token_ident); + + Token *p_token_top = stack_pop(p_stack_args); + Token *p_token = token_new_integer(p_token_top->i_ref_count); + stack_push(p_stack_args, p_token); } } -- cgit v1.2.3