8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / lp / include / oam.h
blob52176315b6e3988cbc3f4f810c3f716727df0c24
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 1999 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
31 #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.9 */
34 #if !defined(_LP_OAM_H)
35 # define _LP_OAM_H
37 * Change the following lines to include the appropriate
38 * standard header file when it becomes available.
39 * Or change all the LP source to include it directly,
40 * and get rid of the following stuff (up to the ====...==== line).
43 char *agettxt(long msg_id, char *buf, int buflen);
45 void fmtmsg(char * label, int severity, char * text, char * action);
48 * Possible values of "severity":
50 #define MIN_SEVERITY 0
51 #define HALT 0
52 #define ERROR 1
53 #define WARNING 2
54 #define INFO 3
55 #define MAX_SEVERITY 3
57 /**======================================================================
59 ** LP Spooler specific error message handling.
60 **/
62 #define MSGSIZ 512
64 #if defined(WHO_AM_I)
66 #include "oam_def.h"
68 #if WHO_AM_I == I_AM_CANCEL
69 static char *who_am_i = "UX:cancel";
71 #elif WHO_AM_I == I_AM_COMB
72 static char *who_am_i = "UX:comb ";
73 /* changed inside pgm */
75 #elif WHO_AM_I == I_AM_LPMOVE
76 static char *who_am_i = "UX:lpmove";
78 #elif WHO_AM_I == I_AM_LPUSERS
79 static char *who_am_i = "UX:lpusers";
81 #elif WHO_AM_I == I_AM_LPNETWORK
82 static char *who_am_i = "UX:lpnetwork";
84 #elif WHO_AM_I == I_AM_LP
85 static char *who_am_i = "UX:lp";
87 #elif WHO_AM_I == I_AM_LPADMIN
88 static char *who_am_i = "UX:lpadmin";
90 #elif WHO_AM_I == I_AM_LPFILTER
91 static char *who_am_i = "UX:lpfilter";
93 #elif WHO_AM_I == I_AM_LPFORMS
94 static char *who_am_i = "UX:lpforms";
96 #elif WHO_AM_I == I_AM_LPPRIVATE
97 static char *who_am_i = "UX:lpprivate";
99 #elif WHO_AM_I == I_AM_LPSCHED
100 static char *who_am_i = "UX:lpsched";
102 #elif WHO_AM_I == I_AM_LPSHUT
103 static char *who_am_i = "UX:lpshut";
105 #elif WHO_AM_I == I_AM_LPSTAT
106 static char *who_am_i = "UX:lpstat";
108 #elif WHO_AM_I == I_AM_LPSYSTEM
109 static char *who_am_i = "UX:lpsystem";
111 #else
112 static char *who_am_i = "UX:mysterious";
114 #endif
117 * Simpler interfaces to the "fmtmsg()" and "agettxt()" stuff.
120 #if defined(lint)
122 #define LP_ERRMSG(C,X) (void)printf("", C, X)
123 #define LP_ERRMSG1(C,X,A) (void)printf("", C, X, A)
124 #define LP_ERRMSG2(C,X,A1,A2) (void)printf("", C, X, A1, A2)
125 #define LP_ERRMSG3(C,X,A1,A2,A3) (void)printf("", C, X, A1, A2, A3)
127 #else
129 #define LP_ERRMSG(C,X) \
130 fmtmsg ( \
131 who_am_i, \
132 C, \
133 agettxt((X), _m_, MSGSIZ), \
134 agettxt((X+1), _a_, MSGSIZ) \
136 #define LP_ERRMSG1(C,X,A) \
137 fmtmsg ( \
138 who_am_i, \
139 C, \
140 fmt1((X), A), \
141 agettxt((X+1), _a_, MSGSIZ) \
143 #define LP_ERRMSG2(C,X,A1,A2) \
144 fmtmsg ( \
145 who_am_i, \
146 C, \
147 fmt2((X), A1, A2), \
148 agettxt((X+1), _a_, MSGSIZ) \
150 #define LP_ERRMSG3(C,X,A1,A2,A3) \
151 fmtmsg ( \
152 who_am_i, \
153 C, \
154 fmt3((X), A1, A2, A3), \
155 agettxt((X+1), _a_, MSGSIZ) \
159 #define vsnp (void)snprintf
161 #define fmt1(X,A) (vsnp(_m_, MSGSIZ, agettxt((X),_f_,MSGSIZ), A), _m_)
162 #define fmt2(X,A,B) (vsnp(_m_, MSGSIZ, agettxt((X),_f_,MSGSIZ), A,B), _m_)
163 #define fmt3(X,A,B,C) (vsnp(_m_, MSGSIZ, agettxt((X),_f_,MSGSIZ), A,B,C), _m_)
165 #endif /* lint */
167 extern char _m_[],
168 _a_[],
169 _f_[],
170 *_t_;
172 #endif /* WHO_AM_I */
174 #endif