NWDSComputeAttrValSize(3nw)


NWDSComputeAttrValSize -- computes, in conjunction with NWDSGetAttrVal, the size of the attribute value at the current position in the result buffer

Synopsis

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

NWDSCCODE N_API NWDSComputeAttrValSize (NWDSContextHandle context, pBuf_T buf, nuint32 syntaxID, pnuint32 attrValSize);

Description

The parameters are as follows:

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

buf
(IN) Points to a result buffer positioned at an attribute value.

syntaxID
(IN) Specifies the numeric ID of the attribute value.

attrValSize
(OUT) Points to the size (in bytes) required to retrieve the attribute.

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

Since Buf_T buffers are opaque to client applications, a client cannot view a result buffer directly to see the size of the values returned in the buffer. Call NWDSComputeAttrValSize to find the size and syntax of the current attribute value in the buffer and then dynamically allocate memory of that size to hold the current attribute's value. Then retrieve the value by calling NWDSGetAttrVal.

Call NWDSComputeAttrValSize once for each attribute value you retrieve from the result buffer.

syntaxID identifies the syntax data type the attribute information is stored in. The data structures associated with the syntaxes are listed in the ``Attribute Syntax Definitions'' section of the NetWare Directory Services Schema Specification. The enumerated types for syntaxes (such as SYN_DIST_NAME) are located in NWDSDEFS.H.

attrValSize points to the size of the attribute value in bytes. This size can be used as input to a memory allocation request. The size is large enough to contain the attribute value along with any structure returned by NWDSGetAttrVal.

Services

Directory

NCP calls

None

References

NWDSGetAttrVal(3nw)


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