]> sigrok.org Git - libsigrok.git/blobdiff - sigrok.h
sr/cli/gtk/qt: s/device/dev/ in many places.
[libsigrok.git] / sigrok.h
index bba9cba05caf03d40178d9a613f3025835e59657..a7a92bf212e42fc52c500a5cde30a1558630df75 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
@@ -1,7 +1,7 @@
 /*
  * This file is part of the sigrok project.
  *
- * Copyright (C) 2012 Bert Vermeulen <bert@biot.com>
+ * Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -66,12 +66,12 @@ extern "C" {
 #define SR_HZ_TO_NS(n) (1000000000 / (n))
 
 /* libsigrok loglevels. */
-#define SR_LOG_NONE               0 /**< Output no messages at all. */
+#define SR_LOG_NONE           0 /**< Output no messages at all. */
 #define SR_LOG_ERR            1 /**< Output error messages. */
-#define SR_LOG_WARN               2 /**< Output warnings. */
-#define SR_LOG_INFO               3 /**< Output informational messages. */
+#define SR_LOG_WARN           2 /**< Output warnings. */
+#define SR_LOG_INFO           3 /**< Output informational messages. */
 #define SR_LOG_DBG            4 /**< Output debug messages. */
-#define SR_LOG_SPEW               5 /**< Output very noisy debug messages. */
+#define SR_LOG_SPEW           5 /**< Output very noisy debug messages. */
 
 /*
  * Use SR_API to mark public API symbols, and SR_PRIV for private symbols.
@@ -131,7 +131,7 @@ struct sr_datafeed_logic {
 struct sr_input {
        struct sr_input_format *format;
        char *param;
-       struct sr_device *vdevice;
+       struct sr_dev *vdev;
 };
 
 struct sr_input_format {
@@ -144,7 +144,7 @@ struct sr_input_format {
 
 struct sr_output {
        struct sr_output_format *format;
-       struct sr_device *device;
+       struct sr_dev *dev;
        char *param;
        void *internal;
 };
@@ -171,11 +171,11 @@ struct sr_datastore {
  * This represents a generic device connected to the system.
  * For device-specific information, ask the plugin. The plugin_index refers
  * to the device index within that plugin; it may be handling more than one
- * device. All relevant plugin calls take a device_index parameter for this.
+ * device. All relevant plugin calls take a dev_index parameter for this.
  */
-struct sr_device {
+struct sr_dev {
        /* Which plugin handles this device */
-       struct sr_device_plugin *plugin;
+       struct sr_dev_plugin *plugin;
        /* A plugin may handle multiple devices of the same type */
        int plugin_index;
        /* List of struct sr_probe* */
@@ -210,7 +210,7 @@ enum {
        /*--- Device types --------------------------------------------------*/
 
        /** The device is demo device. */
-       SR_HWCAP_DEMO_DEVICE,
+       SR_HWCAP_DEMO_DEV,
 
        /*--- Device options ------------------------------------------------*/
 
@@ -276,7 +276,7 @@ struct sr_hwcap_option {
        char *shortname;
 };
 
-struct sr_device_instance {
+struct sr_dev_inst {
        int index;
        int status;
        int instance_type;
@@ -286,7 +286,7 @@ struct sr_device_instance {
        void *priv;
 };
 
-/* sr_device_instance types */
+/* sr_dev_inst types */
 enum {
        SR_USB_INSTANCE,
        SR_SERIAL_INSTANCE,
@@ -310,7 +310,7 @@ enum {
 
 /* Device info IDs */
 enum {
-       /* struct sr_device_instance for this specific device */
+       /* struct sr_dev_inst for this specific device */
        SR_DI_INSTANCE,
        /* The number of probes connected to this device */
        SR_DI_NUM_PROBES,
@@ -338,28 +338,28 @@ struct sr_samplerates {
        uint64_t *list;
 };
 
-struct sr_device_plugin {
+struct sr_dev_plugin {
        /* Plugin-specific */
        char *name;
        char *longname;
        int api_version;
-       int (*init) (const char *deviceinfo);
-       void (*cleanup) (void);
+       int (*init) (const char *devinfo);
+       int (*cleanup) (void);
 
        /* Device-specific */
-       int (*opendev) (int device_index);
-       int (*closedev) (int device_index);
-       void *(*get_device_info) (int device_index, int device_info_id);
-       int (*get_status) (int device_index);
+       int (*opendev) (int dev_index);
+       int (*closedev) (int dev_index);
+       void *(*get_dev_info) (int dev_index, int dev_info_id);
+       int (*get_status) (int dev_index);
        int *(*get_capabilities) (void);
-       int (*set_configuration) (int device_index, int capability, void *value);
-       int (*start_acquisition) (int device_index, gpointer session_device_id);
-       void (*stop_acquisition) (int device_index, gpointer session_device_id);
+       int (*set_configuration) (int dev_index, int capability, void *value);
+       int (*start_acquisition) (int dev_index, gpointer session_dev_id);
+       int (*stop_acquisition) (int dev_index, gpointer session_dev_id);
 };
 
 struct sr_session {
-       /* List of struct sr_device* */
-       GSList *devices;
+       /* List of struct sr_dev* */
+       GSList *devs;
        /* list of sr_receive_data_callback */
        GSList *datafeed_callbacks;
        GTimeVal starttime;