Modules | |
Attribute Values | |
Functions | |
DS_Status | DS_Entry_GetNamedAttr (const DS_Entry *entry, const char *type, const DS_Attr **attr_p) |
Get the named attribute from an attribute list. More... | |
DS_Status | DS_Entry_GetAttrList (const DS_Entry *entry, const DS_AttrList **attr_list_p) |
Get the entry attribute list. More... | |
DS_Status | DS_Entry_GetModList (const DS_Entry *entry, const DS_AttrList **mod_list_p) |
Get the change-entry's modification list. More... | |
DS_Status | DS_AttrList_New (DS_AttrList **attrlist_p, const DS_Attr *attr) |
Create a new Attribute list. Initially the list contains a single Attribute. More... | |
DS_Status | DS_AttrList_Append (DS_AttrList *attrlist, const DS_Attr *attr) |
Append an attribute to an Attribute list. More... | |
const DS_Attr * | DS_AttrList_GetFirst (const DS_AttrList *attr_list) |
Get the first attribute in an attribute list. More... | |
const DS_Attr * | DS_AttrList_GetNext (const DS_Attr *attr) |
Get the next attribute in a list. More... | |
DS_Status | DS_Attr_GetTypeName (const DS_Attr *attr, const char **str_p) |
Return the type name of a given attribute. More... | |
DS_Status | DS_Attr_GetModType (const DS_Attr *attr, DSModType *type_p) |
Return the modification type of a given attribute. More... | |
DS_Status | DS_Attr_GetValueList (const DS_Attr *attr, const DS_AttrValList **val_list_p) |
Get an attribute's value list. More... | |
DS_Status | DS_Attr_AddStringValue (DS_Attr *attr, const char *str, size_t len) |
Add a new string value to a DS_Attr. More... | |
DS_Status | DS_Attr_AddBERValue (DS_Attr *attr, const unsigned char *ber, size_t len) |
Add a new BER value to a DS_Attr. More... | |
DS_Status | DS_Attr_New (const char *name, DS_Attr **attr_p) |
Create a new DS_Attr structure. More... | |
DS_Status | DS_Attr_New_AllowUnknown (const char *name, DS_Attr **attr_p) |
Create a new DS_Attr structure, allowing unknown attribute-types. More... | |
DS_Status | DS_Attr_IsUnknown (DS_Attr *attr, int *is_unknown_p) |
Check to see if a DS_Attr has an unknown attribute-type. More... | |
DS_Status | DS_Attr_Copy (const DS_Attr *attr, DS_Attr **copy_p) |
Copy a DS_Attr structure. More... | |
void | DS_Attr_Delete (DS_Attr *attr) |
Free a DS_Attr structure. More... | |
DS_Status | DS_AttrList_Copy (const DS_AttrList *attr_list, DS_AttrList **copy_p) |
Copy a DS_AttrList structure. More... | |
void | DS_AttrList_Delete (DS_AttrList *attr_list) |
Free a DS_AttrList structure (and all elements). More... | |
Detailed Description
Function Documentation
◆ DS_Entry_GetNamedAttr()
DS_Status DS_Entry_GetNamedAttr | ( | const DS_Entry * | entry, |
const char * | type, | ||
const DS_Attr ** | attr_p | ||
) |
Get the named attribute from an attribute list.
This works only with normal entries (not change-entries). For known attribute-types, this matches correctly by alias or normal name. For unknown attribute-types it matches only by the name provided.
- Parameters
-
[in] entry Source directory entry (a normal entry). [in] type Attribute type name. [out] attr_p Return DS_Attr pointer.
- Return values
-
DS_E_BADPARAM Either entry or type or attr_p was NULL, or type was "", or entry is a change-entry. DS_E_BADATTRTYPE The type is unknown to the schema, and was not found in the entry. DS_E_NOTFOUND The type is known to the schema, but was not found in the entry.
◆ DS_Entry_GetAttrList()
DS_Status DS_Entry_GetAttrList | ( | const DS_Entry * | entry, |
const DS_AttrList ** | attr_list_p | ||
) |
Get the entry attribute list.
This works only with normal entries (not change-entries).
- Parameters
-
[in] entry Source directory entry (a normal entry, usually). [out] attr_list_p Return attribute list (NULL if this is a change-entry)
- Return values
-
DS_E_BADPARAM If entry was NULL DS_E_NOERROR The DS_AttrList was returned
◆ DS_Entry_GetModList()
DS_Status DS_Entry_GetModList | ( | const DS_Entry * | entry, |
const DS_AttrList ** | mod_list_p | ||
) |
Get the change-entry's modification list.
This can be used to get the modification list of Modify and Add change-entries.
- Parameters
-
[in] entry Source change-entry. [out] mod_list_p Return attribute modification list.
- Return values
-
DS_E_BADPARAM If entry was NULL or entry isn't a change-entry DS_E_NOERROR The DS_AttrList was returned
- Since
- DSAPI_VERSION 2007
◆ DS_AttrList_New()
DS_Status DS_AttrList_New | ( | DS_AttrList ** | attrlist_p, |
const DS_Attr * | attr | ||
) |
Create a new Attribute list. Initially the list contains a single Attribute.
- Parameters
-
[out] attrlist_p Return DS_AttrList pointer. [in] attr an Attribute of which a copy will be made and used as the first element in the list.
- Return values
-
DS_E_NOERROR a new DS_AttrList was created and returned DS_E_BADPARAM if attr was NULL DS_E_NOMEMORY an internal memory allocation failed
- Since
- DSAPI_VERSION 2003
◆ DS_AttrList_Append()
DS_Status DS_AttrList_Append | ( | DS_AttrList * | attrlist, |
const DS_Attr * | attr | ||
) |
Append an attribute to an Attribute list.
- Parameters
-
[in,out] attrlist the Attribute list [in] attr an Attribute to be appended to the list. A copy of the attribute will be made and appended to the list.
- Return values
-
DS_E_NOERROR attr was appended to attrlist DS_E_BADPARAM if attrlist was NULL or attr was NULL DS_E_NOMEMORY an internal memory allocation failed
- Since
- DSAPI_VERSION 2003
◆ DS_AttrList_GetFirst()
const DS_Attr* DS_AttrList_GetFirst | ( | const DS_AttrList * | attr_list | ) |
◆ DS_AttrList_GetNext()
◆ DS_Attr_GetTypeName()
Return the type name of a given attribute.
The string returned by this function should not be freed as it points to memory fixed and resident within the API layer.
- Parameters
-
[in] attr Attribute pointer [out] str_p Returned string pointer.
- Return values
-
DS_E_BADPARAM Either attr or str_p was NULL DS_E_NOERROR A string was returned
◆ DS_Attr_GetModType()
Return the modification type of a given attribute.
If the attribute is a part of a change-entry, then this function returns the modification type: DSModAdd, DSModDelete or DSModReplace.
- Parameters
-
[in] attr Attribute pointer [out] type_p Returned DSModType.
- Return values
-
DS_E_BADPARAM Either attr or type_p was NULL DS_E_NOERROR Modification type was returned
- Since
- DSAPI_VERSION 2007
◆ DS_Attr_GetValueList()
DS_Status DS_Attr_GetValueList | ( | const DS_Attr * | attr, |
const DS_AttrValList ** | val_list_p | ||
) |
Get an attribute's value list.
- Parameters
-
[in] attr Source attribute. [out] val_list_p Returned list of values. In the case that this is the result of a read or search operation using DS_SVC_OPT_ATTRSONLY, this pointer will be set to NULL, to indicate that no attribute values are present.
- Return values
-
DS_E_BADPARAM Either attr or val_list_p was NULL DS_E_NOERROR val_list_p now points at the value list.
◆ DS_Attr_AddStringValue()
Add a new string value to a DS_Attr.
The resulting DS_Attr structure may then be passed into DS_Entry_AddValues(), DS_Entry_DeleteValues(), or DS_Entry_ReplaceValues().
The passed-in value will be copied into the DS_Attr.
- Parameters
-
[in] attr The DS_Attr being updated [in] str The string being added (not necessarily NUL-terminated) [in] len The length of the string being added
- Return values
-
DS_E_BADATTRTYPE The attribute attr was not recognized DS_E_BADPARAM Either attr or str was NULL DS_E_NOERROR The DS_Attr was updated DS_E_NOMEMORY An internal memory allocation failed
- Since
- DSAPI_VERSION 2000
◆ DS_Attr_AddBERValue()
Add a new BER value to a DS_Attr.
The resulting DS_Attr structure may then be passed into DS_Entry_AddValues(), DS_Entry_DeleteValues(), or DS_Entry_ReplaceValues().
The passed-in value will be copied into the DS_Attr.
- Parameters
-
[in] attr The DS_Attr being updated [in] ber The value being added [in] len The length of the value being added
- Return values
-
DS_E_BADATTRTYPE The attribute attr was not recognized DS_E_BADPARAM Either attr or ber was NULL DS_E_NOERROR The DS_Attr was updated DS_E_NOMEMORY An internal memory allocation failed
- Since
- DSAPI_VERSION 2000
◆ DS_Attr_New()
◆ DS_Attr_New_AllowUnknown()
Create a new DS_Attr structure, allowing unknown attribute-types.
- Parameters
-
[in] name LDAPv3 attribute name, which is copied. [out] attr_p Returned pointer
- Return values
-
DS_E_NOMEMORY An internal memory allocation failed DS_E_NOERROR A DS_Attr was created
- Since
- DSAPI_VERSION 2018
◆ DS_Attr_IsUnknown()
Check to see if a DS_Attr has an unknown attribute-type.
- Parameters
-
[in] attr DS_Attr to check [out] is_unknown_p Is this unknown? (1 yes, 0 no)
- Return values
-
DS_E_NOERROR Success DS_E_BADPARAM If attr is NULL or is_unknown_p is NULL
- Since
- DSAPI_VERSION 2018
◆ DS_Attr_Copy()
Copy a DS_Attr structure.
- Parameters
-
[in] attr DS_Attr to copy. [out] copy_p Pointer to returned copy.
- Return values
-
DS_E_BADPARAM Either attr or copy_p was NULL DS_E_NOERROR A DS_Attr was returned DS_E_NOMEMORY An internal memory allocation failed
◆ DS_Attr_Delete()
void DS_Attr_Delete | ( | DS_Attr * | attr | ) |
◆ DS_AttrList_Copy()
DS_Status DS_AttrList_Copy | ( | const DS_AttrList * | attr_list, |
DS_AttrList ** | copy_p | ||
) |
Copy a DS_AttrList structure.
- Parameters
-
[in] attr_list DS_AttrList to copy. [out] copy_p Pointer to returned copy.
- Return values
-
DS_E_BADPARAM Either attr_list or copy_p was NULL DS_E_NOERROR A DS_AttrList was returned DS_E_NOMEMORY An internal memory allocation failed
◆ DS_AttrList_Delete()
void DS_AttrList_Delete | ( | DS_AttrList * | attr_list | ) |
Free a DS_AttrList structure (and all elements).
- Parameters
-
[in] attr_list DS_AttrList to free, or NULL.