Implement DATASET commands.
[pspp-builds.git] / src / data / session.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 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 SESSION_H
18 #define SESSION_H 1
19
20 #include <stddef.h>
21
22 struct dataset;
23
24 struct session *session_create (void);
25 void session_destroy (struct session *);
26
27 struct dataset *session_active_dataset (struct session *);
28 void session_set_active_dataset (struct session *, struct dataset *);
29
30 void session_add_dataset (struct session *, struct dataset *);
31 void session_remove_dataset (struct session *, struct dataset *);
32 struct dataset *session_lookup_dataset (const struct session *, const char *);
33 struct dataset *session_lookup_dataset_assert (const struct session *,
34                                                const char *);
35
36 void session_set_default_syntax_encoding (struct session *, const char *);
37 const char *session_get_default_syntax_encoding (const struct session *);
38
39 size_t session_n_datasets (const struct session *);
40 void session_for_each_dataset (const struct session *,
41                                void (*cb) (struct dataset *, void *aux),
42                                void *aux);
43
44 struct dataset *session_get_dataset_by_seqno (const struct session *,
45                                               unsigned int seqno);
46
47 #endif /* session.h */