2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH LABEL_TO_STR 3TSOL "Jul 20, 2007"
8 label_to_str \- convert labels to human readable strings
12 \fBcc\fR [\fIflag\fR...] \fIfile\fR... \fB-ltsol\fR [\fIlibrary\fR...]
17 #include <tsol/label.h>
19 \fBint\fR \fBlabel_to_str\fR(\fBconst m_label_t *\fR\fIlabel\fR, \fBchar **\fR\fIstring\fR,
20 \fBconst m_label_str_t\fR \fIconversion_type\fR, \fBuint_t\fR \fIflags\fR);
26 \fBlabel_to_str()\fR is a simple function to convert various mandatory label
27 types to human readable strings.
30 \fIlabel\fR is the mandatory label to convert. \fIstring\fR points to memory
31 that is allocated by \fBlabel_to_str()\fR that contains the converted string.
32 The caller is responsible for calling \fBfree\fR(3C) to free allocated memory.
35 The calling process must have mandatory read access to the resulting human
36 readable string. Or the calling process must have the \fBsys_trans_label\fR
40 The \fIconversion_type\fR parameter controls the type of label conversion. Not
41 all types of conversion are valid for all types of label:
48 Converts \fIlabel\fR to a human readable string based on its type.
54 \fB\fBM_INTERNAL\fR\fR
57 Converts \fIlabel\fR to an internal text representation that is safe for
58 storing in a public object. Internal conversions can later be parsed to their
68 Converts \fIlabel\fR to a string that represents the color name that the
69 administrator has associated with the label.
75 \fB\fBPRINTER_TOP_BOTTOM\fR\fR
78 Converts \fIlabel\fR to a human readable string that is appropriate for use as
79 the top and bottom label of banner and trailer pages in the Defense
80 Intelligence Agency (DIA) encodings printed output schema.
86 \fB\fBPRINTER_LABEL\fR\fR
89 Converts \fIlabel\fR to a human readable string that is appropriate for use as
90 the banner page downgrade warning in the DIA encodings printed output schema.
96 \fB\fBPRINTER_CAVEATS\fR\fR
99 Converts \fIlabel\fR to a human readable string that is appropriate for use as
100 the banner page caveats section in the DIA encodings printed output schema.
106 \fB\fBPRINTER_CHANNELS\fR\fR
109 Converts \fIlabel\fR to a human readable string that is appropriate for use as
110 the banner page handling channels in the DIA encodings printed output schema.
115 The \fIflags\fR parameter provides a hint to the label conversion:
119 \fB\fBDEF_NAMES\fR\fR
122 The default names are preferred.
128 \fB\fBSHORT_NAMES\fR\fR
131 Short names are preferred where defined.
137 \fB\fBLONG_NAMES\fR\fR
140 Long names are preferred.
146 Upon successful completion, the \fBlabel_to_str()\fR function returns 0.
147 Otherwise, -1 is returned, \fIerrno\fR is set to indicate the error and the
148 string pointer is set to \fINULL\fR.
152 The \fBlabel_to_str()\fR function will fail if:
168 The system does not support label translations.
177 The physical limits of the system are exceeded by size bytes of memory which
184 See \fBattributes\fR(5) for descriptions of the following attributes:
192 ATTRIBUTE TYPE ATTRIBUTE VALUE
194 Interface Stability See below.
203 The \fBlabel_to_str()\fR function is Committed. The returned string is
204 Not-an-Interface and is dependent on the specific \fBlabel_encodings\fR file.
205 The conversion type \fBINTERNAL\fR is Uncommitted, but is always accepted as
206 input to \fBstr_to_label\fR(3TSOL).
209 Conversion types that are relative to the DIA encodings schema are Standard.
210 Standard is specified in \fBlabel_encodings\fR(4).
214 \fBfree\fR(3C), \fBlibtsol\fR(3LIB), \fBstr_to_label\fR(3TSOL),
215 \fBlabel_encodings\fR(4), \fBattributes\fR(5), \fBlabels\fR(5)
218 \fIUsing the label_to_str Function\fR in \fISolaris Trusted Extensions
219 Developer\&'s Guide\fR
223 A number of these conversions rely on the DIA label encodings schema. They
224 might not be valid for other label schemata.
228 The functionality described on this manual page is available only if the system
229 is configured with Trusted Extensions.