2 /* $OpenLDAP: pkg/ldap/libraries/libldap/addentry.c,v 1.16.2.3 2008/02/11 23:26:41 kurt Exp $ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2008 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
12 * A copy of this license is available in the file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
16 /* Portions Copyright (c) 1990 Regents of the University of Michigan.
17 * All rights reserved.
24 #include <ac/stdlib.h>
26 #include <ac/socket.h>
27 #include <ac/string.h>
33 ldap_delete_result_entry( LDAPMessage
**list
, LDAPMessage
*e
)
35 LDAPMessage
*tmp
, *prev
= NULL
;
37 assert( list
!= NULL
);
40 for ( tmp
= *list
; tmp
!= NULL
&& tmp
!= e
; tmp
= tmp
->lm_chain
)
48 tmp
->lm_chain
->lm_chain_tail
= (*list
)->lm_chain_tail
;
49 *list
= tmp
->lm_chain
;
51 prev
->lm_chain
= tmp
->lm_chain
;
52 if ( prev
->lm_chain
== NULL
)
53 (*list
)->lm_chain_tail
= prev
;
61 ldap_add_result_entry( LDAPMessage
**list
, LDAPMessage
*e
)
63 assert( list
!= NULL
);
68 e
->lm_chain_tail
= (*list
)->lm_chain_tail
;