X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=include%2Flibsigrok%2Fproto.h;h=1aa2ee7649d9cb7433c5218f25fbb2eec39245f4;hb=3cd4b381744eb88fd4ba32565bd408c33b431629;hp=9f11747ace456ae3c6a2acb83a6996a355ce37c8;hpb=988357ca2f0cb0d0e066111c12b9c0de74a53a1b;p=libsigrok.git diff --git a/include/libsigrok/proto.h b/include/libsigrok/proto.h index 9f11747a..1aa2ee76 100644 --- a/include/libsigrok/proto.h +++ b/include/libsigrok/proto.h @@ -33,7 +33,7 @@ SR_API int sr_analog_to_float(const struct sr_datafeed_analog2 *analog, SR_API int sr_analog_float_to_string(float value, int digits, char **result); SR_API int sr_analog_unit_to_string(const struct sr_datafeed_analog2 *analog, char **result); -SR_API inline void sr_rational_set(struct sr_rational *r, uint64_t p, uint64_t q); +SR_API void sr_rational_set(struct sr_rational *r, uint64_t p, uint64_t q); /*--- backend.c -------------------------------------------------------------*/ @@ -54,9 +54,9 @@ SR_API char *sr_log_logdomain_get(void); /*--- device.c --------------------------------------------------------------*/ -SR_API int sr_dev_channel_name_set(const struct sr_dev_inst *sdi, - int channelnum, const char *name); -SR_API int sr_dev_channel_enable(const struct sr_dev_inst *sdi, int channelnum, +SR_API int sr_dev_channel_name_set(struct sr_channel *channel, + const char *name); +SR_API int sr_dev_channel_enable(struct sr_channel *channel, gboolean state); SR_API gboolean sr_dev_has_option(const struct sr_dev_inst *sdi, int key); SR_API GSList *sr_dev_list(const struct sr_dev_driver *driver); @@ -79,7 +79,7 @@ SR_API int sr_dev_inst_channel_add(struct sr_dev_inst *sdi, int index, int type, /*--- hwdriver.c ------------------------------------------------------------*/ -SR_API struct sr_dev_driver **sr_driver_list(void); +SR_API struct sr_dev_driver **sr_driver_list(const struct sr_context *ctx); SR_API int sr_driver_init(struct sr_context *ctx, struct sr_dev_driver *driver); SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options); @@ -105,8 +105,9 @@ typedef void (*sr_datafeed_callback)(const struct sr_dev_inst *sdi, SR_API struct sr_trigger *sr_session_trigger_get(struct sr_session *session); /* Session setup */ -SR_API int sr_session_load(const char *filename, struct sr_session **session); -SR_API int sr_session_new(struct sr_session **session); +SR_API int sr_session_load(struct sr_context *ctx, const char *filename, + struct sr_session **session); +SR_API int sr_session_new(struct sr_context *ctx, struct sr_session **session); SR_API int sr_session_destroy(struct sr_session *session); SR_API int sr_session_dev_remove_all(struct sr_session *session); SR_API int sr_session_dev_add(struct sr_session *session, @@ -154,6 +155,8 @@ SR_API const char *const *sr_input_extensions_get( const struct sr_input_module *imod); SR_API const struct sr_input_module *sr_input_find(char *id); SR_API const struct sr_option **sr_input_options_get(const struct sr_input_module *imod); +SR_API gboolean sr_output_test_flag(const struct sr_output_module *omod, + uint64_t flag); SR_API void sr_input_options_free(const struct sr_option **options); SR_API struct sr_input *sr_input_new(const struct sr_input_module *imod, GHashTable *options); @@ -176,7 +179,8 @@ SR_API const struct sr_output_module *sr_output_find(char *id); SR_API const struct sr_option **sr_output_options_get(const struct sr_output_module *omod); SR_API void sr_output_options_free(const struct sr_option **opts); SR_API const struct sr_output *sr_output_new(const struct sr_output_module *omod, - GHashTable *params, const struct sr_dev_inst *sdi); + GHashTable *params, const struct sr_dev_inst *sdi, + const char *filename); SR_API int sr_output_send(const struct sr_output *o, const struct sr_datafeed_packet *packet, GString **out); SR_API int sr_output_free(const struct sr_output *o);