1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2020 Free Software Foundation, Inc.
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.
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.
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/>. */
17 #ifndef OUTPUT_PAGE_EJECT_ITEM_H
18 #define OUTPUT_PAGE_EJECT_ITEM_H 1
22 This ejects the page (for output devices that have pages). */
25 #include "output/output-item.h"
27 /* A page eject item. */
28 struct page_eject_item
30 struct output_item output_item;
33 struct page_eject_item *page_eject_item_create (void);
35 /* This boilerplate for page_eject_item, a subclass of output_item, was
36 autogenerated by mk-class-boilerplate. */
39 #include "libpspp/cast.h"
41 extern const struct output_item_class page_eject_item_class;
43 /* Returns true if SUPER is a page_eject_item, otherwise false. */
45 is_page_eject_item (const struct output_item *super)
47 return super->class == &page_eject_item_class;
50 /* Returns SUPER converted to page_eject_item. SUPER must be a page_eject_item, as
51 reported by is_page_eject_item. */
52 static inline struct page_eject_item *
53 to_page_eject_item (const struct output_item *super)
55 assert (is_page_eject_item (super));
56 return UP_CAST (super, struct page_eject_item, output_item);
59 /* Returns INSTANCE converted to output_item. */
60 static inline struct output_item *
61 page_eject_item_super (const struct page_eject_item *instance)
63 return CONST_CAST (struct output_item *, &instance->output_item);
66 /* Increments INSTANCE's reference count and returns INSTANCE. */
67 static inline struct page_eject_item *
68 page_eject_item_ref (const struct page_eject_item *instance)
70 return to_page_eject_item (output_item_ref (&instance->output_item));
73 /* Decrements INSTANCE's reference count, then destroys INSTANCE if
74 the reference count is now zero. */
76 page_eject_item_unref (struct page_eject_item *instance)
78 output_item_unref (&instance->output_item);
81 /* Returns true if INSTANCE's reference count is greater than 1,
84 page_eject_item_is_shared (const struct page_eject_item *instance)
86 return output_item_is_shared (&instance->output_item);
89 void page_eject_item_submit (struct page_eject_item *);
91 #endif /* output/page-eject-item.h */