From: Bert Vermeulen Date: Wed, 15 Feb 2012 02:18:48 +0000 (+0100) Subject: sr: rename all sr_hwplugin(s)_* functions to sr_hw_* X-Git-Tag: libsigrok-0.1.0~119 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=93a04e3be9cdaa276d9e7fe14da053483b567b74;p=libsigrok.git sr: rename all sr_hwplugin(s)_* functions to sr_hw_* --- diff --git a/backend.c b/backend.c index 34771f76..b60bce8b 100644 --- a/backend.c +++ b/backend.c @@ -28,7 +28,7 @@ */ SR_API int sr_init(void) { - return sr_hwplugins_load(); + return sr_hw_load_all(); } /** @@ -38,7 +38,7 @@ SR_API int sr_init(void) */ SR_API int sr_exit(void) { - sr_hwplugins_cleanup(); + sr_hw_cleanup_all(); return SR_OK; } diff --git a/device.c b/device.c index 790264ac..b3b229c0 100644 --- a/device.c +++ b/device.c @@ -62,7 +62,7 @@ SR_API int sr_dev_scan(void) GSList *plugins, *l; struct sr_device_plugin *plugin; - if (!(plugins = sr_hwplugins_list())) { + if (!(plugins = sr_hw_list())) { sr_err("dev: %s: no supported devices/hwplugins", __func__); return SR_ERR; /* TODO: More specific error? */ } @@ -75,7 +75,7 @@ SR_API int sr_dev_scan(void) for (l = plugins; l; l = l->next) { plugin = l->data; /* TODO: Handle 'plugin' being NULL. */ - sr_hwplugin_init(plugin); + sr_hw_init(plugin); } return SR_OK; diff --git a/hwplugin.c b/hwplugin.c index 6caa39db..212ab20c 100644 --- a/hwplugin.c +++ b/hwplugin.c @@ -68,7 +68,7 @@ extern struct sr_device_plugin alsa_plugin_info; #endif /* TODO: No linked list needed, this can be a simple array. */ -SR_PRIV int sr_hwplugins_load(void) +SR_PRIV int sr_hw_load_all(void) { #ifdef HAVE_LA_DEMO plugins = g_slist_append(plugins, (gpointer *)&demo_plugin_info); @@ -108,7 +108,7 @@ SR_PRIV int sr_hwplugins_load(void) * * @return A GSList of pointers to loaded plugins. */ -SR_API GSList *sr_hwplugins_list(void) +SR_API GSList *sr_hw_list(void) { return plugins; @@ -124,7 +124,7 @@ SR_API GSList *sr_hwplugins_list(void) * * @return The number of devices found and instantiated by the plugin. */ -SR_API int sr_hwplugin_init(struct sr_device_plugin *plugin) +SR_API int sr_hw_init(struct sr_device_plugin *plugin) { int num_devices, num_probes, i, j; int num_initialized_devices = 0; @@ -154,7 +154,7 @@ SR_API int sr_hwplugin_init(struct sr_device_plugin *plugin) return num_initialized_devices; } -SR_PRIV void sr_hwplugins_cleanup(void) +SR_PRIV void sr_hw_cleanup_all(void) { struct sr_device_plugin *plugin; GSList *l; @@ -272,7 +272,7 @@ SR_PRIV void sr_serial_dev_inst_free( * * @return TRUE if found, FALSE otherwise. */ -SR_API gboolean sr_hwplugin_has_hwcap(struct sr_device_plugin *plugin, int hwcap) +SR_API gboolean sr_hw_has_hwcap(struct sr_device_plugin *plugin, int hwcap) { int *capabilities, i; @@ -286,14 +286,14 @@ SR_API gboolean sr_hwplugin_has_hwcap(struct sr_device_plugin *plugin, int hwcap } /** - * Find a hardware plugin capability option. + * Get a hardware plugin capability option. * - * @param hwcap The capability to find + * @param hwcap The capability to get. * * @return A struct with information about the parameter, or NULL * if not found. */ -SR_API struct sr_hwcap_option *sr_hwplugins_hwcap_get(int hwcap) +SR_API struct sr_hwcap_option *sr_hw_hwcap_get(int hwcap) { int i; diff --git a/sigrok-internal.h b/sigrok-internal.h index 4f4a7389..8b939201 100644 --- a/sigrok-internal.h +++ b/sigrok-internal.h @@ -77,8 +77,8 @@ SR_PRIV int sr_err(const char *format, ...); /*--- hwplugin.c ------------------------------------------------------------*/ -SR_PRIV int sr_hwplugins_load(void); -SR_PRIV void sr_hwplugins_cleanup(void); +SR_PRIV int sr_hw_load_all(void); +SR_PRIV void sr_hw_cleanup_all(void); /*--- session.c -------------------------------------------------------------*/ diff --git a/sigrok-proto.h b/sigrok-proto.h index 5c4cfa85..f133b3cc 100644 --- a/sigrok-proto.h +++ b/sigrok-proto.h @@ -72,10 +72,10 @@ SR_API int sr_filter_probes(int in_unitsize, int out_unitsize, /*--- hwplugin.c ------------------------------------------------------------*/ -SR_API GSList *sr_hwplugins_list(void); -SR_API int sr_hwplugin_init(struct sr_device_plugin *plugin); -SR_API gboolean sr_hwplugin_has_hwcap(struct sr_device_plugin *plugin, int hwcap); -SR_API struct sr_hwcap_option *sr_hwplugins_hwcap_get(int hwcap); +SR_API GSList *sr_hw_list(void); +SR_API int sr_hw_init(struct sr_device_plugin *plugin); +SR_API gboolean sr_hw_has_hwcap(struct sr_device_plugin *plugin, int hwcap); +SR_API struct sr_hwcap_option *sr_hw_hwcap_get(int hwcap); /*--- session.c -------------------------------------------------------------*/