1 # ztrace.tcl --
2 #
3 # Buffer output until a SIGINT is caught; when caught, flush the output
4 # and exit. The implementation that allows the ZTrace object to be
5 # "compiled away" is from Yatin's MTrace impl.
6 #
7 # Copyright (c) 1998-2002 The Regents of the University of California.
8 # All rights reserved.
9 #
10 # Redistribution and use in source and binary forms, with or without
11 # modification, are permitted provided that the following conditions are met:
12 #
13 # A. Redistributions of source code must retain the above copyright notice,
14 # this list of conditions and the following disclaimer.
15 # B. Redistributions in binary form must reproduce the above copyright notice,
16 # this list of conditions and the following disclaimer in the documentation
17 # and/or other materials provided with the distribution.
18 # C. Neither the names of the copyright holders nor the names of its
19 # contributors may be used to endorse or promote products derived from this
20 # software without specific prior written permission.
21 #
22 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
23 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
26 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #
33 # $Header: /usr/mash/src/repository/mash/mash-1/tcl/common/ztrace.tcl,v 1.5 2002/02/03 04:25:43 lim Exp $
34
35
36 # Check if the ZTrace object exists, if it doesn't, then just create a NULL
37 # ZTrace method.
38
39 #Class ZTrace -- import needs this comment so it can find C++ defined objs
40
41 if { [Class info instances ZTrace]=="" } {
42 proc ZTrace { args } {
43 # ZTracing not enabled so define
44 # this method to do nothing
45 return ZTrace
46 }
47 }
48
49 ZTrace proc init { } {
50 ZTrace instvar ztrace
51 set ztrace [new ZTrace]
52 }
53
54 proc ztrace { args } {
55 ZTrace instvar ztrace
56 if [info exists ztrace] {
57 $ztrace trace $args
58 }
59 }
60
61
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.