19.10. slapi_attr_get_oid_copy()

Description

This function replaces the deprecated function, slapi_attr_get_oid. Use this function to search the syntaxes for an attribute type's OID and return a copy of it's OID string.

Syntax

#include "slapi-plugin.h"
int slapi_attr_get_oid_copy( const Slapi_Attr *attr, char **oidp );

Parameters

This function takes the following parameters:

attr Attribute that contains the desired type.
oidp Destination string of the copied attribute type OID.
Returns

This function returns one of the following values:

  • 0 if the attribute type is found.
  • -1 if it is not.
Memory Concerns

You should free this string using slapi_ch_free().