NWDSAllocBuf(3nw)


NWDSAllocBuf -- allocates a Buf_T structure

Synopsis

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

NWDSCCODE N_API NWDSAllocBuf (size_t size, ppBuf_T buf);

Description

The parameters are as follows:

size
(IN) Specifies the number of bytes to allocate to the buffer.

buf
(OUT) Points to Buf_T containing the memory allocated for the buffer.

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

size is the size of buffer to allocate. The following two message sizes are defined in NWDSDC.H:

4096 DEFAULT_MESSAGE_LEN
64512 MAX_MESSAGE_LEN

The total bytes allocated for the buffer is size+sizeof(Buf_T).

For most operations, the size of DEFAULT_MESSAGE_LEN can be used. It is up to the developer to determine by experimentation if another size optimizes an application's performance.

When determining a buffer size, keep in mind the effects of buffer size. A smaller buffer means multiple iterations of an operation might need to be performed to retrieve all of the operation's results. On the other hand, using a large buffer might allow the operation to be completed in one step, but cause a significant delay for the user.

If NWDSAllocBuf is successful, buf is set to point to the allocated buffer.

Services

Directory

NCP calls

None

References

NWDSFreeBuf(3nw), NWDSInitBuf(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.