c->callback = callback;
c->data = data;
c->next = NULL;
- user_data = malloc(sizeof(*user_data));
- user_data->free_func = cpy_destroy_user_data;
- user_data->data = c;
- plugin_register_complex_read(/* group = */ NULL, buf,
- cpy_read_callback, DOUBLE_TO_CDTIME_T (interval), user_data);
+
+ memset (&user_data, 0, sizeof (user_data));
+ user_data.free_func = cpy_destroy_user_data;
+ user_data.data = c;
+
- ts.tv_sec = interval;
- ts.tv_nsec = (interval - ts.tv_sec) * 1000000000;
+ plugin_register_complex_read(/* group = */ "python", buf,
- cpy_read_callback, &ts, &user_data);
-
++ cpy_read_callback, DOUBLE_TO_CDTIME_T (interval), &user_data);
return cpy_string_to_unicode_or_bytes(buf);
}