4 /* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004
5 Free Software Foundation, Inc.
6 Written by James Clark (jjc@jclark.com)
8 This file is part of groff.
10 groff is free software; you can redistribute it and/or modify it under
11 the terms of the GNU General Public License as published by the Free
12 Software Foundation; either version 2, or (at your option) any later
15 groff is distributed in the hope that it will be useful, but WITHOUT ANY
16 WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 You should have received a copy of the GNU General Public License along
21 with groff; see the file COPYING. If not, write to the Free Software
22 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
24 typedef void (*REQUEST_FUNCP
)();
28 class request_or_macro
: public object
{
31 virtual void invoke(symbol s
) = 0;
32 virtual macro
*to_macro();
35 class request
: public request_or_macro
{
39 request(REQUEST_FUNCP
);
42 void delete_request_or_macro(request_or_macro
*);
44 extern object_dictionary request_dictionary
;
49 class macro
: public request_or_macro
{
50 const char *filename
; // where was it defined?
61 macro
&operator=(const macro
&);
62 void append(unsigned char);
64 void append_unsigned(unsigned int i
);
65 void append_int(int i
);
66 void append_str(const char *);
67 void set(unsigned char, int);
68 unsigned char get(int);
75 friend class string_iterator
;
76 friend void chop_macro();
77 friend void substring_request();
78 friend int operator==(const macro
&, const macro
&);
81 extern void init_input_requests();
82 extern void init_markup_requests();
83 extern void init_div_requests();
84 extern void init_node_requests();
85 extern void init_reg_requests();
86 extern void init_env_requests();
87 extern void init_hyphen_requests();
88 extern void init_request(const char *s
, REQUEST_FUNCP f
);
93 node
*charinfo_to_node_list(charinfo
*, const environment
*);