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
|
|
24 #include <config.h>
|
|
25 #include "lisp.h"
|
|
26
|
|
27 /* ####
|
|
28
|
|
29 The following junk used to be in lisp/prim/files.el. It obviously
|
|
30 doesn't belong there, but should go somewhere.
|
|
31
|
|
32 (if (fboundp 'ut-log-text) ;; #### Sun stuff; what is this?
|
|
33 (ut-log-text "Reading a file."))
|
|
34 */
|
|
35
|
|
36 /* Whether usage tracking is turned on (Sun only) */
|
|
37 Lisp_Object Vusage_tracking;
|
|
38 #ifdef USAGE_TRACKING
|
|
39 #include <ut.h>
|
|
40 #endif
|
|
41
|
|
42 DEFUN ("ut-log-text", Fut_log_text, 1, MANY, 0, /*
|
|
43 Log a usage-tracking message if `usage-tracking' is non-nil.
|
|
44 Args are the same as to `format'. Returns whether the message was
|
|
45 actually logged. If usage-tracking support was not compiled in, this
|
|
46 function has no effect and always returns `nil'. See function
|
|
47 `has-usage-tracking-p'.
|
|
48 */
|
2286
|
49 #ifdef USAGE_TRACKING
|
|
50 (int nargs, Lisp_Object *args)
|
|
51 #else
|
|
52 (int UNUSED (nargs), Lisp_Object *UNUSED (args))
|
|
53 #endif
|
428
|
54 {
|
|
55 #ifdef USAGE_TRACKING
|
|
56 Lisp_Object xs;
|
771
|
57 unsigned char *s;
|
428
|
58
|
|
59 if (!NILP (Vusage_tracking))
|
|
60 {
|
|
61 xs = Fformat (nargs, args);
|
|
62 CHECK_STRING (xs);
|
|
63 s = XSTRING_DATA (xs);
|
|
64 ut_log_text ((char *) s);
|
|
65 }
|
|
66 return Vusage_tracking;
|
|
67 #else
|
|
68 return Qnil;
|
|
69 #endif
|
|
70 }
|
|
71
|
|
72
|
|
73 /************************************************************************/
|
|
74 /* initialization */
|
|
75 /************************************************************************/
|
|
76
|
|
77 void
|
|
78 syms_of_sunpro (void)
|
|
79 {
|
|
80 DEFSUBR (Fut_log_text);
|
|
81 }
|
|
82
|
|
83 void
|
|
84 vars_of_sunpro (void)
|
|
85 {
|
|
86 DEFVAR_LISP ("usage-tracking", &Vusage_tracking /*
|
|
87 Whether usage tracking is turned on (Sun internal use only).
|
|
88 Has no effect if usage tracking support has not been compiled in.
|
|
89 */ );
|
|
90 Vusage_tracking = Qnil;
|
|
91
|
|
92 Fprovide (intern ("sparcworks"));
|
|
93 #ifdef USAGE_TRACKING
|
|
94 Fprovide (intern ("usage-tracking"));
|
|
95 #endif
|
|
96 }
|
|
97
|
|
98 void
|
|
99 init_sunpro (void)
|
|
100 {
|
|
101 Vusage_tracking = Qnil;
|
|
102 #ifdef USAGE_TRACKING
|
|
103 if (!purify_flag)
|
|
104 { /* Enabled only when not dumping an executable */
|
|
105 Vusage_tracking = Qt;
|
|
106 ut_initialize ("xemacs", NULL, NULL);
|
|
107 }
|
|
108 #endif
|
|
109 }
|