]> sigrok.org Git - libsigrok.git/blobdiff - sigrok.h
Prefix device structs with sr_.
[libsigrok.git] / sigrok.h
index a2d707ac7f3b9ab88bd5e21b99caa45f7529818c..20bd59430a9df6c08bd4634c9162162348a3f967 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
@@ -92,7 +92,7 @@ struct protocol {
        int stackindex;
 };
 
-/* datafeed_packet.type values */
+/* sr_datafeed_packet.type values */
 enum {
        DF_HEADER,
        DF_END,
@@ -102,14 +102,14 @@ enum {
        DF_PD,
 };
 
-struct datafeed_packet {
+struct sr_datafeed_packet {
        uint16_t type;
        uint64_t length;
        uint16_t unitsize;
        void *payload;
 };
 
-struct datafeed_header {
+struct sr_datafeed_header {
        int feed_version;
        struct timeval starttime;
        uint64_t samplerate;
@@ -129,35 +129,35 @@ struct analog_sample {
        struct analog_probe probes[];
 };
 
-struct input {
-       struct input_format *format;
+struct sr_input {
+       struct sr_input_format *format;
        char *param;
-       struct device *vdevice;
+       struct sr_device *vdevice;
 };
 
-struct input_format {
+struct sr_input_format {
        char *extension;
        char *description;
        int (*format_match) (const char *filename);
-       int (*init) (struct input *in);
-       int (*loadfile) (struct input *in, const char *filename);
+       int (*init) (struct sr_input *in);
+       int (*loadfile) (struct sr_input *in, const char *filename);
 };
 
-struct output {
-       struct output_format *format;
-       struct device *device;
+struct sr_output {
+       struct sr_output_format *format;
+       struct sr_device *device;
        char *param;
        void *internal;
 };
 
-struct output_format {
+struct sr_output_format {
        char *extension;
        char *description;
        int df_type;
-       int (*init) (struct output *o);
-       int (*data) (struct output *o, char *data_in, uint64_t length_in,
+       int (*init) (struct sr_output *o);
+       int (*data) (struct sr_output *o, char *data_in, uint64_t length_in,
                     char **data_out, uint64_t *length_out);
-       int (*event) (struct output *o, int event_type, char **data_out,
+       int (*event) (struct sr_output *o, int event_type, char **data_out,
                      uint64_t *length_out);
 };
 
@@ -186,9 +186,9 @@ struct datastore {
  * 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.
  */
-struct device {
+struct sr_device {
        /* Which plugin handles this device */
-       struct device_plugin *plugin;
+       struct sr_device_plugin *plugin;
        /* A plugin may handle multiple devices of the same type */
        int plugin_index;
        /* List of struct probe* */
@@ -237,7 +237,7 @@ struct hwcap_option {
        char *shortname;
 };
 
-struct sigrok_device_instance {
+struct sr_device_instance {
        int index;
        int status;
        int instance_type;
@@ -251,7 +251,7 @@ struct sigrok_device_instance {
        };
 };
 
-/* sigrok_device_instance types */
+/* sr_device_instance types */
 enum {
        USB_INSTANCE,
        SERIAL_INSTANCE,
@@ -286,7 +286,7 @@ enum {
 
 /* Device info IDs */
 enum {
-       /* struct sigrok_device_instance for this specific device */
+       /* struct sr_device_instance for this specific device */
        DI_INSTANCE,
        /* The number of probes connected to this device */
        DI_NUM_PROBES,
@@ -312,9 +312,10 @@ struct samplerates {
        uint64_t *list;
 };
 
-struct device_plugin {
+struct sr_device_plugin {
        /* Plugin-specific */
        char *name;
+       char *longname;
        int api_version;
        int (*init) (char *deviceinfo);
        void (*cleanup) (void);
@@ -338,7 +339,7 @@ struct gsource_fd {
 };
 
 struct session {
-       /* List of struct device* */
+       /* List of struct sr_device* */
        GSList *devices;
        /* List of struct analyzer* */
        GSList *analyzers;