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 BTOHEX 3TSOL "Jul 20, 2007"
8 btohex, bsltoh, bcleartoh, bsltoh_r, bcleartoh_r, h_alloc, h_free \- convert
9 binary label to hexadecimal
13 \fBcc\fR [\fIflag\fR...] \fIfile\fR... \fB-ltsol\fR [\fIlibrary\fR...]
18 #include <tsol/label.h>
20 \fBchar *\fR\fBbsltoh\fR(\fBconst m_label_t *\fR\fIlabel\fR);
25 \fBchar *\fR\fBbcleartoh\fR(\fBconst m_label_t *\fR\fIclearance\fR);
30 \fBchar *\fR\fBbsltoh_r\fR(\fBconst m_label_t *\fR\fIlabel\fR, char *\fIhex\fR);
35 \fBchar *\fR\fBbcleartoh_r\fR(\fBconst m_label_t *\fR\fIclearance\fR, char *\fIhex\fR);
40 \fBchar *\fR\fBh_alloc\fR(\fBconst unsigned char\fR \fItype\fR);
45 \fBvoid\fR \fBh_free\fR(\fBchar *\fR\fIhex\fR);
51 These functions convert binary labels into hexadecimal strings that represent
55 The \fBbsltoh()\fR and \fBbsltoh_r()\fR functions convert a binary sensitivity
56 label into a string of the form:
60 [0x\fIsensitivity_label_hexadecimal_value\fR]
67 The \fBbcleartoh()\fR and \fBbcleartoh_r()\fR functions convert a binary
68 clearance into a string of the form:
72 0x\fIclearance_hexadecimal_value\fR
79 The \fBh_alloc()\fR function allocates memory for the hexadecimal value
80 \fItype\fR for use by \fBbsltoh_r()\fR and \fBbcleartoh_r()\fR.
83 Valid values for \fItype\fR are:
90 \fIlabel\fR is a binary sensitivity label.
96 \fB\fBSUN_CLR_ID\fR\fR
99 \fIlabel\fR is a binary clearance.
104 The \fBh_free()\fR function frees memory allocated by \fBh_alloc()\fR.
108 These functions return a pointer to a string that contains the result of the
109 translation, or \fB(char *)0\fR if the parameter is not of the required type.
113 See \fBattributes\fR(5) for descriptions of the following attributes:
121 ATTRIBUTE TYPE ATTRIBUTE VALUE
123 Interface Stability Obsolete
125 MT-Level MT-Safe with exceptions
130 The \fBbsltoh()\fR, \fBbcleartoh()\fR, \fBbsltoh_r()\fR, \fBbcleartoh_r()\fR,
131 \fBh_alloc()\fR, and \fBh_free()\fR functions are Obsolete. Use the
132 \fBlabel_to_str\fR(3TSOL) function instead.
135 The \fBbsltoh()\fR and \fBbcleartoh()\fR functions share the same statically
136 allocated string storage. They are not MT-Safe. Subsequent calls to any of
137 these functions will overwrite that string with the newly translated string.
138 The \fBbsltoh_r()\fR and \fBbcleartoh_r()\fR functions should be used in
139 multithreaded applications.
143 \fBatohexlabel\fR(1M), \fBhextoalabel\fR(1M),\fBlabel_to_str\fR(3TSOL),
144 \fBlibtsol\fR(3LIB), \fBattributes\fR(5), \fBlabels\fR(5)
148 The functionality described on this manual page is available only if the system
149 is configured with Trusted Extensions.