const unsigned char *data;
};
-typedef void (*srd_pd_output_callback_t)(struct srd_proto_data *pdata,
- void *cb_data);
+typedef void (*srd_pd_output_callback)(struct srd_proto_data *pdata,
+ void *cb_data);
struct srd_pd_callback {
int output_type;
- srd_pd_output_callback_t cb;
+ srd_pd_output_callback cb;
void *cb_data;
};
const uint8_t *inbuf, uint64_t inbuflen);
SRD_API int srd_session_destroy(struct srd_session *sess);
SRD_API int srd_pd_output_callback_add(struct srd_session *sess,
- int output_type, srd_pd_output_callback_t cb, void *cb_data);
+ int output_type, srd_pd_output_callback cb, void *cb_data);
/* decoder.c */
SRD_API const GSList *srd_decoder_list(void);
const char *inst_id);
/* log.c */
-typedef int (*srd_log_callback_t)(void *cb_data, int loglevel,
+typedef int (*srd_log_callback)(void *cb_data, int loglevel,
const char *format, va_list args);
SRD_API int srd_log_loglevel_set(int loglevel);
SRD_API int srd_log_loglevel_get(void);
-SRD_API int srd_log_callback_set(srd_log_callback_t cb, void *cb_data);
+SRD_API int srd_log_callback_set(srd_log_callback cb, void *cb_data);
SRD_API int srd_log_callback_set_default(void);
SRD_API int srd_log_logdomain_set(const char *logdomain);
SRD_API char *srd_log_logdomain_get(void);
va_list args);
/* Pointer to the currently selected log callback. Default: srd_logv(). */
-static srd_log_callback_t srd_log_callback = srd_logv;
+static srd_log_callback srd_log_cb = srd_logv;
/*
* Pointer to private data that can be passed to the log callback.
* This can be used (for example) by C++ GUIs to pass a "this" pointer.
*/
-static void *srd_log_callback_data = NULL;
+static void *srd_log_cb_data = NULL;
/* Log domain (a short string that is used as prefix for all messages). */
/** @cond PRIVATE */
*
* @since 0.1.0
*/
-SRD_API int srd_log_callback_set(srd_log_callback_t cb, void *cb_data)
+SRD_API int srd_log_callback_set(srd_log_callback cb, void *cb_data)
{
if (!cb) {
srd_err("log: %s: cb was NULL", __func__);
/* Note: 'cb_data' is allowed to be NULL. */
- srd_log_callback = cb;
- srd_log_callback_data = cb_data;
+ srd_log_cb = cb;
+ srd_log_cb_data = cb_data;
return SRD_OK;
}
/**
* Set the libsigrokdecode log callback to the default built-in one.
*
- * Additionally, the internal 'srd_log_callback_data' pointer is set to NULL.
+ * Additionally, the internal 'srd_log_cb_data' pointer is set to NULL.
*
* @return SRD_OK upon success, a (negative) error code otherwise.
*
* Note: No log output in this function, as it should safely work
* even if the currently set log callback is buggy/broken.
*/
- srd_log_callback = srd_logv;
- srd_log_callback_data = NULL;
+ srd_log_cb = srd_logv;
+ srd_log_cb_data = NULL;
return SRD_OK;
}
va_list args;
va_start(args, format);
- ret = srd_log_callback(srd_log_callback_data, loglevel, format, args);
+ ret = srd_log_cb(srd_log_cb_data, loglevel, format, args);
va_end(args);
return ret;
va_list args;
va_start(args, format);
- ret = srd_log_callback(srd_log_callback_data, SRD_LOG_SPEW,
- format, args);
+ ret = srd_log_cb(srd_log_cb_data, SRD_LOG_SPEW, format, args);
va_end(args);
return ret;
va_list args;
va_start(args, format);
- ret = srd_log_callback(srd_log_callback_data, SRD_LOG_DBG,
- format, args);
+ ret = srd_log_cb(srd_log_cb_data, SRD_LOG_DBG, format, args);
va_end(args);
return ret;
va_list args;
va_start(args, format);
- ret = srd_log_callback(srd_log_callback_data, SRD_LOG_INFO,
- format, args);
+ ret = srd_log_cb(srd_log_cb_data, SRD_LOG_INFO, format, args);
va_end(args);
return ret;
va_list args;
va_start(args, format);
- ret = srd_log_callback(srd_log_callback_data, SRD_LOG_WARN,
- format, args);
+ ret = srd_log_cb(srd_log_cb_data, SRD_LOG_WARN, format, args);
va_end(args);
return ret;
va_list args;
va_start(args, format);
- ret = srd_log_callback(srd_log_callback_data, SRD_LOG_ERR,
- format, args);
+ ret = srd_log_cb(srd_log_cb_data, SRD_LOG_ERR, format, args);
va_end(args);
return ret;