1 /* macro.h - declarations for macro.c */
2 #ifndef MACRO_H
3 #define MACRO_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 typedef struct {
22     enum command_id cmd;
23     char *begin;
24     char *end;
25 } INFO_ENCLOSE;
26 
27 typedef struct {
28     char *macro_name;
29     ELEMENT *element;
30     enum command_id cmd;
31     char *macrobody;
32 } MACRO;
33 
34 void new_macro (char *name, ELEMENT *macro);
35 ELEMENT *parse_macro_command_line (enum command_id, char **line_inout,
36                                    ELEMENT *parent);
37 ELEMENT *handle_macro (ELEMENT *current, char **line_inout,
38                        enum command_id cmd_id);
39 void delete_macro (char *name);
40 MACRO *lookup_macro (enum command_id cmd);
41 void wipe_macros (void);
42 
43 void store_value (char *name, char *value);
44 char *fetch_value (char *name);
45 void clear_value (char *name);
46 INFO_ENCLOSE *lookup_infoenclose (enum command_id cmd);
47 void add_infoenclose (enum command_id cmd, char *begin, char *end);
48 
49 #endif
50