11 #include "last_value.h"
13 struct last_value_state
15 fbuff series; /* the series so far */
16 fbuff time_stamps; /* the time stamps */
21 * init local state. can save a copy of the pointer to the
22 * series and time stamps, if desired
25 InitLastValue(fbuff series, fbuff time_stamps, char *params)
27 struct last_value_state *state;
29 state = (struct last_value_state *)
30 malloc(sizeof(struct last_value_state));
38 * all functions take a forcb
40 state->series = series;
41 state->time_stamps = time_stamps;
43 return((char *)state);
47 FreeLastValue(char *state)
54 UpdateLastValue(char *state,
59 * no op -- will just grab it from series
65 ForcLastValue(char *state, double *v)
68 struct last_value_state *s = (struct last_value_state *)state;
70 if(!IS_EMPTY(s->series))
72 val = F_VAL(s->series,F_FIRST(s->series));