MCPcopy Create free account
hub / github.com/Pulse-Eight/libcec / SetCallback

Method SetCallback

src/libcec/SwigHelper.h:149–161  ·  view source on GitHub ↗

* Set a python callable as callback * @param cb the callback to set * @param pyfunc the python callable to call */

Source from the content-addressed store, hash-verified

147 * @param pyfunc the python callable to call
148 */
149 void SetCallback(size_t cb, PyObject* pyfunc)
150 {
151 assert(cb < NB_PYTHON_CB);
152 assert(PyCallable_Check(pyfunc));
153
154 /** unref previous callback (if any) */
155 if (!!m_callbacks[cb])
156 Py_XDECREF(m_callbacks[cb]);
157
158 /** set the new callback */
159 m_callbacks[cb] = pyfunc;
160 Py_XINCREF(pyfunc);
161 }
162
163 private:
164 static inline int CallPythonCallback(void* param, enum libcecSwigCallback callback, PyObject* arglist)

Callers 1

_SetCallbackFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected