1 /* context_stack.h - declarations for context_stack.c */
2 #ifndef CONTEXT_STACK_H
3 #define CONTEXT_STACK_H
4 /* Copyright 2010-2021 Free Software Foundation, Inc.
5 
6    This program is free software: you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation, either version 3 of the License, or
9    (at your option) any later version.
10 
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15 
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
18 
19 #include "tree_types.h"
20 
21 enum context {
22     ct_NONE,
23     ct_line,
24     ct_def,
25     ct_preformatted,
26     ct_rawpreformatted,
27     ct_menu,
28     ct_math,
29     ct_footnote,
30     ct_caption,
31     ct_shortcaption,
32     ct_inlineraw
33 };
34 
35 /* Contexts where an empty line doesn't start a new paragraph. */
36 #define in_paragraph_context(c) \
37   !((c) == ct_math \
38    || (c) == ct_menu \
39    || (c) == ct_def \
40    || (c) == ct_preformatted \
41    || (c) == ct_rawpreformatted \
42    || (c) == ct_inlineraw)
43 
44 void push_context (enum context c);
45 enum context pop_context ();
46 enum context current_context (void);
47 void reset_context_stack (void);
48 
49 
50 void push_region (ELEMENT *r);
51 ELEMENT *pop_region (void);
52 ELEMENT *current_region (void);
53 enum command_id current_region_cmd (void);
54 
55 void reset_region_stack (void);
56 #endif
57