xref: /illumos-gate/usr/src/lib/print/libpapi-common/common/status.c (revision 86d949f9497332fe19be6b5d711d265eb957439f)
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 #include <stdlib.h>
31 #include <papi.h>
32 #include <libintl.h>
33 
34 char *
35 papiStatusString(const papi_status_t status)
36 {
37 	switch (status) {
38 	case PAPI_OK:
39 		return (gettext("ok"));
40 	case PAPI_OK_SUBST:
41 		return (gettext("ok-substitution"));
42 	case PAPI_OK_CONFLICT:
43 		return (gettext("ok-conflict"));
44 	case PAPI_OK_IGNORED_SUBSCRIPTIONS:
45 		return (gettext("ok-ignored-subscriptions"));
46 	case PAPI_OK_IGNORED_NOTIFICATIONS:
47 		return (gettext("ok-ignored-notifications"));
48 	case PAPI_OK_TOO_MANY_EVENTS:
49 		return (gettext("ok-too-many-events"));
50 	case PAPI_OK_BUT_CANCEL_SUBSCRIPTION:
51 		return (gettext("ok-but-cancel-subscription"));
52 	case PAPI_REDIRECTION_OTHER_SITE:
53 		return (gettext("redirection-to-other-site"));
54 	case PAPI_BAD_REQUEST:
55 		return (gettext("bad-request"));
56 	case PAPI_FORBIDDEN:
57 		return (gettext("forbidden"));
58 	case PAPI_NOT_AUTHENTICATED:
59 		return (gettext("not-authenticated"));
60 	case PAPI_NOT_AUTHORIZED:
61 		return (gettext("not-authorized"));
62 	case PAPI_NOT_POSSIBLE:
63 		return (gettext("not-possible"));
64 	case PAPI_TIMEOUT:
65 		return (gettext("timeout"));
66 	case PAPI_NOT_FOUND:
67 		return (gettext("not-found"));
68 	case PAPI_GONE:
69 		return (gettext("gone"));
70 	case PAPI_REQUEST_ENTITY:
71 		return (gettext("request-entity"));
72 	case PAPI_REQUEST_VALUE:
73 		return (gettext("request-value"));
74 	case PAPI_DOCUMENT_FORMAT:
75 		return (gettext("document-format"));
76 	case PAPI_ATTRIBUTES:
77 		return (gettext("attributes"));
78 	case PAPI_URI_SCHEME:
79 		return (gettext("uri-scheme"));
80 	case PAPI_CHARSET:
81 		return (gettext("charset"));
82 	case PAPI_CONFLICT:
83 		return (gettext("conflict"));
84 	case PAPI_COMPRESSION_NOT_SUPPORTED:
85 		return (gettext("compression-not-supported"));
86 	case PAPI_COMPRESSION_ERROR:
87 		return (gettext("compression-error"));
88 	case PAPI_DOCUMENT_FORMAT_ERROR:
89 		return (gettext("document-format-error"));
90 	case PAPI_DOCUMENT_ACCESS_ERROR:
91 		return (gettext("document-access-error"));
92 	case PAPI_ATTRIBUTES_NOT_SETTABLE:
93 		return (gettext("attributes-not-settable"));
94 	case PAPI_IGNORED_ALL_SUBSCRIPTIONS:
95 		return (gettext("ignored-all-subscriptions"));
96 	case PAPI_TOO_MANY_SUBSCRIPTIONS:
97 		return (gettext("too-many-subscriptions"));
98 	case PAPI_IGNORED_ALL_NOTIFICATIONS:
99 		return (gettext("ignored-all-notifications"));
100 	case PAPI_PRINT_SUPPORT_FILE_NOT_FOUND:
101 		return (gettext("print-support-file-not-found"));
102 	case PAPI_INTERNAL_ERROR:
103 		return (gettext("internal-error"));
104 	case PAPI_OPERATION_NOT_SUPPORTED:
105 		return (gettext("operation-not-supported"));
106 	case PAPI_SERVICE_UNAVAILABLE:
107 		return (gettext("service-unavailable"));
108 	case PAPI_VERSION_NOT_SUPPORTED:
109 		return (gettext("version-not-supported"));
110 	case PAPI_DEVICE_ERROR:
111 		return (gettext("device-error"));
112 	case PAPI_TEMPORARY_ERROR:
113 		return (gettext("temporary-error"));
114 	case PAPI_NOT_ACCEPTING:
115 		return (gettext("not-accepting"));
116 	case PAPI_PRINTER_BUSY:
117 		return (gettext("printer-busy"));
118 	case PAPI_ERROR_JOB_CANCELLED:
119 		return (gettext("error-job-cancelled"));
120 	case PAPI_MULTIPLE_JOBS_NOT_SUPPORTED:
121 		return (gettext("multiple-jobs-not-supported"));
122 	case PAPI_PRINTER_IS_DEACTIVATED:
123 		return (gettext("printer-is-deactivated"));
124 	case PAPI_BAD_ARGUMENT:
125 		return (gettext("bad-argument"));
126 	case PAPI_JOB_TICKET_NOT_SUPPORTED:
127 		return (gettext("job-ticket-not-supported"));
128 	default:
129 		return (gettext("unknown-error"));
130 	}
131 }
132