]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap_add.3
Suck in changes from HEAD
[openldap] / doc / man / man3 / ldap_add.3
1 .TH LDAP_ADD 3 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2002 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldap_add, ldap_add_s, ldap_add_ext, ldap_add_ext_s \- Perform an LDAP add operation
7 .SH SYNOPSIS
8 .nf
9 .B #include <ldap.h>
10 .sp
11 .BI "int ldap_add(LDAP *" ld ", const char *" dn ", LDAPMOD *" attrs "[]);"
12 .sp
13 .BI "int ldap_add_s(LDAP *" ld ", const char *" dn ", LDAPMod *" attrs "[]);"
14 .sp
15 .BI "int ldap_add_ext(LDAP *" ld ", const char *" dn ", LDAPMOD *" attrs "[],"
16 .RS
17 .BI "LDAPControl *" sctrls "[], LDAPControl *" cctrls "[], int *" msgidp ");"
18 .RE
19 .sp
20 .BI "int ldap_add_ext_s(LDAP *" ld ", const char *" dn ", LDAPMOD *" attrs "[],"
21 .RS
22 .BI "LDAPControl *" sctrls "[], LDAPControl *" cctrls "[]);"
23 .RE
24 .fi
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 .LP
53 The
54 .B ldap_add_ext()
55 routine allows server and client controls to be specified to extend
56 the add request. This routine is asynchronous like
57 .BR ldap_add() ,
58 but its return value is an LDAP error code.  It stores the message id
59 of the request in the integer pointed to
60 by
61 .IR msgidp .
62 .LP
63 The
64 .B ldap_add_ext_s()
65 routine is the synchronous version of
66 .BR ldap_add_ext() .
67 It also returns an LDAP error code indicating success or failure
68 of the operation.
69 .SH ERRORS
70 .B ldap_add()
71 returns -1 in case of error initiating the request, and
72 will set the \fIld_errno\fP field in the \fIld\fP parameter
73 to indicate the error.
74 .B ldap_add_s()
75 will return an LDAP error code
76 directly (LDAP_SUCCESS if everything went ok, some error otherwise).
77 .B ldap_add_ext()
78 and
79 .B ldap_add_ext_s()
80 also directly return LDAP error codes.
81 .SH SEE ALSO
82 .BR ldap (3),
83 .BR ldap_modify (3)
84 .SH ACKNOWLEDGEMENTS
85 .B      OpenLDAP
86 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
87 .B      OpenLDAP
88 is derived from University of Michigan LDAP 3.3 Release.