]> sigrok.org Git - libsigrokdecode.git/blobdiff - sigrokdecode.h
srd: change struct srd_pd_output to have a path to the DI, not the decoder.
[libsigrokdecode.git] / sigrokdecode.h
index 2649d868018623920a341fe41da0f871d57cf18a..0f332b2cc7b965110e2789bdcea782d46d2e1329 100644 (file)
@@ -99,6 +99,12 @@ struct srd_decoder {
        /** TODO */
        GSList *outputformats;
 
+       /** Probes */
+       GSList *probes;
+
+       /** Optional probes */
+       GSList *extra_probes;
+
        /* List of NULL-terminated char[], containing descriptions of the
         * supported annotation output.
         */
@@ -111,21 +117,30 @@ struct srd_decoder {
        PyObject *py_dec;
 };
 
+struct srd_probe {
+       char *id;
+       char *name;
+       char *desc;
+       int order;
+};
+
 struct srd_decoder_instance {
        struct srd_decoder *decoder;
        PyObject *py_instance;
        char *instance_id;
        GSList *pd_output;
-       int num_probes;
-       int unitsize;
-       uint64_t samplerate;
+       int dec_num_probes;
+       int *dec_probemap;
+       int data_num_probes;
+       int data_unitsize;
+       uint64_t data_samplerate;
        GSList *next_di;
 };
 
 struct srd_pd_output {
        int pdo_id;
        int output_type;
-       struct srd_decoder *decoder;
+       struct srd_decoder_instance *di;
        char *proto_id;
 };
 
@@ -191,8 +206,12 @@ int srd_load_all_decoders(void);
 int srd_unload_all_decoders(void);
 char *srd_decoder_doc(struct srd_decoder *dec);
 
+/*--- exception.c -----------------------------------------------------------*/
+void catch_exception(const char *format, ...);
+
 /*--- util.c ----------------------------------------------------------------*/
 int py_attr_as_str(PyObject *py_obj, const char *attr, char **outstr);
+int py_dictitem_as_str(PyObject *py_obj, const char *key, char **outstr);
 int py_str_as_str(PyObject *py_str, char **outstr);
 int py_strlist_to_char(PyObject *py_strlist, char ***outstr);