Commit 819e57c8 authored by Jody Goldberg's avatar Jody Goldberg

Some header cleanup.

parent 4d2cc3af
......@@ -21,6 +21,7 @@
#include "module-plugin-defs.h"
#include "gnumeric.h"
#include "cell.h"
#include "sheet.h"
#include "value.h"
#include "file.h"
#include "io-context.h"
......
......@@ -52,6 +52,7 @@
#include "io-context.h"
#include "expr.h"
#include "gutils.h"
#include "str.h"
#include <libole2/ms-ole.h>
#include "ms-biff.h"
......
......@@ -18,6 +18,8 @@
#include "func.h"
#include "value.h"
#include "gutils.h"
#include "sheet.h"
#include "str.h"
#include "parse-util.h"
......
......@@ -20,6 +20,7 @@
#include "gutils.h"
#include "func.h"
#include "value.h"
#include "str.h"
#include "parse-util.h"
......
......@@ -50,9 +50,7 @@ ms_destroy_OBJ (MSObj *obj)
}
}
/*
* See: S59EOE.HTM
*/
/* S59EOE.HTM */
char *
ms_read_TXO (BiffQuery *q)
{
......@@ -148,9 +146,7 @@ ms_obj_dump_impl (guint8 const *data, int len, int data_left, char const *name)
#define ms_obj_dump (data, len, data_left, name)
#endif
/*
* See: S59DAD.HTM
*/
/* S59DAD.HTM */
static gboolean
ms_obj_read_pre_biff8_obj (BiffQuery *q, MSContainer *container, MSObj *obj)
{
......@@ -169,9 +165,7 @@ ms_obj_read_pre_biff8_obj (BiffQuery *q, MSContainer *container, MSObj *obj)
return TRUE;
}
/*
* See: S59DAD.HTM
*/
/* S59DAD.HTM */
static gboolean
ms_obj_read_biff8_obj (BiffQuery *q, MSContainer *container, MSObj *obj)
{
......@@ -225,11 +219,11 @@ ms_obj_read_biff8_obj (BiffQuery *q, MSContainer *container, MSObj *obj)
ms_obj_dump (data, len, data_len_left, "GroupButton");
break;
case GR_CLIPBOARD_FORMAT:
case GR_CLIPBOARD_FORMAT :
ms_obj_dump (data, len, data_len_left, "ClipboardFmt");
break;
case GR_PICTURE_OPTIONS:
case GR_PICTURE_OPTIONS :
{
guint16 pict_opt;
g_return_val_if_fail (len == 2, TRUE);
......@@ -248,7 +242,7 @@ ms_obj_read_biff8_obj (BiffQuery *q, MSContainer *container, MSObj *obj)
break;
}
case GR_PICTURE_FORMULA:
case GR_PICTURE_FORMULA :
ms_obj_dump (data, len, data_len_left, "PictFormula");
break;
......@@ -318,7 +312,7 @@ ms_obj_read_biff8_obj (BiffQuery *q, MSContainer *container, MSObj *obj)
break;
}
case GR_COMMON_OBJ_DATA:
case GR_COMMON_OBJ_DATA :
{
guint16 const options =MS_OLE_GET_GUINT16 (data+8);
......
......@@ -10,7 +10,9 @@
#include "parse-util.h"
#include "func-util.h"
#include "func.h"
#include "str.h"
#include "cell.h"
#include "sheet.h"
/* Type definitions */
......@@ -22,8 +24,8 @@ typedef struct {
/* Callback functions */
int
criteria_test_equal(Value *x, Value *y)
gboolean
criteria_test_equal (Value const *x, Value const *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_float (x) == value_get_as_float (y))
......@@ -37,8 +39,8 @@ criteria_test_equal(Value *x, Value *y)
return 0;
}
int
criteria_test_unequal(Value *x, Value *y)
gboolean
criteria_test_unequal (Value const *x, Value const *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_float (x) != value_get_as_float (y))
......@@ -52,8 +54,8 @@ criteria_test_unequal(Value *x, Value *y)
return 0;
}
int
criteria_test_less(Value *x, Value *y)
gboolean
criteria_test_less (Value const *x, Value const *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_float (x) < value_get_as_float (y))
......@@ -64,8 +66,8 @@ criteria_test_less(Value *x, Value *y)
return 0;
}
int
criteria_test_greater(Value *x, Value *y)
gboolean
criteria_test_greater (Value const *x, Value const *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_float (x) > value_get_as_float (y))
......@@ -76,8 +78,8 @@ criteria_test_greater(Value *x, Value *y)
return 0;
}
int
criteria_test_less_or_equal(Value *x, Value *y)
gboolean
criteria_test_less_or_equal (Value const *x, Value const *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_float (x) <= value_get_as_float (y))
......@@ -88,8 +90,8 @@ criteria_test_less_or_equal(Value *x, Value *y)
return 0;
}
int
criteria_test_greater_or_equal(Value *x, Value *y)
gboolean
criteria_test_greater_or_equal (Value const *x, Value const *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_float (x) >= value_get_as_float (y))
......@@ -176,8 +178,8 @@ free_criterias(GSList *criterias)
}
void
parse_criteria(const char *criteria, criteria_test_fun_t *fun,
Value **test_value)
parse_criteria (char const *criteria, criteria_test_fun_t *fun,
Value **test_value)
{
char *p;
gnum_float tmp;
......
......@@ -9,6 +9,7 @@
#include <math.h>
#include "gnumeric.h"
#include "parse-util.h"
#include "str.h"
#include "cell.h"
#include "func.h"
#include "datetime.h"
......
......@@ -14,6 +14,7 @@
#include "gnumeric.h"
#include "parse-util.h"
#include "func.h"
#include "str.h"
#include "mathfunc.h"
#if 0
......
......@@ -18,6 +18,7 @@
#include "collect.h"
#include "auto-format.h"
#include "datetime.h"
#include "str.h"
/*
......
......@@ -12,6 +12,8 @@
#include "parse-util.h"
#include "func.h"
#include "cell.h"
#include "str.h"
#include "sheet.h"
#include "workbook.h"
#include "format.h"
#include "formats.h"
......
......@@ -14,6 +14,8 @@
#include "func.h"
#include "eval.h"
#include "cell.h"
#include "str.h"
#include "sheet.h"
/* Useful routines for multiple functions */
......
......@@ -12,11 +12,12 @@
#include "func-util.h"
#include "func.h"
#include "cell.h"
#include "sheet.h"
#include "str.h"
#include "mathfunc.h"
#include "collect.h"
#include "auto-format.h"
typedef struct {
GSList *list;
int num;
......
......@@ -14,6 +14,7 @@
#include "parse-util.h"
#include "func-util.h"
#include "func.h"
#include "sheet.h"
#include "cell.h"
#include "collect.h"
#include "auto-format.h"
......
......@@ -15,6 +15,8 @@
#include "func.h"
#include "cell.h"
#include "format.h"
#include "str.h"
#include "sheet.h"
#include "position.h"
#include "number-match.h"
......
......@@ -31,6 +31,7 @@
#include "style-color.h"
#include "html.h"
#include "cell.h"
#include "sheet.h"
#include "value.h"
#include "font.h"
#include "plugin-util.h"
......
......@@ -31,6 +31,7 @@
#include "style-color.h"
#include "html.h"
#include "cell.h"
#include "sheet.h"
#include "value.h"
#include "font.h"
#include "plugin-util.h"
......
......@@ -18,6 +18,7 @@
#include "value.h"
#include "expr.h"
#include "func.h"
#include "str.h"
#include "plugin.h"
#include "py-gnumeric.h"
......
......@@ -15,6 +15,7 @@
#include <gnome-xml/xmlmemory.h>
#include "gnumeric.h"
#include "workbook.h"
#include "sheet.h"
#include "workbook-view.h"
#include "value.h"
#include "io-context.h"
......
......@@ -19,6 +19,7 @@
#include "module-plugin-defs.h"
#include "gutils.h"
#include "value.h"
#include "str.h"
#include "command-context.h"
#include "Python.h"
......
......@@ -24,6 +24,7 @@
#include "file.h"
#include "cell.h"
#include "style.h"
#include "sheet.h"
GNUMERIC_MODULE_PLUGIN_INFO_DECL;
......
......@@ -18,6 +18,7 @@
#include "workbook-view.h"
#include "workbook.h"
#include "cell.h"
#include "sheet.h"
#include "value.h"
#include "error-info.h"
#include "plugin-util.h"
......
......@@ -28,6 +28,7 @@
#include "plugin-util.h"
#include "module-plugin-defs.h"
#include "xbase.h"
#include "sheet.h"
GNUMERIC_MODULE_PLUGIN_INFO_DECL;
......
......@@ -30,6 +30,7 @@
#include "module-plugin-defs.h"
#include "sheet-style.h"
#include "sheet-merge.h"
#include "sheet.h"
#include "ranges.h"
#include "style.h"
#include "style-border.h"
......
......@@ -20,6 +20,7 @@
#include "tools.h"
#include "value.h"
#include "cell.h"
#include "sheet.h"
#include "style.h"
#include "regression.h"
#include "sheet-style.h"
......
......@@ -15,6 +15,7 @@
#include "formats.h"
#include "expr.h"
#include "cell.h"
#include "sheet.h"
#include "workbook.h"
#include "format.h"
......
......@@ -10,6 +10,8 @@
#include "style.h"
#include "style-color.h"
#include "cell.h"
#include "sheet.h"
#include "str.h"
#include "value.h"
#include "workbook.h"
#include "rendered-value.h"
......
......@@ -22,6 +22,7 @@
#include "workbook.h"
#include "expr.h"
#include "cell.h"
#include "sheet.h"
typedef enum {
REMOVE_DEPS = 0,
......
......@@ -28,6 +28,7 @@
#include "gnumeric-util.h"
#include "dialogs.h"
#include "workbook.h"
#include "sheet.h"
#include "workbook-edit.h"
#include "workbook-control.h"
#include "cell.h"
......
......@@ -12,6 +12,7 @@
#include "func.h"
#include "dialogs.h"
#include "workbook.h"
#include "str.h"
#define HELP_BUTTON (GNOME_CANCEL + 1)
......
......@@ -28,6 +28,7 @@
#include "gnumeric-util.h"
#include "dialogs.h"
#include "workbook.h"
#include "sheet.h"
#include "workbook-edit.h"
#include "workbook-control.h"
#include "cell.h"
......
......@@ -14,6 +14,7 @@
#include "gnumeric-util.h"
#include "dialogs.h"
#include "cell.h"
#include "sheet.h"
#include "expr.h"
#include "eval.h"
#include "value.h"
......
......@@ -27,6 +27,7 @@
#include "gnumeric-util.h"
#include "workbook-control-gui-priv.h"
#include "workbook.h"
#include "sheet.h"
#include "workbook-edit.h"
#include "sheet-object.h"
#include "sheet-object-container.h"
......
......@@ -19,6 +19,7 @@
#include "tools.h"
#include "value.h"
#include "cell.h"
#include "sheet.h"
#include "workbook.h"
#include "parse-util.h"
#include "utils-dialog.h"
......
......@@ -22,6 +22,7 @@
#include "workbook.h"
#include "expr.h"
#include "cell.h"
#include "sheet.h"
typedef enum {
REMOVE_DEPS = 0,
......
......@@ -15,6 +15,8 @@
#include "workbook.h"
#include "expr-name.h"
#include "expr.h"
#include "str.h"
#include "sheet.h"
#include "sheet-style.h"
/* We don't expect that many global names ! */
......
......@@ -15,6 +15,8 @@
#include "format.h"
#include "func.h"
#include "cell.h"
#include "sheet.h"
#include "str.h"
#include "parse-util.h"
#include "ranges.h"
#include "number-match.h"
......@@ -362,15 +364,14 @@ eval_funcall (EvalPos const *pos, ExprTree const *tree,
* at the intersection point. This value needs to be freed.
**/
Value *
expr_implicit_intersection (EvalPos const *pos,
Value *v)
expr_implicit_intersection (EvalPos const *pos, Value *v)
{
Value *res = NULL;
Range rng;
Sheet *start_sheet, *end_sheet;
/* handle inverted ranges */
range_ref_normalize (&rng, &start_sheet, &end_sheet, v, pos);
value_cellrange_normalize (pos, v, &start_sheet, &end_sheet, &rng);
if (start_sheet == end_sheet) {
if (rng.start.row == rng.end.row) {
......@@ -971,66 +972,6 @@ eval_expr (EvalPos const *pos, ExprTree const *tree,
return res;
}
void
cell_ref_make_abs (CellRef *dest,
CellRef const *src,
EvalPos const *ep)
{
g_return_if_fail (dest != NULL);
g_return_if_fail (src != NULL);
g_return_if_fail (ep != NULL);
*dest = *src;
if (src->col_relative)
dest->col += ep->eval.col;
if (src->row_relative)
dest->row += ep->eval.row;
dest->row_relative = dest->col_relative = FALSE;
}
int
cell_ref_get_abs_col (CellRef const *ref, EvalPos const *pos)
{
g_return_val_if_fail (ref != NULL, 0);
g_return_val_if_fail (pos != NULL, 0);
if (ref->col_relative)
return pos->eval.col + ref->col;
return ref->col;
}
int
cell_ref_get_abs_row (CellRef const *ref, EvalPos const *pos)
{
g_return_val_if_fail (ref != NULL, 0);
g_return_val_if_fail (pos != NULL, 0);
if (ref->row_relative)
return pos->eval.row + ref->row;
return ref->row;
}
void
cell_get_abs_col_row (CellRef const *cell_ref,
CellPos const *pos,
int *col, int *row)
{
g_return_if_fail (cell_ref != NULL);
if (cell_ref->col_relative)
*col = pos->col + cell_ref->col;
else
*col = cell_ref->col;
if (cell_ref->row_relative)
*row = pos->row + cell_ref->row;
else
*row = cell_ref->row;
}
/*
* Converts a parsed tree into its string representation
* assuming that we are evaluating at col, row
......@@ -1415,8 +1356,7 @@ cellref_relocate (CellRef *ref, ExprRelocateInfo const *rinfo,
}
static ExprTree *
cellrange_relocate (const Value *v,
const ExprRelocateInfo *rinfo)
cellrange_relocate (Value const *v, ExprRelocateInfo const *rinfo)
{
/*
* If either end is an error then the whole range is an error.
......@@ -1515,8 +1455,7 @@ cellrange_relocate (const Value *v,
* same cell after the move.
*/
ExprTree *
expr_rewrite (ExprTree const *expr,
ExprRewriteInfo const *rwinfo)
expr_rewrite (ExprTree const *expr, ExprRewriteInfo const *rwinfo)
{
g_return_val_if_fail (expr != NULL, NULL);
......@@ -1613,7 +1552,7 @@ expr_rewrite (ExprTree const *expr,
}
case OPER_CONSTANT: {
const Value *v = expr->constant.value;
Value const *v = expr->constant.value;
if (v->type == VALUE_CELLRANGE) {
CellRef ref_a = v->v_range.cell.a;
......@@ -1648,7 +1587,7 @@ expr_rewrite (ExprTree const *expr,
}
case OPER_ARRAY: {
ExprArray const * a = &expr->array;
ExprArray const *a = &expr->array;
if (a->x == 0 && a->y == 0) {
ExprTree *func = expr_rewrite (a->corner.expr, rwinfo);
......@@ -1753,14 +1692,12 @@ expr_boundingbox (ExprTree const *expr, CellPos const *pos, Range *bound)
Value const *v = expr->constant.value;
if (v->type == VALUE_CELLRANGE) {
CellRef ref_a = v->v_range.cell.a;
CellRef ref_b = v->v_range.cell.b;
}
break;
}
case OPER_ARRAY: {
ExprArray const * a = &expr->array;
ExprArray const *a = &expr->array;
if (a->x == 0 && a->y == 0)
expr_boundingbox (a->corner.expr, pos, bound);
break;
......
......@@ -46,6 +46,7 @@
#include "portability.h"
#include "datetime.h"
#include "mathfunc.h"
#include "str.h"
/***************************************************************************/
......
......@@ -30,7 +30,7 @@ Value *gnumeric_return_current_time (void);
* This includes the database functions and some mathematical functions
* like COUNTIF, SUMIF...
*/
typedef int (*criteria_test_fun_t) (Value *x, Value *y);
typedef gboolean (*criteria_test_fun_t) (Value const *x, Value const *y);
typedef struct {
criteria_test_fun_t fun;
......@@ -38,13 +38,14 @@ typedef struct {
int column;
} func_criteria_t;
int criteria_test_equal (Value *x, Value *y);
int criteria_test_unequal (Value *x, Value *y);
int criteria_test_greater (Value *x, Value *y);
int criteria_test_less (Value *x, Value *y);
int criteria_test_greater_or_equal (Value *x, Value *y);
int criteria_test_less_or_equal (Value *x, Value *y);
void parse_criteria (const char *criteria,
gboolean criteria_test_equal (Value const *x, Value const *y);
gboolean criteria_test_unequal (Value const *x, Value const *y);
gboolean criteria_test_greater (Value const *x, Value const *y);
gboolean criteria_test_less (Value const *x, Value const *y);
gboolean criteria_test_greater_or_equal (Value const *x, Value const *y);
gboolean criteria_test_less_or_equal (Value const *x, Value const *y);
void parse_criteria (char const *criteria,
criteria_test_fun_t *fun,
Value **test_value);
GSList *parse_criteria_range (Sheet *sheet, int b_col, int b_row,
......
......@@ -15,9 +15,10 @@
#include "func.h"
#include "eval.h"
#include "cell.h"
#include "str.h"
#include "symbol.h"
#include "workbook.h"
#include "sheet.h"
/* These are not supported yet */
typedef enum {
......
......@@ -10,7 +10,9 @@
#include "parse-util.h"
#include "func-util.h"
#include "func.h"
#include "str.h"
#include "cell.h"
#include "sheet.h"
/* Type definitions */
......@@ -22,8 +24,8 @@ typedef struct {
/* Callback functions */
int
criteria_test_equal(Value *x, Value *y)
gboolean
criteria_test_equal (Value const *x, Value const *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_float (x) == value_get_as_float (y))
......@@ -37,8 +39,8 @@ criteria_test_equal(Value *x, Value *y)
return 0;
}
int
criteria_test_unequal(Value *x, Value *y)
gboolean
criteria_test_unequal (Value const *x, Value const *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_float (x) != value_get_as_float (y))
......@@ -52,8 +54,8 @@ criteria_test_unequal(Value *x, Value *y)
return 0;
}
int
criteria_test_less(Value *x, Value *y)
gboolean
criteria_test_less (Value const *x, Value const *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_float (x) < value_get_as_float (y))
......@@ -64,8 +66,8 @@ criteria_test_less(Value *x, Value *y)
return 0;
}
int
criteria_test_greater(Value *x, Value *y)
gboolean
criteria_test_greater (Value const *x, Value const *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_float (x) > value_get_as_float (y))
......@@ -76,8 +78,8 @@ criteria_test_greater(Value *x, Value *y)
return 0;
}
int
criteria_test_less_or_equal(Value *x, Value *y)
gboolean
criteria_test_less_or_equal (Value const *x, Value const *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_float (x) <= value_get_as_float (y))
......@@ -88,8 +90,8 @@ criteria_test_less_or_equal(Value *x, Value *y)
return 0;
}
int
criteria_test_greater_or_equal(Value *x, Value *y)
gboolean
criteria_test_greater_or_equal (Value const *x, Value const *y)
{
if (VALUE_IS_NUMBER(x) && VALUE_IS_NUMBER(y))
if (value_get_as_float (x) >= value_get_as_float (y))
......@@ -176,8 +178,8 @@ free_criterias(GSList *criterias)
}
void
parse_criteria(const char *criteria, criteria_test_fun_t *fun,
Value **test_value)
parse_criteria (char const *criteria, criteria_test_fun_t *fun,
Value **test_value)
{
char *p;
gnum_float tmp;
......
......@@ -9,6 +9,7 @@
#include <math.h>
#include "gnumeric.h"
#include "parse-util.h"
#include "str.h"
#include "cell.h"