1ldap_friendly(3LDAP)        LDAP Library Functions        ldap_friendly(3LDAP)
2
3
4

NAME

6       ldap_friendly,   ldap_friendly_name,   ldap_free_friendlymap   -   LDAP
7       attribute  remapping functions
8

SYNOPSIS

10       cc[ flag... ] file... -lldap[ library... ]
11       #include <lber.h>
12       #include <ldap.h>
13
14       char *ldap_friendly_name(char *filename, char *name,
15            FriendlyMap **map);
16
17
18       void ldap_free_friendlymap(FriendlyMap **map);
19
20

DESCRIPTION

22       This function is used to map one set of strings to another.  Typically,
23       this  is  done  for  country  names, to map from the two-letter country
24       codes to longer more readable names.  The mechanism is  general  enough
25       to be used with other things, though.
26
27
28       filename  is  the  name of a file containing the unfriendly to friendly
29       mapping, name is the unfriendly name to map to a friendly name, and map
30       is  a result-parameter that should be set to NULL on the first call. It
31       is then used to hold the mapping in core so that the file need  not  be
32       read on subsequent calls.
33
34
35       For example:
36
37                 FriendlyMap *map = NULL;
38                 printf( "unfriendly %s => friendly %s\n", name,
39                     ldap_friendly_name( "ETCDIR/ldapfriendly", name, &map ) );
40
41
42
43       The   mapping   file   should  contain  lines  like  this:  unfriendly‐
44       name\tfriendlyname. Lines that begin with a '#' character are  comments
45       and are ignored.
46
47
48       The  ldap_free_friendlymap()  call is used to free structures allocated
49       by ldap_friendly_name() when no more calls to ldap_friendly_name()  are
50       to be made.
51

ERRORS

53       NULL  is  returned by ldap_friendly_name() if there is an error opening
54       filename, or if the file has a bad format, or if the map  parameter  is
55       NULL.
56

FILES

58       ETCDIR/ldapfriendly.conf
59

ATTRIBUTES

61       See attributes(5) for a description of the following attributes:
62
63
64
65
66       ┌─────────────────────────────┬─────────────────────────────┐
67       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
68       │Availability                 │SUNWcsl (32-bit)             │
69       │                             │SUNWcslx (64-bit)            │
70       │Interface Stability          │Evolving                     │
71       └─────────────────────────────┴─────────────────────────────┘
72

SEE ALSO

74       ldap(3LDAP), attributes(5)
75
76
77
78SunOS 5.11                        27 Jan 2002             ldap_friendly(3LDAP)
Impressum