3 .\" Load this before a macro package that you want to trace.
6 .\" Copyright (C) 1989, 1990, 1991, 1992, 2000, 2002, 2003, 2004, 2006,
8 .\" Free Software Foundation, Inc.
9 .\" Written by James Clark (jjc@jclark.com)
11 .\" This file is part of groff.
13 .\" groff is free software; you can redistribute it and/or modify it under
14 .\" the terms of the GNU General Public License as published by the Free
15 .\" Software Foundation; either version 2, or (at your option) any later
18 .\" groff is distributed in the hope that it will be useful, but WITHOUT ANY
19 .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 .\" You should have received a copy of the GNU General Public License along
24 .\" with groff; see the file COPYING. If not, write to the Free Software
25 .\" Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
29 .\" Regarding the usage of `.do': All lines of macros which should
30 .\" work in compatibility mode must be protected if they contain
31 .\" GNU troff extensions and are defined with `.de'. Example: `.ds',
32 .\" but not `.ds1', since the latter can't be called in compatibility
55 . tm1 "\*[!!!sp]*** .nr \$* (-> \n[\$1])
67 . do tm1 "\*[!!!sp]*** .ds \$^
75 . tm1 "\*[!!!sp]*** .ds1 \$^
83 . do tm1 "\*[!!!sp]*** .as \$^
91 . tm1 "\*[!!!sp]*** .as1 \$^
96 .rn substring !!substring
102 . tm1 "\*[!!!sp]*** .substring \$* (-> `\*[\$1]')
114 . tm1 "\*[!!!sp]*** .als \$1 \$2
118 .!!c Now the central tracing macros. The redefined `de' macros
119 .!!c create wrapper macros `foo' which emit tracing messages
120 .!!c before and after the call to the traced macro `!!foo'.
122 .!!c Note that we define `!!foo' in advance so that an alias to
123 .!!c `!!!!foo' is possible. The latter occurs if `foo' is
124 .!!c called as \\[foo].
126 .!!c The call to `dei' must be the last instruction in the macro
127 .!!c (since it continues the definition of the macro to trace).
141 . do tm1 "\\*[!!!sp]*** de trace enter: \\*[!!!br]\\$0 \\$@
143 . do tm1 "\\*[!!!sp]*** de trace enter \$1: \\*[!!!br]\\$0 \\$@
149 . do !!substring !!!sp 1
155 . do tm1 "\\*[!!!sp]*** trace exit: \\*[!!!br]\\$0 \\$@
157 . do tm1 "\\*[!!!sp]*** trace exit \$1: \\*[!!!br]\\$0 \\$@
165 . do !!als !!!!\$1 !!\$1
180 . tm1 "\\*[!!!sp]*** de1 trace enter: \\*[!!!br]\\$0 \\$@
182 . tm1 "\\*[!!!sp]*** de1 trace enter \$1: \\*[!!!br]\\$0 \\$@
188 . !!substring !!!sp 1
194 . tm1 "\\*[!!!sp]*** trace exit: \\*[!!!br]\\$0 \\$@
196 . tm1 "\\*[!!!sp]*** trace exit \$1: \\*[!!!br]\\$0 \\$@
204 . !!als !!!!\$1 !!\$1
222 . do tm1 "\\*[!!!sp]*** am trace enter: \\*[!!!br]\\$0 \\$@
224 . do tm1 "\\*[!!!sp]*** am trace enter \$1: \\*[!!!br]\\$0 \\$@
230 . do !!substring !!!sp 1
236 . do tm1 "\\*[!!!sp]*** trace exit: \\*[!!!br]\\$0 \\$@
238 . do tm1 "\\*[!!!sp]*** trace exit \$1: \\*[!!!br]\\$0 \\$@
246 . do !!als !!!!\$1 !!\$1
261 . tm1 "\\*[!!!sp]*** am1 trace enter: \\*[!!!br]\\$0 \\$@
263 . tm1 "\\*[!!!sp]*** am1 trace enter \$1: \\*[!!!br]\\$0 \\$@
269 . !!substring !!!sp 1
275 . tm1 "\\*[!!!sp]*** trace exit: \\*[!!!br]\\$0 \\$@
277 . tm1 "\\*[!!!sp]*** trace exit \$1: \\*[!!!br]\\$0 \\$@
285 . !!als !!!!\$1 !!\$1
294 . tm1 "\*[!!!sp]*** return
303 . do tm1 "\*[!!!sp]*** .so \$* {
309 . do !!substring !!!sp 1
310 . do tm1 "\*[!!!sp]*** }
314 .!!c We must use `.de' for the redefinition of .mso to avoid
315 .!!c side effects; for example, it might be called with
323 . do tm1 "\*[!!!sp]*** .mso \$* {
329 . do !!substring !!!sp 1
330 . do tm1 "\*[!!!sp]*** }
343 . tm1 "\*[!!!sp]*** .rn \$1 \$2