X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=sigrok-proto.h;h=36c4c6511c4fa0d886244a8a691385a330a31cbb;hb=cdb3573ceba61b02b80f7fc979d166db5b6ff3bc;hp=2b8a4858e6249cfac5a22fb6c0277d7abcf792cf;hpb=ee4b6342afe8e42c0be481109b9b97e27cbb846a;p=libsigrok.git diff --git a/sigrok-proto.h b/sigrok-proto.h index 2b8a4858..36c4c651 100644 --- a/sigrok-proto.h +++ b/sigrok-proto.h @@ -23,7 +23,7 @@ /*--- backend.c -------------------------------------------------------------*/ int sr_init(void); -void sr_exit(void); +int sr_exit(void); /*--- datastore.c -----------------------------------------------------------*/ @@ -44,24 +44,24 @@ 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, char *name); +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, char *name); +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, - char *trigger); + const char *trigger); gboolean sr_device_has_hwcap(struct sr_device *device, int hwcap); /*--- filter.c --------------------------------------------------------------*/ -int filter_probes(int in_unitsize, int out_unitsize, int *probelist, - char *data_in, uint64_t length_in, char **data_out, - uint64_t *length_out); +int sr_filter_probes(int in_unitsize, int out_unitsize, int *probelist, + const char *data_in, uint64_t length_in, char **data_out, + uint64_t *length_out); /*--- hwplugin.c ------------------------------------------------------------*/ -int load_hwplugins(void); GSList *sr_list_hwplugins(void); /* Generic device instances */ @@ -87,15 +87,12 @@ int sr_find_hwcap(int *capabilities, int hwcap); struct sr_hwcap_option *sr_find_hwcap_option(int hwcap); void sr_source_remove(int fd); void sr_source_add(int fd, int events, int timeout, - receive_data_callback rcv_cb, void *user_data); + sr_receive_data_callback rcv_cb, void *user_data); /*--- session.c -------------------------------------------------------------*/ -typedef void (*source_callback_remove) (int fd); -typedef void (*source_callback_add) (int fd, int events, int timeout, - receive_data_callback callback, void *user_data); -typedef void (*datafeed_callback) (struct sr_device *device, - struct sr_datafeed_packet *packet); +typedef void (*sr_datafeed_callback) (struct sr_device *device, + struct sr_datafeed_packet *packet); /* Session setup */ int sr_session_load(const char *filename); @@ -104,13 +101,15 @@ void sr_session_destroy(void); void 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 analyzer *pa); +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(datafeed_callback callback); +void sr_session_datafeed_callback_add(sr_datafeed_callback callback); /* Session control */ int sr_session_start(void); @@ -119,9 +118,9 @@ 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_save(char *filename); +int sr_session_save(const char *filename); void sr_session_source_add(int fd, int events, int timeout, - receive_data_callback callback, void *user_data); + sr_receive_data_callback callback, void *user_data); void sr_session_source_remove(int fd); /*--- input/input.c ---------------------------------------------------------*/