428
|
1 /* Sunpro-specific routines.
|
|
2
|
|
3 Copyright (C) 1994 Sun Microsystems, Inc.
|
|
4
|
|
5 This file is part of XEmacs.
|
|
6
|
|
7 XEmacs is free software; you can redistribute it and/or modify it
|
|
8 under the terms of the GNU General Public License as published by the
|
|
9 Free Software Foundation; either version 2, or (at your option) any
|
|
10 later version.
|
|
11
|
|
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
13 ANY 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.
|
|
16
|
|
17 You should have received a copy of the GNU General Public License
|
|
18 along with XEmacs; see the file COPYING. If not, write to
|
|
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
20 Boston, MA 02111-1307, USA. */
|
|
21
|
|
22 /* Synched up with: Not in FSF. */
|
|
23
|
4105
|
24 /* Commentary:
|
|
25
|
|
26 According to Paul Keusemann in <20070802140358.GA19566@visi.com>, this
|
|
27 feature probably still works as of 2007-08-02. However, that doesn't seem
|
|
28 reliable since there doesn't seem to be a way to configure it! */
|
|
29
|
428
|
30 #include <config.h>
|
|
31 #include "lisp.h"
|
|
32
|
|
33 /* ####
|
|
34
|
|
35 The following junk used to be in lisp/prim/files.el. It obviously
|
|
36 doesn't belong there, but should go somewhere.
|
|
37
|
|
38 (if (fboundp 'ut-log-text) ;; #### Sun stuff; what is this?
|
|
39 (ut-log-text "Reading a file."))
|
|
40 */
|
|
41
|
|
42 /* Whether usage tracking is turned on (Sun only) */
|
|
43 Lisp_Object Vusage_tracking;
|
|
44 #ifdef USAGE_TRACKING
|
|
45 #include <ut.h>
|
|
46 #endif
|
|
47
|
|
48 DEFUN ("ut-log-text", Fut_log_text, 1, MANY, 0, /*
|
|
49 Log a usage-tracking message if `usage-tracking' is non-nil.
|
|
50 Args are the same as to `format'. Returns whether the message was
|
|
51 actually logged. If usage-tracking support was not compiled in, this
|
|
52 function has no effect and always returns `nil'. See function
|
|
53 `has-usage-tracking-p'.
|
|
54 */
|
2286
|
55 #ifdef USAGE_TRACKING
|
|
56 (int nargs, Lisp_Object *args)
|
|
57 #else
|
|
58 (int UNUSED (nargs), Lisp_Object *UNUSED (args))
|
|
59 #endif
|
4105
|
60 )
|
428
|
61 {
|
|
62 #ifdef USAGE_TRACKING
|
|
63 Lisp_Object xs;
|
771
|
64 unsigned char *s;
|
428
|
65
|
|
66 if (!NILP (Vusage_tracking))
|
|
67 {
|
|
68 xs = Fformat (nargs, args);
|
|
69 CHECK_STRING (xs);
|
|
70 s = XSTRING_DATA (xs);
|
|
71 ut_log_text ((char *) s);
|
|
72 }
|
|
73 return Vusage_tracking;
|
|
74 #else
|
|
75 return Qnil;
|
|
76 #endif
|
|
77 }
|
|
78
|
|
79
|
|
80 /************************************************************************/
|
|
81 /* initialization */
|
|
82 /************************************************************************/
|
|
83
|
|
84 void
|
|
85 syms_of_sunpro (void)
|
|
86 {
|
|
87 DEFSUBR (Fut_log_text);
|
|
88 }
|
|
89
|
|
90 void
|
|
91 vars_of_sunpro (void)
|
|
92 {
|
|
93 DEFVAR_LISP ("usage-tracking", &Vusage_tracking /*
|
|
94 Whether usage tracking is turned on (Sun internal use only).
|
|
95 Has no effect if usage tracking support has not been compiled in.
|
|
96 */ );
|
|
97 Vusage_tracking = Qnil;
|
|
98
|
|
99 Fprovide (intern ("sparcworks"));
|
|
100 #ifdef USAGE_TRACKING
|
|
101 Fprovide (intern ("usage-tracking"));
|
|
102 #endif
|
|
103 }
|
|
104
|
|
105 void
|
|
106 init_sunpro (void)
|
|
107 {
|
|
108 Vusage_tracking = Qnil;
|
|
109 #ifdef USAGE_TRACKING
|
|
110 if (!purify_flag)
|
|
111 { /* Enabled only when not dumping an executable */
|
|
112 Vusage_tracking = Qt;
|
|
113 ut_initialize ("xemacs", NULL, NULL);
|
|
114 }
|
|
115 #endif
|
|
116 }
|