MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / srd_decoder_apiver

Function srd_decoder_apiver

libsigrokdecode4DSL/decoder.c:699–718  ·  view source on GitHub ↗

* Get the API version of the specified decoder. * * @param d The decoder to use. Must not be NULL. * * @return The API version of the decoder, or 0 upon errors. * * @private */

Source from the content-addressed store, hash-verified

697 * @private
698 */
699SRD_PRIV long srd_decoder_apiver(const struct srd_decoder *d)
700{
701 PyObject *py_apiver;
702 long apiver;
703 PyGILState_STATE gstate;
704
705 if (!d)
706 return 0;
707
708 gstate = PyGILState_Ensure();
709
710 py_apiver = PyObject_GetAttrString(d->py_dec, "api_version");
711 apiver = (py_apiver && PyLong_Check(py_apiver))
712 ? PyLong_AsLong(py_apiver) : 0;
713 Py_XDECREF(py_apiver);
714
715 PyGILState_Release(gstate);
716
717 return apiver;
718}
719
720/**
721 * Load a protocol decoder module into the embedded Python interpreter.

Callers 1

srd_decoder_loadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected