xref: /titanic_50/usr/src/lib/print/libpapi-common/common/status.c (revision b494511a9cf72b1fc4eb13a0e593f55c624ab829)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  *
26  */
27 
28 /* $Id: status.c 146 2006-03-24 00:26:54Z njacobs $ */
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <stdlib.h>
33 #include <papi.h>
34 #include <libintl.h>
35 
36 char *
37 papiStatusString(const papi_status_t status)
38 {
39 	switch (status) {
40 	case PAPI_OK:
41 		return (gettext("ok"));
42 	case PAPI_OK_SUBST:
43 		return (gettext("ok-substitution"));
44 	case PAPI_OK_CONFLICT:
45 		return (gettext("ok-conflict"));
46 	case PAPI_OK_IGNORED_SUBSCRIPTIONS:
47 		return (gettext("ok-ignored-subscriptions"));
48 	case PAPI_OK_IGNORED_NOTIFICATIONS:
49 		return (gettext("ok-ignored-notifications"));
50 	case PAPI_OK_TOO_MANY_EVENTS:
51 		return (gettext("ok-too-many-events"));
52 	case PAPI_OK_BUT_CANCEL_SUBSCRIPTION:
53 		return (gettext("ok-but-cancel-subscription"));
54 	case PAPI_REDIRECTION_OTHER_SITE:
55 		return (gettext("redirection-to-other-site"));
56 	case PAPI_BAD_REQUEST:
57 		return (gettext("bad-request"));
58 	case PAPI_FORBIDDEN:
59 		return (gettext("forbidden"));
60 	case PAPI_NOT_AUTHENTICATED:
61 		return (gettext("not-authenticated"));
62 	case PAPI_NOT_AUTHORIZED:
63 		return (gettext("not-authorized"));
64 	case PAPI_NOT_POSSIBLE:
65 		return (gettext("not-possible"));
66 	case PAPI_TIMEOUT:
67 		return (gettext("timeout"));
68 	case PAPI_NOT_FOUND:
69 		return (gettext("not-found"));
70 	case PAPI_GONE:
71 		return (gettext("gone"));
72 	case PAPI_REQUEST_ENTITY:
73 		return (gettext("request-entity"));
74 	case PAPI_REQUEST_VALUE:
75 		return (gettext("request-value"));
76 	case PAPI_DOCUMENT_FORMAT:
77 		return (gettext("document-format"));
78 	case PAPI_ATTRIBUTES:
79 		return (gettext("attributes"));
80 	case PAPI_URI_SCHEME:
81 		return (gettext("uri-scheme"));
82 	case PAPI_CHARSET:
83 		return (gettext("charset"));
84 	case PAPI_CONFLICT:
85 		return (gettext("conflict"));
86 	case PAPI_COMPRESSION_NOT_SUPPORTED:
87 		return (gettext("compression-not-supported"));
88 	case PAPI_COMPRESSION_ERROR:
89 		return (gettext("compression-error"));
90 	case PAPI_DOCUMENT_FORMAT_ERROR:
91 		return (gettext("document-format-error"));
92 	case PAPI_DOCUMENT_ACCESS_ERROR:
93 		return (gettext("document-access-error"));
94 	case PAPI_ATTRIBUTES_NOT_SETTABLE:
95 		return (gettext("attributes-not-settable"));
96 	case PAPI_IGNORED_ALL_SUBSCRIPTIONS:
97 		return (gettext("ignored-all-subscriptions"));
98 	case PAPI_TOO_MANY_SUBSCRIPTIONS:
99 		return (gettext("too-many-subscriptions"));
100 	case PAPI_IGNORED_ALL_NOTIFICATIONS:
101 		return (gettext("ignored-all-notifications"));
102 	case PAPI_PRINT_SUPPORT_FILE_NOT_FOUND:
103 		return (gettext("print-support-file-not-found"));
104 	case PAPI_INTERNAL_ERROR:
105 		return (gettext("internal-error"));
106 	case PAPI_OPERATION_NOT_SUPPORTED:
107 		return (gettext("operation-not-supported"));
108 	case PAPI_SERVICE_UNAVAILABLE:
109 		return (gettext("service-unavailable"));
110 	case PAPI_VERSION_NOT_SUPPORTED:
111 		return (gettext("version-not-supported"));
112 	case PAPI_DEVICE_ERROR:
113 		return (gettext("device-error"));
114 	case PAPI_TEMPORARY_ERROR:
115 		return (gettext("temporary-error"));
116 	case PAPI_NOT_ACCEPTING:
117 		return (gettext("not-accepting"));
118 	case PAPI_PRINTER_BUSY:
119 		return (gettext("printer-busy"));
120 	case PAPI_ERROR_JOB_CANCELLED:
121 		return (gettext("error-job-cancelled"));
122 	case PAPI_MULTIPLE_JOBS_NOT_SUPPORTED:
123 		return (gettext("multiple-jobs-not-supported"));
124 	case PAPI_PRINTER_IS_DEACTIVATED:
125 		return (gettext("printer-is-deactivated"));
126 	case PAPI_BAD_ARGUMENT:
127 		return (gettext("bad-argument"));
128 	case PAPI_JOB_TICKET_NOT_SUPPORTED:
129 		return (gettext("job-ticket-not-supported"));
130 	default:
131 		return (gettext("unknown-error"));
132 	}
133 }
134