HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
See also
slapi_counter_add()
slapi_counter_decrement()
31.6 slapi_counter_init()
Initializes a new Slapi_Counter structure, sets the initial value for the new counter to 0.
This function is useful when the Slapi_Counter structure is static, similar to:
static Slapi_Counter operation_counter;
...
slapi_counter_init(&operation_counter);
Syntax
#include "slapi-plugin.h"
void slapi_counter_init(Slapi_Counter *counter);
Parameters This function takes the following parameter:
The name of the counter being initialized.
counter
See also
slapi_counter_new()
31.7 slapi_counter_new()
Allocates and initializes a new Slapi_Counter structure. The value of this counter is initially set
to zero (0).
When you are finished with this counter, call slapi_counter_destroy() to free the function.
Syntax
#include "slapi-plugin.h"
Slapi_Counter *slapi_counter_new();
See also
slapi_counter_destroy()
31.8 slapi_counter_set_value()
Atomically sets the current value of the counter structure.
By default, counters start at zero (0). This function can be called to set a counter to a specific
value.
Syntax
#include "slapi-plugin.h"
PRUint64 slapi_counter_set_value(Slapi_Counter *counter,
PRUint64 newvalue);
Parameters This function takes the following parameters:
The counter for which to set the value.
counter
The new value for the counter.
newvalue
Returns The function returns the value of the counter (the current count) after the counter has
been set to the value specified in slapi_counter_set_value().
See also
31.6 slapi_counter_init() 257