1 #ifndef _GNM_COLLECT_H_
2 # define _GNM_COLLECT_H_
3 
4 #include <numbers.h>
5 #include <gnumeric.h>
6 
7 G_BEGIN_DECLS
8 
9 typedef enum {
10 	COLLECT_IGNORE_STRINGS	= 0x01,
11 	COLLECT_ZERO_STRINGS	= 0x02,
12 	COLLECT_COERCE_STRINGS	= 0x04,
13 
14 	COLLECT_IGNORE_BOOLS	= 0x10,
15 	COLLECT_ZEROONE_BOOLS	= 0x20,
16 
17 	COLLECT_IGNORE_ERRORS	= 0x100,
18 	COLLECT_ZERO_ERRORS	= 0x200,
19 
20 	COLLECT_IGNORE_BLANKS	= 0x1000,
21 	COLLECT_ZERO_BLANKS	= 0x2000,
22 
23 	COLLECT_IGNORE_SUBTOTAL	= 0x4000,
24 
25 	COLLECT_SORT            = 0x10000,
26 	COLLECT_ORDER_IRRELEVANT = 0x20000,
27 
28 	/* Not for general usage.  */
29 	COLLECT_INFO		= 0x1000000
30 } CollectFlags;
31 
32 typedef int (*float_range_function_t) (gnm_float const *xs, int n, gnm_float *res);
33 typedef int (*float_range_function2_t) (gnm_float const *xs, gnm_float const *ys, int n, gnm_float *res);
34 typedef int (*float_range_function2d_t) (gnm_float const *xs, gnm_float const *ys, int n, gnm_float *res, gpointer data);
35 typedef int (*string_range_function_t) (GPtrArray *xs, char**res, gpointer user);
36 
37 gnm_float *collect_floats_value (GnmValue const *val,
38 				 GnmEvalPos const *ep,
39 				 CollectFlags flags,
40 				 int *n, GnmValue **error);
41 gnm_float *collect_floats (int argc, GnmExprConstPtr const *argv,
42 			   GnmEvalPos const *ep, CollectFlags flags,
43 			   int *n, GnmValue **error, GSList **info,
44 			   gboolean *constp);
45 
46 gnm_float *collect_floats_value_with_info (GnmValue const *val, GnmEvalPos const *ep,
47 				CollectFlags flags, int *n, GSList **info,
48 				GnmValue **error);
49 
50 GnmValue *collect_float_pairs (GnmValue const *v0, GnmValue const *v1,
51 			       GnmEvalPos const *ep, CollectFlags flags,
52 			       gnm_float **xs0, gnm_float **xs1, int *n,
53 			       gboolean *constp);
54 
55 GnmValue *float_range_function (int argc, GnmExprConstPtr const *argv,
56 				GnmFuncEvalInfo *ei,
57 				float_range_function_t func,
58 				CollectFlags flags,
59 				GnmStdError func_error);
60 
61 GnmValue *float_range_function2 (GnmValue const *val0, GnmValue const *val1,
62 				 GnmFuncEvalInfo *ei,
63 				 float_range_function2_t func,
64 				 CollectFlags flags,
65 				 GnmStdError func_error);
66 
67 GnmValue *float_range_function2d (GnmValue const *val0, GnmValue const *val1,
68 				  GnmFuncEvalInfo *ei,
69 				  float_range_function2d_t func,
70 				  CollectFlags flags,
71 				  GnmStdError func_error,
72 				  gpointer data);
73 
74 GnmValue *string_range_function (int argc, GnmExprConstPtr const *argv,
75 				 GnmFuncEvalInfo *ei,
76 				 string_range_function_t func,
77 				 gpointer user,
78 				 CollectFlags flags,
79 				 GnmStdError func_error);
80 
81 GSList *gnm_slist_sort_merge (GSList * list_1, GSList * list_2);
82 
83 void gnm_strip_missing (gnm_float* data, int *n, GSList *missing);
84 
85 
86 G_END_DECLS
87 
88 #endif /* _GNM_COLLECT_H_ */
89