'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved. .\" 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. .\" 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. .\" 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] .TH BTOHEX 3TSOL "Jul 20, 2007" .SH NAME btohex, bsltoh, bcleartoh, bsltoh_r, bcleartoh_r, h_alloc, h_free \- convert binary label to hexadecimal .SH SYNOPSIS .LP .nf \fBcc\fR [\fIflag\fR...] \fIfile\fR... \fB-ltsol\fR [\fIlibrary\fR...] .fi .LP .nf #include \fBchar *\fR\fBbsltoh\fR(\fBconst m_label_t *\fR\fIlabel\fR); .fi .LP .nf \fBchar *\fR\fBbcleartoh\fR(\fBconst m_label_t *\fR\fIclearance\fR); .fi .LP .nf \fBchar *\fR\fBbsltoh_r\fR(\fBconst m_label_t *\fR\fIlabel\fR, char *\fIhex\fR); .fi .LP .nf \fBchar *\fR\fBbcleartoh_r\fR(\fBconst m_label_t *\fR\fIclearance\fR, char *\fIhex\fR); .fi .LP .nf \fBchar *\fR\fBh_alloc\fR(\fBconst unsigned char\fR \fItype\fR); .fi .LP .nf \fBvoid\fR \fBh_free\fR(\fBchar *\fR\fIhex\fR); .fi .SH DESCRIPTION .sp .LP These functions convert binary labels into hexadecimal strings that represent the internal value. .sp .LP The \fBbsltoh()\fR and \fBbsltoh_r()\fR functions convert a binary sensitivity label into a string of the form: .sp .in +2 .nf [0x\fIsensitivity_label_hexadecimal_value\fR] .fi .in -2 .sp .sp .LP The \fBbcleartoh()\fR and \fBbcleartoh_r()\fR functions convert a binary clearance into a string of the form: .sp .in +2 .nf 0x\fIclearance_hexadecimal_value\fR .fi .in -2 .sp .sp .LP The \fBh_alloc()\fR function allocates memory for the hexadecimal value \fItype\fR for use by \fBbsltoh_r()\fR and \fBbcleartoh_r()\fR. .sp .LP Valid values for \fItype\fR are: .sp .ne 2 .na \fB\fBSUN_SL_ID\fR\fR .ad .RS 14n \fIlabel\fR is a binary sensitivity label. .RE .sp .ne 2 .na \fB\fBSUN_CLR_ID\fR\fR .ad .RS 14n \fIlabel\fR is a binary clearance. .RE .sp .LP The \fBh_free()\fR function frees memory allocated by \fBh_alloc()\fR. .SH RETURN VALUES .sp .LP These functions return a pointer to a string that contains the result of the translation, or \fB(char *)0\fR if the parameter is not of the required type. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS box; c | c l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Obsolete _ MT-Level MT-Safe with exceptions .TE .sp .LP The \fBbsltoh()\fR, \fBbcleartoh()\fR, \fBbsltoh_r()\fR, \fBbcleartoh_r()\fR, \fBh_alloc()\fR, and \fBh_free()\fR functions are Obsolete. Use the \fBlabel_to_str\fR(3TSOL) function instead. .sp .LP The \fBbsltoh()\fR and \fBbcleartoh()\fR functions share the same statically allocated string storage. They are not MT-Safe. Subsequent calls to any of these functions will overwrite that string with the newly translated string. The \fBbsltoh_r()\fR and \fBbcleartoh_r()\fR functions should be used in multithreaded applications. .SH SEE ALSO .sp .LP \fBatohexlabel\fR(1M), \fBhextoalabel\fR(1M),\fBlabel_to_str\fR(3TSOL), \fBlibtsol\fR(3LIB), \fBattributes\fR(5), \fBlabels\fR(5) .SH NOTES .sp .LP The functionality described on this manual page is available only if the system is configured with Trusted Extensions.