Commit ef65e2e9 authored by Morten Welinder's avatar Morten Welinder

Evaluation: move evaluation flags into structure.

This allows functions to look at them.  That will be needed for
HYPERLINK.
parent 71de21ca
2013-10-22 Morten Welinder <terra@gnome.org>
* src/func.c (function_call_with_exprs): Move flags argument into
structure.
2013-10-19 Morten Welinder <terra@gnome.org>
* src/hlink.c (_gnm_hlink_init): New function.
......
......@@ -670,7 +670,8 @@ gnm_expr_extract_ref (GnmRangeRef *res, GnmExpr const *expr,
ei.pos = pos;
ei.func_call = &expr->func;
v = function_call_with_exprs (&ei, flags);
ei.flags = flags;
v = function_call_with_exprs (&ei);
if (v != NULL) {
if (v->type == VALUE_CELLRANGE) {
......@@ -1448,7 +1449,8 @@ gnm_expr_eval (GnmExpr const *expr, GnmEvalPos const *pos,
GnmFuncEvalInfo ei;
ei.pos = pos;
ei.func_call = &expr->func;
res = function_call_with_exprs (&ei, flags);
ei.flags = flags;
res = function_call_with_exprs (&ei);
if (res == NULL)
return (flags & GNM_EXPR_EVAL_PERMIT_EMPTY)
? NULL : value_new_int (0);
......
......@@ -1732,14 +1732,13 @@ free_values (GnmValue **values, int top)
/**
* function_call_with_exprs:
* @ei: EvalInfo containing valid fn_def!
* @flags:
*
* Do the guts of calling a function.
*
* Returns the result.
**/
GnmValue *
function_call_with_exprs (GnmFuncEvalInfo *ei, GnmExprEvalFlags flags)
function_call_with_exprs (GnmFuncEvalInfo *ei)
{
GnmFunc const *fn_def;
int i, iter_count, iter_width = 0, iter_height = 0;
......@@ -1748,10 +1747,13 @@ function_call_with_exprs (GnmFuncEvalInfo *ei, GnmExprEvalFlags flags)
int *iter_item = NULL;
int argc;
GnmExprConstPtr *argv;
GnmExprEvalFlags flags;
g_return_val_if_fail (ei != NULL, NULL);
g_return_val_if_fail (ei->func_call != NULL, NULL);
flags = ei->flags;
argc = ei->func_call->argc;
argv = ei->func_call->argv;
fn_def = ei->func_call->func;
......
......@@ -218,6 +218,7 @@ struct _GnmFunc {
struct _GnmFuncEvalInfo {
GnmEvalPos const *pos;
GnmExprFunction const *func_call;
GnmExprEvalFlags flags;
};
GType gnm_func_get_type (void);
......@@ -266,8 +267,7 @@ char *gnm_func_convert_markup_to_pango (char const *desc,
/*************************************************************************/
GnmValue *function_call_with_exprs (GnmFuncEvalInfo *ei,
GnmExprEvalFlags flags);
GnmValue *function_call_with_exprs (GnmFuncEvalInfo *ei);
GnmValue *function_call_with_values (GnmEvalPos const *ep, char const *name,
int argc, GnmValue const * const *values);
GnmValue *function_def_call_with_values (GnmEvalPos const *ep, GnmFunc const *fn,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment