X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=log.c;h=de7360398456d2f087155f712281b6ed8ee53360;hp=459a5c10be9023ad2422a4c35a015abfd79f95ee;hb=51a91ed0e544e1e5c214040b714b5263846700c0;hpb=5292279cbe4c228bbc31b8caf05eb6ebdfa29bde diff --git a/log.c b/log.c index 459a5c1..de73603 100644 --- a/log.c +++ b/log.c @@ -129,6 +129,28 @@ SRD_API int srd_log_callback_set(srd_log_callback cb, void *cb_data) return SRD_OK; } +/** + * Get the libsigrokdecode log callback routine and callback data. + * + * @param[out] cb Pointer to a function pointer to receive the log callback + * function. Optional, can be NULL. + * @param[out] cb_data Pointer to a void pointer to receive the log callback's + * additional arguments. Optional, can be NULL. + * + * @return SRD_OK upon success. + * + * @since 0.5.2 + */ +SRD_API int srd_log_callback_get(srd_log_callback *cb, void **cb_data) +{ + if (cb) + *cb = srd_log_cb; + if (cb_data) + *cb_data = srd_log_cb_data; + + return SRD_OK; +} + /** * Set the libsigrokdecode log callback to the default built-in one. *