2 /* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004, 2008,
4 Free Software Foundation, Inc.
5 Written by James Clark (jjc@jclark.com)
7 This file is part of groff.
9 groff is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 groff is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 typedef void (*REQUEST_FUNCP)();
26 class request_or_macro : public object {
29 virtual void invoke(symbol, int) = 0;
30 virtual macro *to_macro();
33 class request : public request_or_macro {
36 void invoke(symbol, int);
37 request(REQUEST_FUNCP);
40 void delete_request_or_macro(request_or_macro *);
42 extern object_dictionary request_dictionary;
47 class macro : public request_or_macro {
48 const char *filename; // where was it defined?
53 int is_a_string; // if it contains no newline
60 macro &operator=(const macro &);
61 void append(unsigned char);
63 void append_unsigned(unsigned int);
65 void append_str(const char *);
66 void set(unsigned char, int);
67 unsigned char get(int);
69 void invoke(symbol, int);
75 void clear_string_flag();
76 friend class string_iterator;
77 friend void chop_macro();
78 friend void substring_request();
79 friend int operator==(const macro &, const macro &);
82 extern void init_input_requests();
83 extern void init_markup_requests();
84 extern void init_div_requests();
85 extern void init_node_requests();
86 extern void init_reg_requests();
87 extern void init_env_requests();
88 extern void init_hyphen_requests();
89 extern void init_request(const char *, REQUEST_FUNCP);
94 node *charinfo_to_node_list(charinfo *, const environment *);