dataset: Remove unused types and useless struct forward declaration.
[pspp-builds.git] / src / data / procedure.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17 #ifndef PROCEDURE_H
18 #define PROCEDURE_H 1
19
20 #include <time.h>
21 #include <stdbool.h>
22
23 #include "data/transformations.h"
24 #include "libpspp/compiler.h"
25
26 struct casereader;
27 struct dataset;
28 struct dictionary;
29 \f
30 /* Transformations. */
31
32 void add_transformation (struct dataset *ds,
33                          trns_proc_func *, trns_free_func *, void *);
34 void add_transformation_with_finalizer (struct dataset *ds,
35                                         trns_finalize_func *,
36                                         trns_proc_func *,
37                                         trns_free_func *, void *);
38 size_t next_transformation (const struct dataset *ds);
39
40 bool proc_cancel_all_transformations (struct dataset *ds);
41 struct trns_chain *proc_capture_transformations (struct dataset *ds);
42
43 void proc_start_temporary_transformations (struct dataset *ds);
44 bool proc_in_temporary_transformations (const struct dataset *ds);
45 bool proc_make_temporary_transformations_permanent (struct dataset *ds);
46 bool proc_cancel_temporary_transformations (struct dataset *ds);
47 \f
48 /* Procedures. */
49
50 typedef void transformation_change_callback_func (bool non_empty, void *aux);
51
52 struct dataset * create_dataset (void);
53
54 void destroy_dataset (struct dataset *);
55
56 void dataset_add_transform_change_callback (struct dataset *,
57                                             transformation_change_callback_func *, void *);
58
59 void proc_discard_active_file (struct dataset *);
60 void proc_set_active_file (struct dataset *,
61                            struct casereader *, struct dictionary *);
62 bool proc_set_active_file_data (struct dataset *, struct casereader *);
63 bool proc_has_active_file (const struct dataset *ds);
64 struct casereader *proc_extract_active_file_data (struct dataset *);
65
66 void proc_discard_output (struct dataset *ds);
67
68 bool proc_execute (struct dataset *ds);
69 time_t time_of_last_procedure (struct dataset *ds);
70
71 struct casereader *proc_open_filtering (struct dataset *, bool filter);
72 struct casereader *proc_open (struct dataset *);
73 bool proc_is_open (const struct dataset *);
74 bool proc_commit (struct dataset *);
75
76 bool dataset_end_of_command (struct dataset *);
77 \f
78 struct dictionary *dataset_dict (const struct dataset *ds);
79 const struct casereader *dataset_source (const struct dataset *ds);
80
81 const struct ccase *lagged_case (const struct dataset *ds, int n_before);
82 void dataset_need_lag (struct dataset *ds, int n_before);
83
84 void dataset_set_callback (struct dataset *ds, void (*cb) (void *), void *);
85
86 void dataset_set_default_syntax_encoding (struct dataset *, const char *);
87 const char *dataset_get_default_syntax_encoding (const struct dataset *);
88
89 #endif /* procedure.h */