]> git.sur5r.net Git - openldap/blob - libraries/libldap/addentry.c
Don't provide ldap.OpenLDAP.org and dc=OpenLDAP, dc=Org as the defaults.
[openldap] / libraries / libldap / addentry.c
1 /*
2  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5 /*  Portions
6  *  Copyright (c) 1990 Regents of the University of Michigan.
7  *  All rights reserved.
8  *
9  *  addentry.c
10  */
11
12 #include "portable.h"
13
14 #include <stdio.h>
15 #include <stdlib.h>
16
17 #include <ac/ctype.h>
18 #include <ac/socket.h>
19 #include <ac/string.h>
20 #include <ac/time.h>
21
22 #include "ldap-int.h"
23
24 LDAPMessage *
25 ldap_delete_result_entry( LDAPMessage **list, LDAPMessage *e )
26 {
27         LDAPMessage     *tmp, *prev = NULL;
28
29         for ( tmp = *list; tmp != NULL && tmp != e; tmp = tmp->lm_chain )
30                 prev = tmp;
31
32         if ( tmp == NULL )
33                 return( NULL );
34
35         if ( prev == NULL )
36                 *list = tmp->lm_chain;
37         else
38                 prev->lm_chain = tmp->lm_chain;
39         tmp->lm_chain = NULL;
40
41         return( tmp );
42 }
43
44 void
45 ldap_add_result_entry( LDAPMessage **list, LDAPMessage *e )
46 {
47         e->lm_chain = *list;
48         *list = e;
49 }