Federated Naming Service Programming Guide

Extended Operations

In addition to the relational operators, extended operators can be specified. All extended operators return either TRUE or FALSE. A filter expression can contain both relational and extended operations.

Extended operators are specified using an identifier (FN_identifier_t) or a string. If the operator is specified using a string, the string is used to construct an identifier of format FN_ID_STRING. Identifiers of extended operators and signatures of the corresponding extended operations, as well as their suggested semantics, are registered with X/Open.

The extended operations shown in Table 2-9 are currently defined:

Table 2-9 Extended Operations

`name'(<Wildcarded String>)

The identifier for this operation is name(FN_ID_STRING). The argument to this operation is a wildcarded string. The operation returns TRUE if the name of the object matches the supplied wildcarded string.

`reftype'(%i)

The identifier for this operation is reftype (FN_ID_STRING). The argument to this operation is an identifier. The operation returns TRUE if the reference type of the object is equal to the supplied identifier.

`addrtype'(%i)

The identifier for this operation is addrtype(FN_ID_STRING). The argument to this operation is an identifier.

The operation returns TRUE if any of the address types in the reference of the object is equal to the supplied identifier. Support and exact semantics of extended operations are context-specific. If a context does not support an extended operation, or if the filter expression supplies the extended operation with either an incorrect number or type of arguments, the error FN_E_SEARCH_INVALID_OP is returned. FN_E_OPERATION_NOT_SUPPORTED is returned when fn_attr_ext_search() is not supported.

Table 2-10 contains examples of filter expressions that contain extended operations.

Table 2-10 Extended Operations in Search Filter Expressions

Expression 

Meaning  

`name'(`bill'*)

Evaluates to TRUE if the name of the object starts with bill.

%i(%a, %v)

Evaluates to result of applying the specified operation to the supplied arguments. 

(%a == %v) and `name'(`joe'*)

Evaluates to TRUE if the specified attribute has the given value and if the name of the object starts with joe.