24.30. slapi_entry_first_attr()

Finds the first attribute in an entry. If you want to iterate through the attributes in an entry, use this function in conjunction with the slapi_entry_next_attr() function.
Syntax

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

Parameters

This function takes the following parameters:

e
Entry from which you want to get the attribute.
attr
Pointer to the first attribute in the entry.
Returns

Returns 0 when successful; any other value returned signals failure.

Memory Concerns

Do not free the returned attr. This is a pointer into the internal entry data structure. If you need a copy, use slapi_attr_dup().