#include <nwnet.h> or #include <nwdsbuft.h>NWDSCCODE N_API NWDSGetAttrVal (NWDSContextHandle context, pBuf_T buf, nuint32 syntaxID, nptr attrVal);
NWDSGetAttrVal is used to retrieve attribute values from a result buffer filled in by functions such as NWDSList, NWDSRead, or NWDSSearch.
syntaxID is returned by a previous call to NWDSGetAttrName. syntaxID indicates to NWDSGetAttrVal how to translate the attribute value into a data structure. The structure of the data returned in attrVal depends on the value of syntaxID.
The syntax types (such as SYN_CI_STRING) are enumerated in NWDSDEFS.H. Attribute syntaxes and their corresponding data structures are listed in the ``Attribute Syntax Definitions'' chapter of NetWare Direction Services Schema Specification.
If attrVal equals NULL, the value is skipped; this is useful for simply counting attribute values.
You must allocate memory for the attribute value and set attrVal to point to that memory. The memory must be a contiguous block of memory whose size is determined by calling NWDSComputeAttrValSize.
The memory pointed to by attrVal should be dynamically allocated memory since the size of the memory needed to store the attribute values can be different even when the values are associated with the same attribute.
See NWDSGetAttrName(3nw) for the steps to remove attribute values from a result buffer.
Directory