HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
lapi_send_ldap_referral()For example, the following statement sends an LDAP_SUCCESS status
code back to the client:
slapi_send_ldap_result( pb, LDAP_SUCCESS, NULL, "The operation was pro\
cessed successfully.\n", 0, NULL );
Important:
Ensure that you send only one result per operation to the client.
5.4 Determining if an operation was abandoned
At any point in time, the client can choose to abandon an LDAP operation. When writing database
functions, remember that you should periodically check to see if the operation has been
abandoned.
To determine if an operation has been abandoned, call “slapi_op_abandoned()”. For example:
if ( slapi_op_abandoned( pb ) ) {
slapi_log_error( SLAPI_LOG_PLUGIN, "my_function", "The operation was
abandoned.\n" );
return 1;
}
5.5 Working with entries, attributes, and values
This section discusses how to create new entries in the directory and how to convert them to
LDIF and back.
In certain situations, you will need to pass directory entries between the front end and the client.
For example, it you create a custom add function, the front end passes an entry to your function
in the parameter block. When you perform a search operation, you return each matching search
entry to the client.
When working with entries, you use the “Slapi_Entry” data type to get attribute value pairs. The
front end routines listed in Table 5-1 “Front end functions for manipulating entries and attributes”
are designed to help you manipulate entries passed in parameter blocks. These functions are
described in more detail in the following sections.
Table 5-1 Front end functions for manipulating entries and attributes
DescriptionFront end function
Allocate memory for a new entry.“slapi_entry_alloc()”
Initialize the entry created with “slapi_entry_alloc()”.
IMPORTANT:
This must be done before any other operation can occur on the entry. Otherwise, severe
memory errors may occur.
“slapi_entry_init()”
Copy an entry.“slapi_entry_dup()”
Free an unused entry from memory.“slapi_entry_free()”
Convert an entry to an LDIF string representation and vice versa.“slapi_entry2str()”
“slapi_entry2str_with_options()”
“slapi_str2entry()”
Get or set the DN for an entry.“slapi_entry_get_dn()”
“slapi_entry_set_dn()”
Verify that an entry complies with the schema.“slapi_entry_schema_check()”
50 Front end API functions