b45e008720dee14132c1d03ee25ad49df982915a
[pspp-builds.git] / src / output / output-item.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2009 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 OUTPUT_ITEM_H
18 #define OUTPUT_ITEM_H 1
19
20 /* Output items.
21
22    An output item is a self-contained chunk of output.  The
23    following kinds of output items currently exist:
24
25         - Tables (see output/table-item.h).
26
27         - Charts (see output/chart-item.h).
28
29         - Text strings (see output/text-item.h).
30
31         - Messages (see output/message-item.h).
32 */
33
34 #include <libpspp/cast.h>
35 #include <stdbool.h>
36
37 /* A single output item. */
38 struct output_item
39   {
40     const struct output_item_class *class;
41
42     /* Reference count.  An output item may be shared between multiple owners,
43        indicated by a reference count greater than 1.  When this is the case,
44        the output item must not be modified. */
45     int ref_cnt;
46   };
47
48 struct output_item *output_item_ref (const struct output_item *);
49 void output_item_unref (struct output_item *);
50 bool output_item_is_shared (const struct output_item *);
51
52 #endif /* output/output-item.h */