]> sigrok.org Git - libsigrokdecode.git/blobdiff - sigrokdecode.h
move srd_Decoder to sigrokdecode.h, and rename it in line with srd_logic
[libsigrokdecode.git] / sigrokdecode.h
index cf52264493052b5600aaa16719f28dfac13f3a44..71d0ae478b69e2e2da8a0657e7a3d747fd86885c 100644 (file)
@@ -64,8 +64,8 @@ extern "C" {
 #define SRD_LOG_SPEW   5 /**< Output very noisy debug messages. */
 
 enum {
-       SRD_OUTPUT_ANNOTATION,
-       SRD_OUTPUT_PROTOCOL,
+       SRD_OUTPUT_ANN,
+       SRD_OUTPUT_PROTO,
        SRD_OUTPUT_BINARY,
        /* When adding an output type, don't forget to expose it to PDs in:
         *     controller.c:PyInit_sigrokdecode()
@@ -111,7 +111,7 @@ struct srd_decoder {
        /* List of NULL-terminated char[], containing descriptions of the
         * supported annotation output.
         */
-       GSList *annotation;
+       GSList *annotations;
 
        /** TODO */
        PyObject *py_mod;
@@ -135,34 +135,39 @@ struct srd_pd_output {
        int pdo_id;
        int output_type;
        struct srd_decoder *decoder;
-       char *protocol_id;
+       char *proto_id;
 };
 
-typedef struct {
-       PyObject_HEAD
-       struct srd_decoder_instance *di;
-       unsigned int itercnt;
-       uint8_t *inbuf;
-       uint64_t inbuflen;
-       PyObject *sample;
-} srd_logic;
-
-struct srd_protocol_data {
+struct srd_proto_data {
        uint64_t start_sample;
        uint64_t end_sample;
        struct srd_pd_output *pdo;
-       int annotation_format;
+       int ann_format;
        void *data;
 };
 
 struct srd_pd_callback {
        int output_type;
-       void (*callback)(struct srd_protocol_data *);
+       void (*callback)(struct srd_proto_data *);
 };
 
 
-/*--- controller.c ----------------------------------------------------------*/
+/* custom python types */
+typedef struct {
+       PyObject_HEAD
+} srd_Decoder;
 
+typedef struct {
+       PyObject_HEAD
+       struct srd_decoder_instance *di;
+       unsigned int itercnt;
+       uint8_t *inbuf;
+       uint64_t inbuflen;
+       PyObject *sample;
+} srd_logic;
+
+
+/*--- controller.c ----------------------------------------------------------*/
 int srd_init(void);
 int srd_exit(void);
 int set_modulepath(void);