(coded-charset-entity-reference-alist): Add setting for
[chise/xemacs-chise.git.1] / src / sunpro.c
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 */
49        (int nargs, Lisp_Object *args))
50 {
51 #ifdef USAGE_TRACKING
52   Lisp_Object xs;
53   unsigned char *s; /* #### Does not support I18N4. */
54
55   if (!NILP (Vusage_tracking))
56     {
57       xs = Fformat (nargs, args);
58       CHECK_STRING (xs);
59       s = XSTRING_DATA (xs);
60       ut_log_text ((char *) s);
61     }
62   return Vusage_tracking;
63 #else
64   return Qnil;
65 #endif
66 }
67
68 \f
69 /************************************************************************/
70 /*                            initialization                            */
71 /************************************************************************/
72
73 void
74 syms_of_sunpro (void)
75 {
76   DEFSUBR (Fut_log_text);
77 }
78
79 void
80 vars_of_sunpro (void)
81 {
82   DEFVAR_LISP ("usage-tracking", &Vusage_tracking /*
83 Whether usage tracking is turned on (Sun internal use only).
84 Has no effect if usage tracking support has not been compiled in.
85 */ );
86   Vusage_tracking = Qnil;
87
88   Fprovide (intern ("sparcworks"));
89 #ifdef USAGE_TRACKING
90   Fprovide (intern ("usage-tracking"));
91 #endif
92 }
93
94 void
95 init_sunpro (void)
96 {
97   Vusage_tracking = Qnil;
98 #ifdef USAGE_TRACKING
99   if (!purify_flag)
100     {          /* Enabled only when not dumping an executable */
101       Vusage_tracking = Qt;
102       ut_initialize ("xemacs", NULL, NULL);
103     }
104 #endif
105 }