44.7. slapi_vattr_values_get_ex()

Description

This function returns the values for an attribute type from an entry, including the values for any subtypes of the specified attribute type. The routine will return the values of virtual attributes in that entry if requested to do so.

Syntax

#include "slapi-plugin.h"
int slapi_vattr_values_get_ex(Slapi_Entry *e, char *type, Slapi_ValueSet*** results, 
int **type_name_disposition, char ***actual_type_name, int flags, int *buffer_flags, int *subtype_count);

Parameters

This function takes the following parameters:

e
Entry from which to get the values.
type
Attribute type name.
results
Pointer to result set.
type_name_disposition
Matching result.
actual_type_name
Type name as found.
flags
Bit mask of options. Valid values are as follows:
  • SLAPI_REALATTRS_ONLY
  • SLAPI_VIRTURALATTRS_ONLY
  • SLAPI_VIRTUALATTRS_REQUEST_POINTERS
  • SLAPI_VIRTUALATTRS_LIST_OPERATIONAL_ATTRS
buffer_flags
Bit mask to be used as input flags for slapi_values_free().
subtype_count
Number of subtypes matched.
Returns

This function returns 0 for success, in which case:

  • results contains the current values for type all of the subtypes in e.
  • type_name_disposition contains information on how each type was matched. Valid values are: SLAPI_VIRTUALATTRS_TYPE_NAME_MATCHED_EXACTLY_OR_ALIAS and SLAPI_VIRTUALATTRS_TYPE_NAME_MATCHED_SUBTYPE.
  • actual_type_name contains the type name as found.
  • buffer_flags contains the bit mask to be used as input flags for slapi_values_free().
  • subtype_count contains the number of subtypes matched.
Otherwise, this function returns 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).
Memory Concerns

slapi_vattr_values_free() should be used to free the returned result set and type names, passing the buffer_flags value returned from this routine.