From: Uwe Hermann Date: Wed, 29 Feb 2012 20:56:24 +0000 (+0100) Subject: sr/srd: Consistency fixes for callbacks. X-Git-Tag: libsigrokdecode-0.1.0~41 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4c1d067068fdb9e5f723b3548bddb64e0b06fc36;p=libsigrokdecode.git sr/srd: Consistency fixes for callbacks. - Callback function pointer typedefs end with _t. - Variables holding callback functions are named 'cb' everywhere. --- diff --git a/controller.c b/controller.c index e49212c..ddac3ba 100644 --- a/controller.c +++ b/controller.c @@ -767,7 +767,7 @@ SRD_API int srd_session_feed(uint64_t start_samplenum, uint8_t *inbuf, * stack). * * @param output_type The output type this callback will receive. Only one - * callback per output type can be registered. + * callback per output type can be registered. * @param cb The function to call. * @param user_data Unused. */ @@ -784,7 +784,7 @@ SRD_API int srd_register_callback(int output_type, } pd_cb->output_type = output_type; - pd_cb->callback = cb; + pd_cb->cb = cb; pd_cb->user_data = user_data; callbacks = g_slist_append(callbacks, pd_cb); @@ -801,7 +801,7 @@ SRD_PRIV void *srd_find_callback(int output_type) for (l = callbacks; l; l = l->next) { pd_cb = l->data; if (pd_cb->output_type == output_type) { - cb = pd_cb->callback; + cb = pd_cb->cb; break; } } diff --git a/sigrokdecode.h b/sigrokdecode.h index 649cdc6..b70dace 100644 --- a/sigrokdecode.h +++ b/sigrokdecode.h @@ -178,7 +178,7 @@ typedef void (*srd_pd_output_callback_t)(struct srd_proto_data *pdata, struct srd_pd_callback { int output_type; - srd_pd_output_callback_t callback; + srd_pd_output_callback_t cb; void *user_data; };