]> sigrok.org Git - libsigrok.git/blobdiff - hwplugin.c
sr: Random cosmetics, fix/amend Doxygen comments.
[libsigrok.git] / hwplugin.c
index f73d0082a33d24ae6f4ce8edf6398d442e478bf1..368bb82783577385acfa29f736f62296ffb8507b 100644 (file)
@@ -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 load_hwplugins(void)
+SR_PRIV int sr_hw_load_all(void)
 {
 #ifdef HAVE_LA_DEMO
        plugins = g_slist_append(plugins, (gpointer *)&demo_plugin_info);
@@ -101,16 +101,15 @@ SR_PRIV int load_hwplugins(void)
 }
 
 /**
- * Returns the list of loaded hardware plugins.
+ * Return the list of loaded hardware plugins.
  *
  * The list of plugins is initialized from sr_init(), and can only be reset
  * by calling sr_exit().
  *
  * @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 +123,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 +153,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;
@@ -187,7 +186,7 @@ SR_PRIV struct sr_device_instance *sr_dev_inst_new(int index, int status,
        return sdi;
 }
 
-SR_PRIV struct sr_device_instance *sr_get_dev_inst(
+SR_PRIV struct sr_device_instance *sr_dev_inst_get(
                GSList *device_instances, int device_index)
 {
        struct sr_device_instance *sdi;
@@ -264,18 +263,18 @@ SR_PRIV void sr_serial_dev_inst_free(
 }
 
 /**
- * Find out if a list of hardware plugin capabilities has a specific cap.
+ * Find out if a hardware plugin has a specific capability.
  *
- * @param capabilities A NULL-terminated integer array of capabilities, as
- * returned by a plugin's get_capabilities() function.
+ * @param plugin The hardware plugin in which to search for the capability.
  * @param hwcap The capability to find in the list.
  *
  * @return TRUE if found, FALSE otherwise.
  */
-SR_API gboolean sr_has_hwcap(int *capabilities, int hwcap)
+SR_API gboolean sr_hw_has_hwcap(struct sr_device_plugin *plugin, int hwcap)
 {
-       int i;
+       int *capabilities, i;
 
+       capabilities = plugin->get_capabilities();
        for (i = 0; capabilities[i]; i++) {
                if (capabilities[i] == hwcap)
                        return TRUE;
@@ -285,14 +284,14 @@ SR_API gboolean sr_has_hwcap(int *capabilities, int hwcap)
 }
 
 /**
- * Find a hardware plugin capability option parameter structure.
+ * 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.
+ * @return A pointer to a struct with information about the parameter, or NULL
+ *         if the capability was not found.
  */
-SR_API struct sr_hwcap_option *sr_find_hwcap_option(int hwcap)
+SR_API struct sr_hwcap_option *sr_hw_hwcap_get(int hwcap)
 {
        int i;