NWDSAddFilterToken(3nw)
NWDSAddFilterToken --
adds a node to the search filter expression tree
Synopsis
#include <nwnet.h>
or
#include <nwdsfilt.h>
NWDSCCODE N_API NWDSAddFilterToken
(pFilter_Cursor_T cur,
nuint16 tok,
nptr val,
nuint32 syntax);
Description
The parameters are as follows:
- cur
-
(IN) Points to a Filter_Cursor_T which defines the current insertion point in the filter expression tree.
- tok
-
(IN) Specifies the token to be added to the filter expression tree.
- val
-
(IN) Points either to the attribute name or to the attribute value, according to the token being added.
- syntax
-
(IN) Specifies the attribute syntax associated with val.
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
Each node contains a token and a syntax with an associated value. The token is identified by tok with the following values:
FTOK_END 0
FTOK_OR 1
FTOK_AND 2
FTOK_NOT 3
FTOK_LPAREN 4
FTOK_RPAREN 5
FTOK_AVAL 6
FTOK_EQ 7
FTOK_GE 8
FTOK_LE 9
FTOK_APPROX 10
FTOK_ANAME 14
FTOK_PRESENT 15
FTOK_RDN 16
FTOK_BASECLS 17
FTOK_MODTIME 18
FTOK_VALTIME 19
The relationship between tok, val, and syntax is as follows:
-
If tok is FTOK_ANAME (meaning attribute name), val must point to a copy of the attribute name, and syntax must be set to the appropriate attribute
syntax ID.
-
Likewise, if tok is FTOK_AVAL (meaning attribute value), val must point to a copy of the attribute value, and syntax must be set to the appropriate
attribute syntax ID.
-
If tok is neither FTOK_ANAME or FTOK_AVAL, val and syntax are ignored and can be set to NULL.
val must point to a dynamically allocated memory buffer that can be freed by calling either NWDSPutFilter or NWDSAddFilterToken.
NWDSPutFilter frees up the memory associated with the expression tree. However, if NWDSAddFilterToken returns an error while you are creating an expression
tree, you should not call NWDSPutFilter, but call NWDSFreeFilter to free up the memory associated with the expression tree.
expect
of cur contains a bit-map representation of the valid token at the current position in the tree. tok must correspond to one of these tokens.
If NWDSAddFilterToken returns SUCCESSFUL, expect is updated according to the next position in the tree (the insertion point of the next token).
Parsing of the token expression list is performed by NWDSAddFilterToken.
Services
Directory
NCP calls
None
References
NWDSAllocFilter(3nw),
NWDSDelFilterToken(3nw),
NWDSFreeFilter(3nw),
NWDSPutFilter(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.