collect.h 2.41 KB
Newer Older
1 2 3
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef _GNM_COLLECT_H_
# define _GNM_COLLECT_H_
Morten Welinder's avatar
Morten Welinder committed
4

Morten Welinder's avatar
Morten Welinder committed
5
#include "numbers.h"
6
#include "gnumeric.h"
Morten Welinder's avatar
Morten Welinder committed
7

8 9
G_BEGIN_DECLS

Morten Welinder's avatar
Morten Welinder committed
10
typedef enum {
11 12
	COLLECT_IGNORE_STRINGS	= 0x01,
	COLLECT_ZERO_STRINGS	= 0x02,
13
	COLLECT_COERCE_STRINGS	= 0x04,
Morten Welinder's avatar
Morten Welinder committed
14

15 16
	COLLECT_IGNORE_BOOLS	= 0x10,
	COLLECT_ZEROONE_BOOLS	= 0x20,
Morten Welinder's avatar
Morten Welinder committed
17

18
	COLLECT_IGNORE_ERRORS	= 0x100,
19

20
	COLLECT_IGNORE_BLANKS	= 0x1000,
21 22 23
	COLLECT_ZERO_BLANKS	= 0x2000,

	COLLECT_IGNORE_SUBTOTAL	= 0x4000,
Morten Welinder's avatar
Morten Welinder committed
24

Morten Welinder's avatar
Morten Welinder committed
25 26 27
	COLLECT_SORT            = 0x10000,
	COLLECT_ORDER_IRRELEVANT = 0x20000,

28 29 30
	/* Not for general usage.  */
	COLLECT_INFO		= 0x1000000
} CollectFlags;
Morten Welinder's avatar
Morten Welinder committed
31

Jody Goldberg's avatar
Jody Goldberg committed
32 33
typedef int (*float_range_function_t) (gnm_float const *, int, gnm_float *);
typedef int (*float_range_function2_t) (gnm_float const *, gnm_float const *, int, gnm_float *);
34
typedef int (*float_range_function2d_t) (gnm_float const *, gnm_float const *, int, gnm_float *, gpointer);
35
typedef int (*string_range_function_t) (GPtrArray *, char**);
Morten Welinder's avatar
Morten Welinder committed
36

37 38
gnm_float *collect_floats_value (GnmValue const *val,
				 GnmEvalPos const *ep,
Jody Goldberg's avatar
Jody Goldberg committed
39 40 41
				 CollectFlags flags,
				 int *n, GnmValue **error);

42 43 44 45
gnm_float *collect_floats_value_with_info (GnmValue const *val, GnmEvalPos const *ep,
				CollectFlags flags, int *n, GSList **info,
				GnmValue **error);

46 47
GnmValue *collect_float_pairs (GnmValue const *v0, GnmValue const *v1,
			       GnmEvalPos const *ep, CollectFlags flags,
48 49
			       gnm_float **xs0, gnm_float **xs1, int *n,
			       gboolean *constp);
50

51
GnmValue *float_range_function (int argc, GnmExprConstPtr const *argv,
52
				GnmFuncEvalInfo *ei,
Jody Goldberg's avatar
Jody Goldberg committed
53 54 55 56
				float_range_function_t func,
				CollectFlags flags,
				GnmStdError func_error);

Jody Goldberg's avatar
Jody Goldberg committed
57
GnmValue *float_range_function2 (GnmValue const *val0, GnmValue const *val1,
58
				 GnmFuncEvalInfo *ei,
Jody Goldberg's avatar
Jody Goldberg committed
59 60 61
				 float_range_function2_t func,
				 CollectFlags flags,
				 GnmStdError func_error);
62

63 64 65 66 67 68 69
GnmValue *float_range_function2d (GnmValue const *val0, GnmValue const *val1,
				  GnmFuncEvalInfo *ei,
				  float_range_function2d_t func,
				  CollectFlags flags,
				  GnmStdError func_error,
				  gpointer data);

70
GnmValue *string_range_function (int argc, GnmExprConstPtr const *argv,
71
				 GnmFuncEvalInfo *ei,
Jody Goldberg's avatar
Jody Goldberg committed
72 73 74
				 string_range_function_t func,
				 CollectFlags flags,
				 GnmStdError func_error);
75

76
GSList *gnm_slist_sort_merge (GSList * list_1, GSList * list_2);
77

78
void gnm_strip_missing (gnm_float* data, int *p, GSList *missing);
79

80

81 82 83
G_END_DECLS

#endif /* _GNM_COLLECT_H_ */