19.2. slapi_attr_basetype()

Description

This function returns the base type of an attribute (for example, if given cn;lang-jp, returns cn).

Syntax

#include "slapi-plugin.h"
char *slapi_attr_basetype( char *type, char *buf, size_t bufsiz );

Parameters

This function takes the following parameters:

type Attribute type from which you want to get the base type.
buf Buffer to hold the returned base type.
bufsiz Size of the buffer.
Returns

This function returns NULL if the base type fits in the buffer. If the base type is longer than the buffer, the function allocates memory for the base type and returns a pointer to it.

Memory Concerns

You should free the returned base type when done by calling slapi_attr_basetype().