ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/misc.C
(Generate patch)

Comparing rxvt-unicode/src/misc.C (file contents):
Revision 1.10 by pcg, Sat Mar 6 00:05:01 2004 UTC vs.
Revision 1.12 by pcg, Wed Mar 17 05:15:02 2004 UTC

68/* 68/*
69 * Print an error message 69 * Print an error message
70 */ 70 */
71/* EXTPROTO */ 71/* EXTPROTO */
72void 72void
73rxvt_vlog (const char *fmt, va_list arg_ptr)
74{
75 char msg[1024];
76
77 vsnprintf (msg, sizeof msg, fmt, arg_ptr);
78
79 if (GET_R && GET_R->log_hook)
80 (*GET_R->log_hook) (msg);
81 else
82 write (STDOUT_FILENO, msg, strlen (msg));
83}
84
85/* EXTPROTO */
86void
73rxvt_print_error (const char *fmt,...) 87rxvt_log (const char *fmt,...)
74{ 88{
75 va_list arg_ptr; 89 va_list arg_ptr;
76 90
77 va_start (arg_ptr, fmt); 91 va_start (arg_ptr, fmt);
78 fprintf (stderr, RESNAME ": "); 92 rxvt_vlog (fmt, arg_ptr);
79 vfprintf (stderr, fmt, arg_ptr);
80 fprintf (stderr, "\n");
81 va_end (arg_ptr); 93 va_end (arg_ptr);
94}
95
96/*
97 * Print an error message
98 */
99/* EXTPROTO */
100void
101rxvt_warn (const char *fmt,...)
102{
103 va_list arg_ptr;
104
105 rxvt_log ("%s: ", RESNAME);
106
107 va_start (arg_ptr, fmt);
108 rxvt_vlog (fmt, arg_ptr);
109 va_end (arg_ptr);
110}
111
112/* EXTPROTO */
113void
114rxvt_fatal (const char *fmt,...)
115{
116 va_list arg_ptr;
117
118 rxvt_log ("%s: ", RESNAME);
119
120 va_start (arg_ptr, fmt);
121 rxvt_vlog (fmt, arg_ptr);
122 va_end (arg_ptr);
123
124 rxvt_exit_failure ();
125}
126
127class rxvt_failure_exception rxvt_failure_exception;
128
129/* EXTPROTO */
130void
131rxvt_exit_failure ()
132{
133 throw (rxvt_failure_exception);
82} 134}
83 135
84/* 136/*
85 * check that the first characters of S1 match S2 137 * check that the first characters of S1 match S2
86 * 138 *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines