groff before CVS: release 1.06
[s-roff.git] / troff / request.h
blob2de9fb7c7739f32deae304e8fcefbf45b6634647
1 // -*- C++ -*-
2 /* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
3 Written by James Clark (jjc@jclark.com)
5 This file is part of groff.
7 groff is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
12 groff is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 You should have received a copy of the GNU General Public License along
18 with groff; see the file COPYING. If not, write to the Free Software
19 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
21 typedef void (*REQUEST_FUNCP)();
23 class macro;
25 class request_or_macro : public object {
26 public:
27 request_or_macro();
28 virtual void invoke(symbol s) = 0;
29 virtual macro *to_macro();
32 class request : public request_or_macro {
33 REQUEST_FUNCP p;
34 public:
35 void invoke(symbol);
36 request(REQUEST_FUNCP);
39 void delete_request_or_macro(request_or_macro *);
41 extern object_dictionary request_dictionary;
43 struct macro_header;
44 struct node;
46 class macro : public request_or_macro {
47 macro_header *p;
48 const char *filename; // where was it defined?
49 int lineno;
50 int length;
51 public:
52 macro();
53 ~macro();
54 macro(const macro &);
55 macro &operator=(const macro &);
56 void append(unsigned char);
57 void append(node *);
58 void invoke(symbol);
59 macro *to_macro();
60 void print_size();
61 int empty();
62 friend class string_iterator;
63 friend void chop_macro();
64 friend int operator==(const macro &, const macro &);
67 extern void init_input_requests();
68 extern void init_div_requests();
69 extern void init_node_requests();
70 extern void init_reg_requests();
71 extern void init_env_requests();
72 extern void init_hyphen_requests();
73 extern void init_request(const char *s, REQUEST_FUNCP f);
75 extern int no_break_flag; // indicates whether request was invoked with . or '
77 class charinfo;
78 class environment;
80 node *charinfo_to_node_list(charinfo *, const environment *);