NWDSItrGetPrev

Returns the number of specified previous entries, not including the current entry.

Local Servers:blocking
Remote Servers:blocking
NetWare Server:4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform NDS (NET*.*)
Service:NDS Iterator

Syntax

  #include <nwnet.h> 
  or 
  #include <nwitr.h> 
   
  NWDSCCODE  NWDSItrGetPrev ( 
     nuint_ptr   Iterator, 
     nuint32     numEntries, 
     nuint32     timeout, 
     pnint32     pIterationHandle, 
     pBuf_T      pData); 
  
  

Parameters

Iterator

(IN) Specifies the iterator object.

numEntries

(IN) Specifies the number of entries to read. Zero indicates all entries should be read.

timeout

(IN) Specifies the time (in milliseconds) allowed before returning an error.

pIterationHandle

(IN/OUT) Must be initialized to -1 and will be returned as -1 when all entries have been read.

pData

(OUT) Points to the returned entries.

Return Values

0x0000 0000

SUCCESSFUL

ERR_BOF_HIT

Indicates the iterator was already positioned at the first entry or the list is empty. There is no data to read.

ERR_ITR_INVALID_HANDLE

Indicates the Iterator parameter was not a valid iterator object.

ERR_ITR_INVALID_SEARCH_DATA

Indicates entry data is in an unexpected format.

ERR_QUERY_TIMEOUT

Indicates the function timed out before it retrieved all the requested data.

nonzero value

Nonzero values indicate errors. See NDS Return Values (-001 to -799).

Remarks

The entries are returned in REVERSE sort order. The current position is left pointing to the last entry returned (the one closest to the top of the list). If an attempt is made to read beyond the top of the list, the current position is left at the first entry.

If the returned data does not fit in the result buffer, the function returns with partial information. If the pIterationHandle is not returned as -1, all the data has not been retrieved. You must then call NWDSItrGetPrev again with the current value of the iteration handle to get the remaining data. When the iteration handle is returned as -1, all the data has been retrieved.

The returned data in the pData parameter is in the same format as NWDSSearch, and must be unpacked with the same specialized functions. All data must be unpacked; there is no way to skip data. For step-by-step instructions, see Section 2.2, Retrieving and Unpacking Object and Attribute Name Data and Section 2.3, Retrieving and Unpacking Object, Attribute, and Value Data.

For sample code, see Section 4.7, Listing in Reverse Order: Example.

NCP Calls

See Also

NWDSItrGetCurrent, NWDSItrGetNext, NWDSItrSkip