]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap_add.3
remove #include <lber.h> from SYNOPSIS
[openldap] / doc / man / man3 / ldap_add.3
1 .TH LDAP_ADD 3 "22 September 1998" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-1999 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldap_add, ldap_add_s \- Perform an LDAP add operation
7 .SH SYNOPSIS
8 .nf
9 .ft B
10 #include <ldap.h>
11 .LP
12 .ft B
13 int ldap_add(ld, dn, attrs)
14 .ft
15 LDAP *ld;
16 char *dn;
17 LDAPMod *attrs[];
18 .LP
19 .ft B
20 int ldap_add_s(ld, dn, attrs)
21 .ft
22 LDAP *ld;
23 char *dn;
24 LDAPMod *attrs[];
25 .SH DESCRIPTION
26 The
27 .B ldap_add_s()
28 routine is used to perform an LDAP add operation.
29 It takes \fIdn\fP, the DN of the entry to add, and \fIattrs\fP, a
30 null-terminated array of the entry's attributes.  The LDAPMod structure
31 is used to represent attributes, with the \fImod_type\fP and
32 \fImod_values\fP fields being used as described under
33 .BR ldap_modify (3),
34 and the \fIldap_op\fP field being used only if you need to specify
35 the LDAP_MOD_BVALUES option. Otherwise, it should be set to zero.
36 .LP
37 Note that all entries except that
38 specified by the last component in the given DN must already exist.
39 .B ldap_add_s()
40 returns an LDAP error code indicating success or failure
41 of the operation.  See
42 .BR ldap_error (3)
43 for more details.
44 .LP
45 The
46 .B ldap_add()
47 routine works just like
48 .BR ldap_add_s() ,
49 but it is asynchronous.  It returns the message id of the request it
50 initiated.  The result of this operation can be obtained by calling
51 .BR ldap_result (3).
52 .SH ERRORS
53 .B ldap_add()
54 returns -1 in case of error initiating the request, and
55 will set the \fIld_errno\fP field in the \fIld\fP parameter
56 to indicate the error.
57 .B ldap_add_s()
58 will return an LDAP error code
59 directly (LDAP_SUCCESS if everything went ok, some error otherwise).
60 .SH SEE ALSO
61 .BR ldap(3),
62 .B ldap_modify(3)
63 .SH ACKNOWLEDGEMENTS
64 .B      OpenLDAP
65 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
66 .B      OpenLDAP
67 is derived from University of Michigan LDAP 3.3 Release.