24.41. slapi_entry_next_attr()

Finds the next attribute after prevattr in an entry. To iterate through the attributes in an entry, use this function in conjunction with the slapi_entry_first_attr() function.
Syntax

#include "slapi-plugin.h"
int slapi_entry_next_attr( const Slapi_Entry *e, Slapi_Attr *prevattr, Slapi_Attr **attr );

Parameters

This function takes the following parameters:

e
Entry from which you want to get the attribute.
prevattr
Previous attribute in the entry.
attr
Pointer to the next attribute after prevattr in the entry.
Returns

This function returns one of the following values:

  • 0 if successful.
  • -1 if prevattr was the last attribute in the entry.
Memory Concerns

Never free the returned attr. Use slapi_attr_dup() to make a copy if a copy is needed.