6198 Let's EOL cachefs
[illumos-gate.git] / usr / src / man / man3ldap / ldap_charset.3ldap
blob171e33065849e9aed29ea1e205b243cc77c40b2f
1 '\" te
2 .\" Copyright (C) 1990, Regents of the University of Michigan.  All Rights Reserved.
3 .\" Portions Copyright (C) 2002, Sun Microsystems, Inc. All Rights Reserved.
4 .\" 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.
5 .\" 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.
6 .\" 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]
7 .TH LDAP_CHARSET 3LDAP "Jan 27, 2002"
8 .SH NAME
9 ldap_charset, ldap_set_string_translators, ldap_t61_to_8859, ldap_8859_to_t61,
10 ldap_translate_from_t61, ldap_translate_to_t61, ldap_enable_translation \- LDAP
11 character set translation functions
12 .SH SYNOPSIS
13 .LP
14 .nf
15 cc[ \fIflag\fR... ] \fIfile\fR... -lldap[ \fIlibrary\fR... ]
16 #include <lber.h>
17 #include <ldap.h>
19 \fBvoid\fR \fBldap_set_string_translators\fR(\fBLDAP\fR \fI*ld\fR,
20      \fBBERTranslateProc\fR \fIencode_proc\fR, \fBBERTranslateProc\fR \fIdecodeproc\fR);
21 .fi
23 .LP
24 .nf
25 \fBtypedef\fR \fBint\fR(\fB*BERTranslateProc)(char\fR \fI**bufp\fR, \fBunsigned long\fR \fI*buflenp\fR,
26      \fBint\fR \fIfree_input\fR);
27 .fi
29 .LP
30 .nf
31 \fBint\fR \fBldap_t61_to_8859\fR(\fBchar\fR \fI**bufp\fR, \fBunsigned long\fR \fI*buflenp\fR,
32      \fBint\fR \fIfree_input\fR);
33 .fi
35 .LP
36 .nf
37 \fBint\fR \fBldap_8859_to_t61\fR(\fBchar\fR \fI**bufp\fR, \fBunsigned long\fR \fI*buflenp\fR,
38      \fBint\fR \fIfree_input\fR);
39 .fi
41 .LP
42 .nf
43 \fBint\fR \fBldap_translate_from_t61\fR(\fBLDAP\fR \fI*ld\fR, \fBchar\fR \fI**bufp\fR,
44      \fBunsigned long\fR \fI*lenp\fR, \fBint\fR \fIfree_input\fR);
45 .fi
47 .LP
48 .nf
49 \fBint\fR \fBldap_translate_to_t61\fR(\fBLDAP\fR \fI*ld\fR, \fBchar\fR \fI**bufp\fR, \fBunsigned long\fR \fI*lenp\fR,
50      \fBint\fR \fIfree_input\fR);
51 .fi
53 .LP
54 .nf
55 \fBvoid\fR \fBldap_enable_translation\fR(\fBLDAP\fR \fI*ld\fR, \fBLDAPMessage\fR \fI*entry\fR, \fBint\fR \fIenable\fR);
56 .fi
58 .SH DESCRIPTION
59 .sp
60 .LP
61 These functions are used to used to enable translation  of character strings
62 used in the LDAP library to and from  the T.61 character set used in the LDAP
63 protocol.  These  functions are only available if the LDAP and LBER libraries
64 are compiled with  \fBSTR_TRANSLATION\fR defined. It is also  possible to turn
65 on character translation by default so that all LDAP library callers will
66 experience translation; see the LDAP Make-common source file for details.
67 .sp
68 .LP
69 \fBldap_set_string_translators()\fR sets the translation functions that will be
70 used by the LDAP library.  They are not actually used until the
71 \fIld_lberoptions\fR field of the LDAP structure is set to include the
72 \fBLBER_TRANSLATE_STRINGS\fR option.
73 .sp
74 .LP
75 \fBldap_t61_to_8859()\fR and \fBldap_8859_to_t61()\fR are translation functions
76 for converting between T.61 characters and ISO-8859 characters.  The specific
77 8859 character set used is determined at compile time.
78 .sp
79 .LP
80 \fBldap_translate_from_t61()\fR is used to translate a string of characters
81 from the T.61 character set to a different character set.  The actual
82 translation is done using the \fIdecode_proc\fR that was passed to a previous
83 call to \fBldap_set_string_translators()\fR. On entry, \fI*bufp\fR should point
84 to the start of the T.61 characters to be translated and \fI*lenp\fR should
85 contain the number of bytes to translate.  If \fIfree_input\fR is non-zero, the
86 input buffer will be freed if translation is a success.  If the translation is
87 a success, \fBLDAP_SUCCESS\fR will be returned, \fI*bufp\fR will point to a
88 newly malloc'd buffer that contains the translated characters, and \fI*lenp\fR
89 will contain the length of the result. If translation fails, an LDAP error code
90 will be returned.
91 .sp
92 .LP
93 \fBldap_translate_to_t61()\fR is used to translate a string of characters to
94 the T.61 character set from a different character set.  The actual translation
95 is done using the \fIencode_proc\fR that was passed to a previous call to
96 \fBldap_set_string_translators()\fR. This function is called just like
97 \fBldap_translate_from_t61()\fR.
98 .sp
99 .LP
100 \fBldap_enable_translation()\fR is used to turn on or off string translation
101 for the LDAP entry \fIentry\fR (typically obtained by calling
102 \fBldap_first_entry()\fR or \fBldap_next_entry()\fR after a successful LDAP
103 search operation). If \fBenable\fR is zero, translation is disabled; if
104 non-zero, translation is enabled.  This function is useful if you need to
105 ensure that a particular attribute is not translated when it is extracted using
106 \fBldap_get_values()\fR or \fBldap_get_values_len()\fR. For example, you would
107 not want to translate a binary attributes such as \fBjpegPhoto\fR.
108 .SH ATTRIBUTES
111 See \fBattributes\fR(5) for a description of the following attributes:
116 box;
117 c | c
118 l | l .
119 ATTRIBUTE TYPE  ATTRIBUTE VALUE
120 Interface Stability     Evolving
123 .SH SEE ALSO
126 \fBldap\fR(3LDAP), \fBattributes\fR(5)