HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
31 Functions for counters
This chapter contains reference information on routines for setting 64-bit values for Directory
Server database and server statistics counters.
Table 31-1 Counter routines
DescriptionFunction
Adds a certain amount to the counter value.slapi_counter_add()
Decrements the counter and returns the new value.slapi_counter_decrement()
Destroys an existing counter.slapi_counter_destroy()
Gets the current value of the counter.slapi_counter_get_value()
Increments the counter value and returns the new value.slapi_counter_increment()
Initializes a new counter.slapi_counter_init()
Creates a new counter.slapi_counter_new()
Sets the counter to a new, specified value and returns the updated value.slapi_counter_set_value()
Subtracts a certain amount from the counter value.slapi_counter_subtract()
31.1 slapi_counter_add()
Atomically adds a specified amount to the counter value.
By default, the counter increments up 1; using slapi_counter_add() allows the counter to
increment by some other specified unit.
Syntax
#include "slapi-plugin.h"
PRUint64 slapi_counter_add(Slapi_Counter *counter, PRUint64 addvalue);
Parameters This function takes the following parameters:
The counter to which to add the specified value.
counter
The amount to add to the current counter value.
addvalue
Returns The function returns the value of the counter (the current count) after the counter has
been incremented by the amount set in slapi_counter_add().
See also
slapi_counter_increment()
slapi_counter_set_value()
slapi_counter_subtract()
31.2 slapi_counter_decrement()
Atomically decrements the counter value and returns the new value.
Both this function and slapi_counter_increment() set the behavior of the counter, moving up or
down. Other functions, such as slapi_counter_set_value(), manipulate the actual value of the
counter.
Syntax
#include "slapi-plugin.h"
PRUint64 slapi_counter_decrement(Slapi_Counter *counter);
31.1 slapi_counter_add() 255