messages.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* messages.c */
  2. /* $OpenLDAP$ */
  3. /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  4. *
  5. * Copyright 1998-2022 The OpenLDAP Foundation.
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted only as authorized by the OpenLDAP
  10. * Public License.
  11. *
  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>.
  15. */
  16. #include "portable.h"
  17. #include <stdio.h>
  18. #include <ac/stdlib.h>
  19. #include <ac/socket.h>
  20. #include <ac/string.h>
  21. #include <ac/time.h>
  22. #include "ldap-int.h"
  23. LDAPMessage *
  24. ldap_first_message( LDAP *ld, LDAPMessage *chain )
  25. {
  26. assert( ld != NULL );
  27. assert( LDAP_VALID( ld ) );
  28. assert( chain != NULL );
  29. return chain;
  30. }
  31. LDAPMessage *
  32. ldap_next_message( LDAP *ld, LDAPMessage *msg )
  33. {
  34. assert( ld != NULL );
  35. assert( LDAP_VALID( ld ) );
  36. assert( msg != NULL );
  37. return msg->lm_chain;
  38. }
  39. int
  40. ldap_count_messages( LDAP *ld, LDAPMessage *chain )
  41. {
  42. int i;
  43. assert( ld != NULL );
  44. assert( LDAP_VALID( ld ) );
  45. for ( i = 0; chain != NULL; chain = chain->lm_chain ) {
  46. i++;
  47. }
  48. return( i );
  49. }
  50. BerElement*
  51. ldap_get_message_ber( LDAPMessage *ld )
  52. {
  53. return ld->lm_ber;
  54. }