int sr_datastore_new(int unitsize, struct sr_datastore **ds);
int sr_datastore_destroy(struct sr_datastore *ds);
-void sr_datastore_put(struct sr_datastore *ds, void *data, unsigned int length,
- int in_unitsize, int *probelist);
+int sr_datastore_put(struct sr_datastore *ds, void *data, unsigned int length,
+ int in_unitsize, int *probelist);
/*--- device.c --------------------------------------------------------------*/
-void sr_device_scan(void);
-int sr_init_hwplugins(struct sr_device_plugin *plugin);
+int sr_device_scan(void);
GSList *sr_device_list(void);
-struct sr_device *sr_device_new(struct sr_device_plugin *plugin,
- int plugin_index, int num_probes);
-void sr_device_clear(struct sr_device *device);
-void sr_device_destroy(struct sr_device *dev);
-
-void sr_device_probe_clear(struct sr_device *device, int probenum);
-void sr_device_probe_add(struct sr_device *device, const char *name);
-struct sr_probe *sr_device_probe_find(struct sr_device *device, int probenum);
-void sr_device_probe_name(struct sr_device *device, int probenum,
- const char *name);
-
-void sr_device_trigger_clear(struct sr_device *device);
-void sr_device_trigger_set(struct sr_device *device, int probenum,
- const char *trigger);
-gboolean sr_device_has_hwcap(struct sr_device *device, int hwcap);
+struct sr_device *sr_device_new(const struct sr_device_plugin *plugin,
+ int plugin_index);
+int sr_device_clear(struct sr_device *device);
+int sr_device_probe_clear(struct sr_device *device, int probenum);
+int sr_device_probe_add(struct sr_device *device, const char *name);
+struct sr_probe *sr_device_probe_find(const struct sr_device *device,
+ int probenum);
+int sr_device_probe_name(struct sr_device *device, int probenum,
+ const char *name);
+int sr_device_trigger_clear(struct sr_device *device);
+int sr_device_trigger_set(struct sr_device *device, int probenum,
+ const char *trigger);
+gboolean sr_device_has_hwcap(const struct sr_device *device, int hwcap);
/*--- filter.c --------------------------------------------------------------*/
-int sr_filter_probes(int in_unitsize, int out_unitsize, int *probelist,
+int sr_filter_probes(int in_unitsize, int out_unitsize, const int *probelist,
const unsigned char *data_in, uint64_t length_in,
char **data_out, uint64_t *length_out);
/*--- hwplugin.c ------------------------------------------------------------*/
GSList *sr_list_hwplugins(void);
+int sr_init_hwplugins(struct sr_device_plugin *plugin);
void sr_cleanup_hwplugins(void);
/* Generic device instances */
/* Session setup */
int sr_session_load(const char *filename);
struct sr_session *sr_session_new(void);
-void sr_session_destroy(void);
-void sr_session_device_clear(void);
+int sr_session_destroy(void);
+int sr_session_device_clear(void);
int sr_session_device_add(struct sr_device *device);
-#if 0
-/* Protocol analyzers setup */
-void sr_session_pa_clear(void);
-void sr_session_pa_add(struct sr_analyzer *pa);
-#endif
-
/* Datafeed setup */
-void sr_session_datafeed_callback_clear(void);
-void sr_session_datafeed_callback_add(sr_datafeed_callback callback);
+int sr_session_datafeed_callback_clear(void);
+int sr_session_datafeed_callback_add(sr_datafeed_callback callback);
/* Session control */
int sr_session_start(void);
-void sr_session_run(void);
-void sr_session_halt(void);
-void sr_session_stop(void);
-void sr_session_bus(struct sr_device *device,
- struct sr_datafeed_packet *packet);
+int sr_session_run(void);
+int sr_session_halt(void);
+int sr_session_stop(void);
+int sr_session_bus(struct sr_device *device, struct sr_datafeed_packet *packet);
int sr_session_save(const char *filename);
-void sr_session_source_add(int fd, int events, int timeout,
+int sr_session_source_add(int fd, int events, int timeout,
sr_receive_data_callback callback, void *user_data);
-void sr_session_source_remove(int fd);
+int sr_session_source_remove(int fd);
/*--- input/input.c ---------------------------------------------------------*/