1 .TH LDAP_FRIENDLY 3 "22 September 1998" "OpenLDAP LDVERSION"
3 ldap_friendly_name, ldap_free_friendlymap \- LDAP unfriendly to friendly name mapping routine
11 typedef struct ldap_friendly {
17 char *ldap_friendly_name(filename, name, map)
21 LDAPFriendlyMap **map;
24 void ldap_free_friendlymap(map)
26 LDAPFriendlyMap **map;
28 This routine is used to map one set of strings to another. Typically,
29 this is done for country names, to map from the two-letter country
30 codes to longer more readable names. The mechanism is general enough
31 to be used with other things, though.
33 \fIfilename\fP is the name of a file containing the unfriendly to
34 friendly mapping, \fIname\fP is the unfriendly name to map to a friendly
35 name, and \fImap\fP is a result-parameter that should be set to NULL
36 on the first call. It is then used to hold the mapping in core so that
37 the file need not be read on subsequent calls.
43 LDAPFriendlyMap *map = NULL;
45 printf( "unfriendly %s => friendly %s\\n", name,
46 ldap_friendly_name( "DATADIR/ldapfriendly", name, &map ) );
50 The mapping file should contain lines like this: unfriendlyname\\tfriendlyname.
51 Lines that begin with a '#' character are comments and are ignored.
54 .B ldap_free_friendlymap()
55 call is used to free structures allocated by
56 .B ldap_friendly_name()
58 .B ldap_friendly_name()
62 .B ldap_friendly_name()
63 if there is an error opening \fIfilename\fP, or if the file has a bad
64 format, or if the \fImap\fP parameter is NULL.
66 DATADIR/ldapfriendly.conf
71 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
73 is derived from University of Michigan LDAP 3.3 Release.