32.3. slapi_matchingrule_get()

Gets information about a matching rule.
This function gets information about a matching rule from the Slapi_MatchingRuleEntry structure. To set information in this structure, call the slapi_matchingrule_set() function.
Syntax

#include "slapi-plugin.h"
int slapi_matchingrule_get(SlPi_MatchingRuleEntry *mr, int arg, void *value);

Parameters

This function takes the following parameters:

mr
Slapi_MatchingRuleEntry structure from which you want to get data.
arg
ID specifying the type of information you want to get.
value
Pointer to a variable to hold the retrieved data.
The arg argument can have one of the following values:
ID Data Type of the value Argument Description
SLAPI_MATCHINGRULE_NAME
char *
Name of the matching rule.
SLAPI_MATCHINGRULE_OID
char *
OID of the matching rule.
SLAPI_MATCHINGRULE_DESC
char *
Description of the matching rule.
SLAPI_MATCHINGRULE_SYNTAX
char *
Syntax supported by the matching rule.
SLAPI_MATCHINGRULE_OBSOLETE
int
If 1, the matching rule is obsolete.
Returns

This function returns one of the following values:

  • 0 if the information was successfully retrieved.
  • -1 if an error occurred; for example, if an invalid argument was specified.