sr: s/_clear/_remove_all/ for consistency.

This commit is contained in:
Uwe Hermann 2012-03-28 21:55:48 +02:00
parent 054e670906
commit 01c3e9dbd5
3 changed files with 11 additions and 8 deletions

View File

@ -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. * @return SR_OK upon success, SR_ERR_ARG upon invalid arguments.
* If something other than SR_OK is returned, 'dev' is unchanged. * 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; struct sr_probe *p;
unsigned int pnum; /* TODO: uint16_t? */ 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: Better description.
* TODO: Describe valid format of the 'trigger' string. * TODO: Describe valid format of the 'trigger' string.

View File

@ -97,7 +97,7 @@ SR_API int sr_session_destroy(void)
* *
* @return SR_OK upon success, SR_ERR_BUG if no session exists. * @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) { if (!session) {
sr_err("session: %s: session was NULL", __func__); 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. * @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) { if (!session) {
sr_err("session: %s: session was NULL", __func__); sr_err("session: %s: session was NULL", __func__);

View File

@ -56,7 +56,7 @@ SR_API struct sr_probe *sr_dev_probe_find(const struct sr_dev *dev,
int probenum); int probenum);
SR_API int sr_dev_probe_name_set(struct sr_dev *dev, int probenum, SR_API int sr_dev_probe_name_set(struct sr_dev *dev, int probenum,
const char *name); 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, SR_API int sr_dev_trigger_set(struct sr_dev *dev, int probenum,
const char *trigger); const char *trigger);
SR_API gboolean sr_dev_has_hwcap(const struct sr_dev *dev, int hwcap); 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 int sr_session_load(const char *filename);
SR_API struct sr_session *sr_session_new(void); SR_API struct sr_session *sr_session_new(void);
SR_API int sr_session_destroy(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); SR_API int sr_session_dev_add(struct sr_dev *dev);
/* Datafeed setup */ /* 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); SR_API int sr_session_datafeed_callback_add(sr_datafeed_callback_t cb);
/* Session control */ /* Session control */