X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=libsigrokdecode.h;h=a2055e2fecf3ae10c44605133e55185b26f62b56;hp=7f75ab2d5baf2a16e1ef951d11d4653260ec2bd6;hb=4539e9ca58966ce3c9cad4801b16c315e86ace01;hpb=f6c7eade2b8853b3d525b5cc0402e89ca74c1908 diff --git a/libsigrokdecode.h b/libsigrokdecode.h index 7f75ab2..a2055e2 100644 --- a/libsigrokdecode.h +++ b/libsigrokdecode.h @@ -15,12 +15,11 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ -#ifndef LIBSIGROKDECODE_SIGROKDECODE_H -#define LIBSIGROKDECODE_SIGROKDECODE_H +#ifndef LIBSIGROKDECODE_LIBSIGROKDECODE_H +#define LIBSIGROKDECODE_LIBSIGROKDECODE_H #include #include @@ -179,7 +178,7 @@ struct srd_decoder { */ GSList *binary; - /** List of decoder options. */ + /** List of decoder options. */ GSList *options; /** Python module. */ @@ -208,7 +207,7 @@ struct srd_decoder_option { char *id; char *desc; GVariant *def; - GSList *values; + GSList *values; }; struct srd_decoder_annotation_row { @@ -228,6 +227,43 @@ struct srd_decoder_inst { int data_unitsize; uint8_t *channel_samples; GSList *next_di; + + /** List of conditions a PD wants to wait for. */ + GSList *condition_list; + + /** Array of booleans denoting which conditions matched. */ + GArray *match_array; + + /** Absolute start sample number. */ + uint64_t start_samplenum; + + /** Absolute end sample number. */ + uint64_t end_samplenum; + + /** Pointer to the buffer/chunk of input samples. */ + const uint8_t *inbuf; + + /** Length (in bytes) of the input sample buffer. */ + uint64_t inbuflen; + + /** Absolute current samplenumber. */ + uint64_t cur_samplenum; + + /** Array of "old" (previous sample) pin values. */ + GArray *old_pins_array; + + /** Handle for this PD stack's worker thread. */ + GThread *thread_handle; + + /** Indicates whether new samples are available for processing. */ + gboolean got_new_samples; + + /** Indicates whether the worker thread has handled all samples. */ + gboolean handled_all_samples; + + GCond got_new_samples_cond; + GCond handled_all_samples_cond; + GMutex data_mutex; }; struct srd_pd_output { @@ -248,7 +284,7 @@ struct srd_proto_data { void *data; }; struct srd_proto_data_annotation { - int ann_format; + int ann_class; char **ann_text; }; struct srd_proto_data_binary { @@ -277,7 +313,7 @@ SRD_API int srd_session_metadata_set(struct srd_session *sess, int key, GVariant *data); SRD_API int srd_session_send(struct srd_session *sess, uint64_t start_samplenum, uint64_t end_samplenum, - const uint8_t *inbuf, uint64_t inbuflen); + const uint8_t *inbuf, uint64_t inbuflen, uint64_t unitsize); SRD_API int srd_session_destroy(struct srd_session *sess); SRD_API int srd_pd_output_callback_add(struct srd_session *sess, int output_type, srd_pd_output_callback cb, void *cb_data); @@ -295,7 +331,7 @@ SRD_API int srd_decoder_unload_all(void); SRD_API int srd_inst_option_set(struct srd_decoder_inst *di, GHashTable *options); SRD_API int srd_inst_channel_set_all(struct srd_decoder_inst *di, - GHashTable *channels, int unit_size); + GHashTable *channels); SRD_API struct srd_decoder_inst *srd_inst_new(struct srd_session *sess, const char *id, GHashTable *options); SRD_API int srd_inst_stack(struct srd_session *sess, @@ -310,8 +346,6 @@ SRD_API int srd_log_loglevel_set(int loglevel); SRD_API int srd_log_loglevel_get(void); SRD_API int srd_log_callback_set(srd_log_callback cb, void *cb_data); SRD_API int srd_log_callback_set_default(void); -SRD_API int srd_log_logdomain_set(const char *logdomain); -SRD_API char *srd_log_logdomain_get(void); /* error.c */ SRD_API const char *srd_strerror(int error_code);