44.4. slapi_vattr_value_compare()

Description

This function compares attribute type and name in a given entry. There is no need to call slapi_vattr_values_free() after calling this function.

Syntax

#include "slapi-plugin.h"
int slapi_vattr_value_compare( Slapi_Entry *e, char *type, Slapi_Value *test_this, int *result, int flags);

Parameters

This function takes the following parameters:

e
Entry to be compared.
type
Attribute type name.
test_this
Value to be tested.
result
0 if the compare is true, 1 if the compare is false.
flags
Not used. You should pass 0 for this parameter.
Returns

This function returns 1 for success, in which case result contains the result of the comparison. Otherwise, this function returns 0 and one of the following:

  • SLAPI_VIRTUALATTRS_LOOP_DETECTED (failed to evaluate a vattr).
  • SLAPI_VIRTUAL_NOT_FOUND (type not recognized by any vattr and not a real attr in entry).
  • ENOMEM (memory error).