9804 hal-set-property should support --direct option
[unleashed.git] / usr / src / cmd / tic / tic_error.c
blobe9aeeb3f9b689353d6d201416a1c40fc2db30d95
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1988 AT&T */
28 /* All Rights Reserved */
32 * University Copyright- Copyright (c) 1982, 1986, 1988
33 * The Regents of the University of California
34 * All Rights Reserved
36 * University Acknowledgment- Portions of this document are derived from
37 * software developed by the University of California, Berkeley, and its
38 * contributors.
41 #pragma ident "%Z%%M% %I% %E% SMI"
44 * COPYRIGHT NOTICE
46 * This software is copyright(C) 1982 by Pavel Curtis
48 * Permission is granted to reproduce and distribute
49 * this file by any means so long as no fee is charged
50 * above a nominal handling fee and so long as this
51 * notice is always included in the copies.
53 * Other rights are reserved except as explicitly granted
54 * by written permission of the author.
55 * Pavel Curtis
56 * Computer Science Dept.
57 * 405 Upson Hall
58 * Cornell University
59 * Ithaca, NY 14853
61 * Ph- (607) 256-4934
63 * Pavel.Cornell@Udel-Relay(ARPAnet)
64 * decvax!cornell!pavel(UUCPnet)
68 * tic_error.c -- Error message routines
70 * $Log: RCS/tic_error.v $
71 * Revision 2.1 82/10/25 14:45:31 pavel
72 * Added Copyright Notice
74 * Revision 2.0 82/10/24 15:16:32 pavel
75 * Beta-one Test Release
77 * Revision 1.3 82/08/23 22:29:31 pavel
78 * The REAL Alpha-one Release Version
80 * Revision 1.2 82/08/19 19:09:44 pavel
81 * Alpha Test Release One
83 * Revision 1.1 82/08/12 18:36:02 pavel
84 * Initial revision
89 #include <unistd.h>
90 #include <stdarg.h>
91 #include <stdlib.h>
93 #include "compiler.h"
95 extern char *string_table;
96 extern short term_names;
97 extern char *progname;
99 /* VARARGS1 */
100 void
101 warning(char *fmt, ...)
103 va_list args;
105 va_start(args, fmt);
106 fprintf(stderr, "%s: Warning: near line %d: ", progname, curr_line);
107 if (string_table != NULL) {
108 fprintf(stderr, "terminal '%s', ", string_table+term_names);
110 vfprintf(stderr, fmt, args);
111 fprintf(stderr, "\n");
112 va_end(args);
116 /* VARARGS1 */
117 void
118 err_abort(char *fmt, ...)
120 va_list args;
122 va_start(args, fmt);
123 fprintf(stderr, "%s: Line %d: ", progname, curr_line);
124 if (string_table != NULL) {
125 fprintf(stderr, "terminal '%s', ", string_table+term_names);
127 vfprintf(stderr, fmt, args);
128 fprintf(stderr, "\n");
129 va_end(args);
130 exit(1);
134 /* VARARGS1 */
135 void
136 syserr_abort(char *fmt, ...)
138 va_list args;
140 va_start(args, fmt);
141 fprintf(stderr, "PROGRAM ERROR: Line %d: ", curr_line);
142 if (string_table != NULL) {
143 fprintf(stderr, "terminal '%s', ", string_table+term_names);
145 vfprintf(stderr, fmt, args);
146 fprintf(stderr, "\n");
147 fprintf(stderr, "*** Possibly corrupted terminfo file ***\n");
148 va_end(args);
149 exit(1);