1 .TH LDAP_FRIENDLY 3 "22 September 1998" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2000 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap_friendly_name, ldap_free_friendlymap \- LDAP unfriendly to friendly name mapping routine
13 typedef struct ldap_friendly {
19 char *ldap_friendly_name(filename, name, map)
23 LDAPFriendlyMap **map;
26 void ldap_free_friendlymap(map)
28 LDAPFriendlyMap **map;
30 This routine is used to map one set of strings to another. Typically,
31 this is done for country names, to map from the two-letter country
32 codes to longer more readable names. The mechanism is general enough
33 to be used with other things, though.
35 \fIfilename\fP is the name of a file containing the unfriendly to
36 friendly mapping, \fIname\fP is the unfriendly name to map to a friendly
37 name, and \fImap\fP is a result-parameter that should be set to NULL
38 on the first call. It is then used to hold the mapping in core so that
39 the file need not be read on subsequent calls.
45 LDAPFriendlyMap *map = NULL;
47 printf( "unfriendly %s => friendly %s\\n", name,
48 ldap_friendly_name( "DATADIR/ldapfriendly", name, &map ) );
52 The mapping file should contain lines like this: unfriendlyname\\tfriendlyname.
53 Lines that begin with a '#' character are comments and are ignored.
56 .B ldap_free_friendlymap()
57 call is used to free structures allocated by
58 .B ldap_friendly_name()
60 .B ldap_friendly_name()
64 .B ldap_friendly_name()
65 if there is an error opening \fIfilename\fP, or if the file has a bad
66 format, or if the \fImap\fP parameter is NULL.
68 DATADIR/ldapfriendly.conf
73 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
75 is derived from University of Michigan LDAP 3.3 Release.