/contrib/groff/src/roff/troff/request.h

https://bitbucket.org/freebsd/freebsd-head/ · C++ Header · 91 lines · 60 code · 11 blank · 20 comment · 0 complexity · 4cd0b5fc00202b45c954f9d60d8acd22 MD5 · raw file

  1. // -*- C++ -*-
  2. /* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2004
  3. Free Software Foundation, Inc.
  4. Written by James Clark (jjc@jclark.com)
  5. This file is part of groff.
  6. groff is free software; you can redistribute it and/or modify it under
  7. the terms of the GNU General Public License as published by the Free
  8. Software Foundation; either version 2, or (at your option) any later
  9. version.
  10. groff is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13. for more details.
  14. You should have received a copy of the GNU General Public License along
  15. with groff; see the file COPYING. If not, write to the Free Software
  16. Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
  17. typedef void (*REQUEST_FUNCP)();
  18. class macro;
  19. class request_or_macro : public object {
  20. public:
  21. request_or_macro();
  22. virtual void invoke(symbol s) = 0;
  23. virtual macro *to_macro();
  24. };
  25. class request : public request_or_macro {
  26. REQUEST_FUNCP p;
  27. public:
  28. void invoke(symbol);
  29. request(REQUEST_FUNCP);
  30. };
  31. void delete_request_or_macro(request_or_macro *);
  32. extern object_dictionary request_dictionary;
  33. class macro_header;
  34. struct node;
  35. class macro : public request_or_macro {
  36. const char *filename; // where was it defined?
  37. int lineno;
  38. int len;
  39. int empty_macro;
  40. int is_a_diversion;
  41. public:
  42. macro_header *p;
  43. macro();
  44. ~macro();
  45. macro(const macro &);
  46. macro(int);
  47. macro &operator=(const macro &);
  48. void append(unsigned char);
  49. void append(node *);
  50. void append_unsigned(unsigned int i);
  51. void append_int(int i);
  52. void append_str(const char *);
  53. void set(unsigned char, int);
  54. unsigned char get(int);
  55. int length();
  56. void invoke(symbol);
  57. macro *to_macro();
  58. void print_size();
  59. int empty();
  60. int is_diversion();
  61. friend class string_iterator;
  62. friend void chop_macro();
  63. friend void substring_request();
  64. friend int operator==(const macro &, const macro &);
  65. };
  66. extern void init_input_requests();
  67. extern void init_markup_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);
  74. class charinfo;
  75. class environment;
  76. node *charinfo_to_node_list(charinfo *, const environment *);