X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=sigrokdecode.h.in;h=7aac0bae8e6659f0fc4b9223039278a916172099;hp=ad7b602d73dee3ef56741fc49817e65e174feaba;hb=8c664ca2d7b4faffa7b3dbeb3b9e491976c24eee;hpb=a4cb05f748a1104faba456217a762befc4faf2f3 diff --git a/sigrokdecode.h.in b/sigrokdecode.h.in index ad7b602..7aac0ba 100644 --- a/sigrokdecode.h.in +++ b/sigrokdecode.h.in @@ -1,5 +1,5 @@ /* - * This file is part of the sigrok project. + * This file is part of the libsigrokdecode project. * * Copyright (C) 2010 Uwe Hermann * Copyright (C) 2012 Bert Vermeulen @@ -30,6 +30,22 @@ extern "C" { #endif +/** + * @file + * + * The public libsigrokdecode header file to be used by frontends. + * + * This is the only file that libsigrokdecode users (frontends) are supposed + * to use and include. There are other header files which get installed with + * libsigrokdecode, but those are not meant to be used directly by frontends. + * + * The correct way to get/use the libsigrokdecode API functions is: + * + * @code{.c} + * #include + * @endcode + */ + /* * Package version macros (can be used for conditional compilation). */ @@ -99,7 +115,7 @@ extern "C" { * Use SRD_API to mark public API symbols, and SRD_PRIV for private symbols. * * Variables and functions marked 'static' are private already and don't - * need SR_PRIV. However, functions which are not static (because they need + * need SRD_PRIV. However, functions which are not static (because they need * to be used in other libsigrokdecode-internal files) but are also not * meant to be part of the public libsigrokdecode API, must use SRD_PRIV. * @@ -139,7 +155,6 @@ enum { #define SRD_MAX_NUM_PROBES 64 -/* TODO: Documentation. */ struct srd_decoder { /** The decoder ID. Must be non-NULL and unique for all decoders. */ char *id; @@ -171,6 +186,9 @@ struct srd_decoder { */ GSList *annotations; + /** List of decoder options. */ + GSList *options; + /** Python module. */ PyObject *py_mod; @@ -193,6 +211,12 @@ struct srd_probe { int order; }; +struct srd_decoder_option { + char *id; + char *desc; + GVariant *def; +}; + struct srd_decoder_inst { struct srd_decoder *decoder; PyObject *py_inst; @@ -251,24 +275,23 @@ typedef struct { SRD_API int srd_init(const char *path); SRD_API int srd_exit(void); SRD_API int srd_inst_option_set(struct srd_decoder_inst *di, - GHashTable *options); + GHashTable *options); SRD_API int srd_inst_probe_set_all(struct srd_decoder_inst *di, - GHashTable *probes); + GHashTable *probes); SRD_API struct srd_decoder_inst *srd_inst_new(const char *id, - GHashTable *options); + GHashTable *options); SRD_API int srd_inst_stack(struct srd_decoder_inst *di_from, - struct srd_decoder_inst *di_to); + struct srd_decoder_inst *di_to); SRD_API struct srd_decoder_inst *srd_inst_find_by_id(const char *inst_id); -SRD_API int srd_session_start(int num_probes, int unitsize, - uint64_t samplerate); +SRD_API int srd_session_start(int num_probes, int unitsize, uint64_t samplerate); SRD_API int srd_session_send(uint64_t start_samplenum, const uint8_t *inbuf, - uint64_t inbuflen); + uint64_t inbuflen); SRD_API int srd_pd_output_callback_add(int output_type, - srd_pd_output_callback_t cb, void *cb_data); + srd_pd_output_callback_t cb, void *cb_data); /*--- decoder.c -------------------------------------------------------------*/ -SRD_API GSList *srd_decoder_list(void); +SRD_API const GSList *srd_decoder_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);