libsigrokdecode  0.4.1
sigrok protocol decoding library
Functions
Protocol decoders

Handling protocol decoders. More...

Functions

const GSList * srd_decoder_list (void)
 Returns the list of loaded protocol decoders. More...
 
struct srd_decodersrd_decoder_get_by_id (const char *id)
 Get the decoder with the specified ID. More...
 
SRD_PRIV long srd_decoder_apiver (const struct srd_decoder *d)
 Get the API version of the specified decoder. More...
 
int srd_decoder_load (const char *module_name)
 Load a protocol decoder module into the embedded Python interpreter. More...
 
char * srd_decoder_doc_get (const struct srd_decoder *dec)
 Return a protocol decoder's docstring. More...
 
int srd_decoder_unload (struct srd_decoder *dec)
 Unload the specified protocol decoder. More...
 
int srd_decoder_load_all (void)
 Load all installed protocol decoders. More...
 
int srd_decoder_unload_all (void)
 Unload all loaded protocol decoders. More...
 

Detailed Description

Handling protocol decoders.

Function Documentation

SRD_PRIV long srd_decoder_apiver ( const struct srd_decoder d)

Get the API version of the specified decoder.

Parameters
dThe decoder to use. Must not be NULL.
Returns
The API version of the decoder, or 0 upon errors.

Definition at line 596 of file decoder.c.

References srd_decoder::py_dec.

Referenced by srd_decoder_load(), and srd_inst_find_by_id().

+ Here is the caller graph for this function:

char* srd_decoder_doc_get ( const struct srd_decoder dec)

Return a protocol decoder's docstring.

Parameters
decThe loaded protocol decoder.
Returns
A newly allocated buffer containing the protocol decoder's documentation. The caller is responsible for free'ing the buffer.
Since
0.1.0

Definition at line 795 of file decoder.c.

References srd_decoder::py_mod.

struct srd_decoder* srd_decoder_get_by_id ( const char *  id)
const GSList* srd_decoder_list ( void  )

Returns the list of loaded protocol decoders.

This is a GSList of pointers to struct srd_decoder items.

Returns
List of decoders, NULL if none are supported or loaded.
Since
0.2.0

Definition at line 75 of file decoder.c.

int srd_decoder_load ( const char *  module_name)

Load a protocol decoder module into the embedded Python interpreter.

Parameters
module_nameThe module name to be loaded.
Returns
SRD_OK upon success, a (negative) error code otherwise.
Since
0.1.0

Definition at line 621 of file decoder.c.

References srd_decoder::channels, srd_decoder::desc, srd_decoder::id, srd_decoder::license, srd_decoder::longname, srd_decoder::name, srd_decoder::opt_channels, srd_decoder::py_dec, srd_decoder::py_mod, srd_decoder_apiver(), SRD_ERR, SRD_ERR_ARG, SRD_ERR_PYTHON, and SRD_OK.

Referenced by srd_decoder_unload().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int srd_decoder_load_all ( void  )

Load all installed protocol decoders.

Returns
SRD_OK upon success, a (negative) error code otherwise.
Since
0.1.0

Definition at line 973 of file decoder.c.

References SRD_ERR, and SRD_OK.

int srd_decoder_unload ( struct srd_decoder dec)

Unload the specified protocol decoder.

Parameters
decThe struct srd_decoder to be unloaded.
Returns
SRD_OK upon success, a (negative) error code otherwise.
Since
0.1.0

Definition at line 831 of file decoder.c.

References srd_decoder::name, srd_decoder_load(), SRD_ERR, SRD_ERR_ARG, and SRD_OK.

Referenced by srd_decoder_unload_all().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int srd_decoder_unload_all ( void  )

Unload all loaded protocol decoders.

Returns
SRD_OK upon success, a (negative) error code otherwise.
Since
0.1.0

Definition at line 993 of file decoder.c.

References srd_decoder_unload(), and SRD_OK.

Referenced by srd_exit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: