Merge branch 'less_closed'
[unleashed.git] / usr / src / man / man3tsol / btohex.3tsol
blobe343f59027502fbfc0a90b29efc6dae2663647b4
1 '\" te
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"
7 .SH NAME
8 btohex, bsltoh, bcleartoh, bsltoh_r, bcleartoh_r, h_alloc, h_free \- convert
9 binary label to hexadecimal
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBcc\fR [\fIflag\fR...] \fIfile\fR... \fB-ltsol\fR [\fIlibrary\fR...]
14 .fi
16 .LP
17 .nf
18 #include <tsol/label.h>
20 \fBchar *\fR\fBbsltoh\fR(\fBconst m_label_t *\fR\fIlabel\fR);
21 .fi
23 .LP
24 .nf
25 \fBchar *\fR\fBbcleartoh\fR(\fBconst m_label_t *\fR\fIclearance\fR);
26 .fi
28 .LP
29 .nf
30 \fBchar *\fR\fBbsltoh_r\fR(\fBconst m_label_t *\fR\fIlabel\fR, char *\fIhex\fR);
31 .fi
33 .LP
34 .nf
35 \fBchar *\fR\fBbcleartoh_r\fR(\fBconst m_label_t *\fR\fIclearance\fR, char *\fIhex\fR);
36 .fi
38 .LP
39 .nf
40 \fBchar *\fR\fBh_alloc\fR(\fBconst unsigned char\fR \fItype\fR);
41 .fi
43 .LP
44 .nf
45 \fBvoid\fR \fBh_free\fR(\fBchar *\fR\fIhex\fR);
46 .fi
48 .SH DESCRIPTION
49 .sp
50 .LP
51 These functions convert binary labels into hexadecimal strings that represent
52 the internal value.
53 .sp
54 .LP
55 The \fBbsltoh()\fR and \fBbsltoh_r()\fR functions convert a binary sensitivity
56 label into a string of the form:
57 .sp
58 .in +2
59 .nf
60 [0x\fIsensitivity_label_hexadecimal_value\fR]
61 .fi
62 .in -2
63 .sp
65 .sp
66 .LP
67 The \fBbcleartoh()\fR and \fBbcleartoh_r()\fR functions convert a binary
68 clearance into a string of the form:
69 .sp
70 .in +2
71 .nf
72 0x\fIclearance_hexadecimal_value\fR
73 .fi
74 .in -2
75 .sp
77 .sp
78 .LP
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.
81 .sp
82 .LP
83 Valid values for \fItype\fR are:
84 .sp
85 .ne 2
86 .na
87 \fB\fBSUN_SL_ID\fR\fR
88 .ad
89 .RS 14n
90 \fIlabel\fR is a binary sensitivity label.
91 .RE
93 .sp
94 .ne 2
95 .na
96 \fB\fBSUN_CLR_ID\fR\fR
97 .ad
98 .RS 14n
99 \fIlabel\fR is a binary clearance.
104 The \fBh_free()\fR function frees memory allocated by \fBh_alloc()\fR.
105 .SH RETURN VALUES
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.
110 .SH ATTRIBUTES
113 See \fBattributes\fR(5) for descriptions of the following attributes:
118 box;
119 c | c
120 l | l .
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.
140 .SH SEE ALSO
143 \fBatohexlabel\fR(1M), \fBhextoalabel\fR(1M),\fBlabel_to_str\fR(3TSOL),
144 \fBlibtsol\fR(3LIB), \fBattributes\fR(5), \fBlabels\fR(5)
145 .SH NOTES
148 The functionality described on this manual page is available only if the system
149 is configured with Trusted Extensions.