NWDSGetAttrVal(3nw)


NWDSGetAttrVal -- returns the next attribute value in a result buffer

Synopsis

   #include <nwnet.h> 
   or 
   #include <nwdsbuft.h> 
   

NWDSCCODE N_API NWDSGetAttrVal (NWDSContextHandle context, pBuf_T buf, nuint32 syntaxID, nptr attrVal);

Description

The parameters are as follows:

context
(IN) Specifies the Directory context for the request.

buf
(IN) Points to the result buffer being read.

syntaxID
(IN) Specifies the syntax of the attribute value.

attrVal
(OUT) Points to the attribute value at the current buffer position.

Return values

0x0000
SUCCESSFUL

Negative Value
Negative values indicate errors. For errors returned by Directory Services, see ``Directory Services OS Errors'' (-001 to -255), ``Directory Services Client Library Errors'' (-301 to -399), or ``Directory Services Agent in the Server Errors'' (-601 to -699).

Notices

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.

Services

Directory

NCP calls

None
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.