From: Uwe Hermann Date: Wed, 28 Mar 2012 19:55:48 +0000 (+0200) Subject: sr: s/_clear/_remove_all/ for consistency. X-Git-Tag: libsigrok-0.1.0~14 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=01c3e9dbd5bd583012fc1f46237bf4fde784d209;p=libsigrok.git sr: s/_clear/_remove_all/ for consistency. --- diff --git a/device.c b/device.c index 99e9c378..63b1f100 100644 --- a/device.c +++ b/device.c @@ -283,7 +283,7 @@ SR_API int sr_dev_probe_name_set(struct sr_dev *dev, int probenum, * @return SR_OK upon success, SR_ERR_ARG upon invalid arguments. * If something other than SR_OK is returned, 'dev' is unchanged. */ -SR_API int sr_dev_trigger_clear(struct sr_dev *dev) +SR_API int sr_dev_trigger_remove_all(struct sr_dev *dev) { struct sr_probe *p; unsigned int pnum; /* TODO: uint16_t? */ @@ -311,7 +311,10 @@ SR_API int sr_dev_trigger_clear(struct sr_dev *dev) } /** - * Add a trigger to the specified device. + * Add a trigger to the specified device (and the specified probe). + * + * If the specified probe of this device already has a trigger, it will + * be silently replaced. * * TODO: Better description. * TODO: Describe valid format of the 'trigger' string. diff --git a/session.c b/session.c index 8048fdfd..f1a8370b 100644 --- a/session.c +++ b/session.c @@ -97,7 +97,7 @@ SR_API int sr_session_destroy(void) * * @return SR_OK upon success, SR_ERR_BUG if no session exists. */ -SR_API int sr_session_dev_clear(void) +SR_API int sr_session_dev_remove_all(void) { if (!session) { sr_err("session: %s: session was NULL", __func__); @@ -159,11 +159,11 @@ SR_API int sr_session_dev_add(struct sr_dev *dev) } /** - * Clear all datafeed callbacks in the current session. + * Remove all datafeed callbacks in the current session. * * @return SR_OK upon success, SR_ERR_BUG if no session exists. */ -SR_API int sr_session_datafeed_callback_clear(void) +SR_API int sr_session_datafeed_callback_remove_all(void) { if (!session) { sr_err("session: %s: session was NULL", __func__); diff --git a/sigrok-proto.h b/sigrok-proto.h index 2c45c01e..70342a13 100644 --- a/sigrok-proto.h +++ b/sigrok-proto.h @@ -56,7 +56,7 @@ SR_API struct sr_probe *sr_dev_probe_find(const struct sr_dev *dev, int probenum); SR_API int sr_dev_probe_name_set(struct sr_dev *dev, int probenum, const char *name); -SR_API int sr_dev_trigger_clear(struct sr_dev *dev); +SR_API int sr_dev_trigger_remove_all(struct sr_dev *dev); SR_API int sr_dev_trigger_set(struct sr_dev *dev, int probenum, const char *trigger); SR_API gboolean sr_dev_has_hwcap(const struct sr_dev *dev, int hwcap); @@ -85,11 +85,11 @@ typedef void (*sr_datafeed_callback_t)(struct sr_dev *dev, SR_API int sr_session_load(const char *filename); SR_API struct sr_session *sr_session_new(void); SR_API int sr_session_destroy(void); -SR_API int sr_session_dev_clear(void); +SR_API int sr_session_dev_remove_all(void); SR_API int sr_session_dev_add(struct sr_dev *dev); /* Datafeed setup */ -SR_API int sr_session_datafeed_callback_clear(void); +SR_API int sr_session_datafeed_callback_remove_all(void); SR_API int sr_session_datafeed_callback_add(sr_datafeed_callback_t cb); /* Session control */