Sun Java System Directory Server Enterprise Edition 6.0 Developer's Guide

slapi_entry_attr_find()

Determines if an entry contains the specified attribute. If the entry contains the attribute, the function returns a pointer to the attribute.

Syntax

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

Parameters

This function takes the following parameters:

e

Entry that you want to check.

type

Name of the attribute that you want to check.

attr

Pointer to the attribute, if the attribute is in the entry.

Returns

This function returns 0 if the entry contains the specified attribute; otherwise it returns -1.

Memory Concerns

Do not free the returned attr. It is a pointer to the internal entry data structure. It is usually wise to make a copy of the returned attr, using slapi_attr_dup(), to avoid dangling pointers if the entry is freed while the pointer to attr is still being used.

See Also

slapi_attr_dup()