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