LIBRRD(1) rrdtool LIBRRD(1) NNAAMMEE librrd - RRD library functions DDEESSCCRRIIPPTTIIOONN lliibbrrrrdd contains most of the functionality in RRRRDDTTooooll. The command line utilities and language bindings are often just wrappers around the code contained in lliibbrrrrdd. This manual page documents the lliibbrrrrdd API. NNOOTTEE:: This document is a work in progress, and should be considered incomplete as long as this warning persists. For more information about the lliibbrrrrdd functions, always consult the source code. UUTTIILLIITTYY FFUUNNCCTTIIOONNSS _rr_rr_dd____rr_aa_nn_dd_oo_mm_((_)) Generates random numbers just like _r_a_n_d_o_m_(_). This further ensures that the random number generator is seeded exactly once per pro- cess. rrrrdd__aadddd__ppttrr((vvooiidd ******ddeesstt,, ssiizzee__tt **ddeesstt__ssiizzee,, vvooiidd **ssrrcc)) Dynamically resize the array pointed to by "dest". "dest_size" is a pointer to the current size of "dest". Upon successful _r_e_a_l_- _l_o_c_(_), the "dest_size" is incremented by 1 and the "src" pointer is stored at the end of the new "dest". Returns 1 on success, 0 on failure. type **arr = NULL; type *elem = "whatever"; size_t arr_size = 0; if (!rrd_add_ptr(&arr, &arr_size, elem)) handle_failure(); rrrrdd__aadddd__ssttrrdduupp((cchhaarr ******ddeesstt,, ssiizzee__tt **ddeesstt__ssiizzee,, cchhaarr **ssrrcc)) Like "rrd_add_ptr", except adds a "strdup" of the source string. char **arr = NULL; size_t arr_size = NULL; char *str = "example text"; if (!rrd_add_strdup(&arr, &arr_size, str)) handle_failure(); rrrrdd__ffrreeee__ppttrrss((vvooiidd ******ssrrcc,, ssiizzee__tt **ccnntt)) Free an array of pointers allocated by "rrd_add_ptr" or "rrd_add_strdup". Also frees the array pointer itself. On return, the source pointer will be NULL and the count will be zero. /* created as above */ rrd_free_ptrs(&arr, &arr_size); /* here, arr == NULL && arr_size == 0 */ 1.3.99909060808 2009-04-20 LIBRRD(1)