%L = the dbref of the ENACTOR's location.
%c = text of the last command, _before_ evaluation.
%? = The current function invocation and depth counts.
+ %+ = The number of arguments passed to the current function.
%qN = the equivalent of r(N), a register set by a setq() function.
(continued in help substitutions4)
int nest_depth; /**< Depth of function nesting, for DEBUG */
int call_depth; /**< Function call counter */
Debug_Info *debug_strings; /**< DEBUG infromation */
+ int arg_count; /**< Number of arguments passed to function */
};
/* new attribute foo */
char *tbuf;
char const *tp;
int pe_flags = PE_DEFAULT;
+ int old_args;
/* save our stack */
for (j = 0; j < 10; j++)
global_eval_context.wenv[j] = args[j];
for (; j < 10; j++)
global_eval_context.wenv[j] = NULL;
+ if (pe_info) {
+ old_args = pe_info->arg_count;
+ pe_info->arg_count = nargs;
+ }
tp = tbuf = safe_atr_value(attrib);
if (attrib->flags & AF_DEBUG)
/* restore the stack */
for (j = 0; j < 10; j++)
global_eval_context.wenv[j] = tptr[j];
+ if (pe_info)
+ pe_info->arg_count = old_args;
}
/* ARGSUSED */
pe_info->nest_depth = 0;
pe_info->call_depth = 0;
pe_info->debug_strings = NULL;
+ pe_info->arg_count = 0;
} else {
old_iter_limit = -1;
}
case '~': /* enactor accented name */
safe_str(accented_name(enactor), buff, bp);
break;
+ case '+': /* argument count */
+ if (pe_info)
+ safe_integer(pe_info->arg_count, buff, bp);
+ else
+ safe_integer(0, buff, bp);
+ break;
case '0':
case '1':
case '2':
global_fun_recursions++;
pe_info->fun_depth++;
if (fp->flags & FN_BUILTIN) {
+ int old_nfargs;
global_fun_invocations++;
pe_info->fun_invocations++;
+ old_nfargs = pe_info->arg_count;
+ pe_info->arg_count = nfargs;
fp->where.fun(fp, buff, bp, nfargs, fargs, arglens, executor,
caller, enactor, fp->name, pe_info);
+ pe_info->arg_count = old_nfargs;
if (fp->flags & FN_LOGARGS) {
char logstr[BUFFER_LEN];
char *logp;