KDATA_ARRAY_FILL(3)

NAME
kdata_array_add, kdata_array_fill, kdata_array_fill_ydoubles, kdata_array_fill_ysizes, kdata_array_set - modify array data source

LIBRARY
libkplot

SYNOPSIS
#include <cairo.h>
#include <kplot.h>
int
kdata_array_add(struct kdata *data, size_t pos, double y);
int
kdata_array_fill(struct kdata *data, void *arg, void (*fp)(size_t, struct kpair *, void *));
int
kdata_array_fill_ydoubles(struct kdata *data, const double *ys);
int
kdata_array_fill_ysizes(struct kdata *data, const size_t *ys);
int
kdata_array_set(struct kdata *data, size_t pos, double x, double y);

DESCRIPTION
The kdata_array_add, kdata_array_fill, kdata_array_fill_ydoubles, kdata_array_fill_ysizes, and kdata_array_set functions modify the buffers of a data source created by kdata_array_alloc(3). kdata_array_fill invokes the fp function with each bucket provided by kdata_array_alloc, while kdata_array_add and kdata_array_fill directly modify the buckets at position pos. The kdata_array_fill_ydoubles and kdata_array_fill_ysizes set values to the corresponding array indices, which are assumed to be the same length as the data source (else the behaviour is undefined).

RETURN VALUES
kdata_array_fill, kdata_array_fill_ydoubles, kdata_array_fill_ysizes, and kdata_array_set return 0 if they have any dependants whose update fails, the positions fall outside of the allocated boundaries, or the data source was not created with kdata_array_alloc(3); otherwise they return 1.

SEE ALSO
kdata_array_alloc(3), kplot(3)