X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=sigrokdecode.h;h=84b1aff9692eb7cf6ce543ddd44d27fd1c2d7fc2;hp=0558a4f51fd63776dc472a6ee5dab4797bec1c9f;hb=41a5d9624022856f4ef357c1fdce041a9774a99c;hpb=ee4ed2279e3d3d4b2911aa2a1ed4effcbd1bbe60 diff --git a/sigrokdecode.h b/sigrokdecode.h index 0558a4f..84b1aff 100644 --- a/sigrokdecode.h +++ b/sigrokdecode.h @@ -174,12 +174,12 @@ struct srd_proto_data { }; typedef void (*srd_pd_output_callback_t)(struct srd_proto_data *pdata, - void *user_data); + void *cb_data); struct srd_pd_callback { int output_type; - srd_pd_output_callback_t callback; - void *user_data; + srd_pd_output_callback_t cb; + void *cb_data; }; /* custom python types */ @@ -201,49 +201,40 @@ typedef struct { SRD_API int srd_init(char *path); SRD_API int srd_exit(void); -SRD_PRIV int add_modulepath(const char *path); -SRD_API int srd_inst_set_options(struct srd_decoder_inst *di, +SRD_API int srd_inst_options_set(struct srd_decoder_inst *di, GHashTable *options); -SRD_API int srd_inst_set_probes(struct srd_decoder_inst *di, +SRD_API int srd_inst_probes_set(struct srd_decoder_inst *di, GHashTable *probes); SRD_API struct srd_decoder_inst *srd_inst_new(const char *id, GHashTable *options); SRD_API int srd_inst_stack(struct srd_decoder_inst *di_from, struct srd_decoder_inst *di_to); SRD_API struct srd_decoder_inst *srd_inst_find_by_id(char *inst_id); -SRD_PRIV int srd_inst_start(struct srd_decoder_inst *di, PyObject *args); -SRD_API int srd_inst_decode(uint64_t start_samplenum, - struct srd_decoder_inst *dec, - uint8_t *inbuf, uint64_t inbuflen); -SRD_API void srd_inst_free(struct srd_decoder_inst *di); -SRD_API void srd_inst_free_all(GSList *stack); SRD_API int srd_session_start(int num_probes, int unitsize, uint64_t samplerate); SRD_API int srd_session_feed(uint64_t start_samplenum, uint8_t *inbuf, uint64_t inbuflen); -SRD_API struct srd_decoder_inst *get_di_by_decobject(void *decobject); SRD_API int srd_register_callback(int output_type, - srd_pd_output_callback_t cb, void *user_data); -SRD_API void *srd_find_callback(int output_type); + srd_pd_output_callback_t cb, void *cb_data); /*--- decoder.c -------------------------------------------------------------*/ -SRD_API GSList *srd_list_decoders(void); -SRD_API struct srd_decoder *srd_get_decoder_by_id(const char *id); -SRD_API int srd_load_decoder(const char *name, struct srd_decoder **dec); -SRD_API int srd_unload_decoder(struct srd_decoder *dec); -SRD_API int srd_load_all_decoders(void); -SRD_API int srd_unload_all_decoders(void); +SRD_API GSList *srd_decoders_list(void); +SRD_API struct srd_decoder *srd_decoder_get_by_id(const char *id); +SRD_API int srd_decoder_load(const char *name); +SRD_API int srd_decoder_unload(struct srd_decoder *dec); +SRD_API int srd_decoders_load_all(void); +SRD_API int srd_decoders_unload_all(void); SRD_API char *srd_decoder_doc(struct srd_decoder *dec); /*--- log.c -----------------------------------------------------------------*/ -typedef int (*srd_log_handler_t)(void *user_data, int loglevel, +typedef int (*srd_log_handler_t)(void *cb_data, int loglevel, const char *format, va_list args); SRD_API int srd_log_loglevel_set(int loglevel); SRD_API int srd_log_loglevel_get(void); -SRD_API int srd_log_handler_set(srd_log_handler_t handler, void *user_data); +SRD_API int srd_log_handler_set(srd_log_handler_t handler, void *cb_data); SRD_API int srd_log_handler_set_default(void); SRD_API int srd_log_logdomain_set(const char *logdomain); SRD_API char *srd_log_logdomain_get(void);