commit 0a1dc8488db6b6aa7f08fb5f50eb284230969714 parent f8ab6e0a1c3753a5dd856779637f74932b204002 Author: Christian Grothoff <grothoff@gnu.org> Date: Sat, 2 May 2026 22:05:50 +0200 improve type-safety by using the CLOSURE macros as intended Diffstat:
65 files changed, 202 insertions(+), 136 deletions(-)
diff --git a/src/backend/taler-merchant-depositcheck.c b/src/backend/taler-merchant-depositcheck.c @@ -19,6 +19,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct ExchangeInteraction; +#define TALER_EXCHANGE_GET_DEPOSITS_RESULT_CLOSURE struct ExchangeInteraction #include "microhttpd.h" #include <gnunet/gnunet_util_lib.h> #include <jansson.h> @@ -419,10 +421,9 @@ run_at (struct GNUNET_TIME_Absolute deadline) */ static void deposit_get_cb ( - void *cls, + struct ExchangeInteraction *w, const struct TALER_EXCHANGE_GetDepositsResponse *dr) { - struct ExchangeInteraction *w = cls; struct GNUNET_TIME_Absolute future_retry; w->dgh = NULL; diff --git a/src/backend/taler-merchant-httpd_post-orders-ORDER_ID-abort.c b/src/backend/taler-merchant-httpd_post-orders-ORDER_ID-abort.c @@ -24,6 +24,8 @@ * @author Florian Dold */ #include "platform.h" +struct RefundDetails; +#define TALER_EXCHANGE_POST_COINS_REFUND_RESULT_CLOSURE struct RefundDetails #include <taler/taler_json_lib.h> #include <taler/taler_exchange_service.h> #include "taler-merchant-httpd_exchanges.h" @@ -498,10 +500,9 @@ find_next_exchange (struct AbortContext *ac); * @param rr response data */ static void -refund_cb (void *cls, +refund_cb (struct RefundDetails *rd, const struct TALER_EXCHANGE_PostCoinsRefundResponse *rr) { - struct RefundDetails *rd = cls; const struct TALER_EXCHANGE_HttpResponse *hr = &rr->hr; struct AbortContext *ac = rd->ac; diff --git a/src/backend/taler-merchant-httpd_post-orders-ORDER_ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ORDER_ID-pay.c @@ -25,6 +25,8 @@ * @author Florian Dold */ #include "platform.h" +struct ExchangeGroup; +#define TALER_EXCHANGE_POST_BATCH_DEPOSIT_RESULT_CLOSURE struct ExchangeGroup #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_db_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -1250,10 +1252,9 @@ do_batch_deposits (struct ExchangeGroup *eg); */ static void batch_deposit_cb ( - void *cls, + struct ExchangeGroup *eg, const struct TALER_EXCHANGE_PostBatchDepositResponse *dr) { - struct ExchangeGroup *eg = cls; struct PayContext *pc = eg->pc; eg->bdh = NULL; diff --git a/src/backend/taler-merchant-httpd_post-orders-ORDER_ID-refund.c b/src/backend/taler-merchant-httpd_post-orders-ORDER_ID-refund.c @@ -23,6 +23,8 @@ * @author Jonathan Buchanan */ #include "platform.h" +struct CoinRefund; +#define TALER_EXCHANGE_POST_COINS_REFUND_RESULT_CLOSURE struct CoinRefund #include <taler/taler_dbevents.h> #include <taler/taler_signatures.h> #include <taler/taler_json_lib.h> @@ -395,10 +397,9 @@ notify_refund_obtained (struct PostRefundData *prd) * @param rr response data */ static void -refund_cb (void *cls, +refund_cb (struct CoinRefund *cr, const struct TALER_EXCHANGE_PostCoinsRefundResponse *rr) { - struct CoinRefund *cr = cls; const struct TALER_EXCHANGE_HttpResponse *hr = &rr->hr; cr->rh = NULL; diff --git a/src/backend/taler-merchant-kyccheck.c b/src/backend/taler-merchant-kyccheck.c @@ -19,6 +19,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct Inquiry; +#define TALER_EXCHANGE_GET_KYC_CHECK_RESULT_CLOSURE struct Inquiry #include "microhttpd.h" #include <gnunet/gnunet_util_lib.h> #include <jansson.h> @@ -531,10 +533,9 @@ store_kyc_status ( */ static void exchange_check_cb ( - void *cls, + struct Inquiry *i, const struct TALER_EXCHANGE_GetKycCheckResponse *ks) { - struct Inquiry *i = cls; bool progress = false; i->kyc = NULL; diff --git a/src/backend/taler-merchant-reconciliation.c b/src/backend/taler-merchant-reconciliation.c @@ -19,6 +19,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct Inquiry; +#define TALER_EXCHANGE_GET_TRANSFERS_RESULT_CLOSURE struct Inquiry #include "microhttpd.h" #include <gnunet/gnunet_util_lib.h> #include <jansson.h> @@ -713,10 +715,9 @@ check_transfer (void *cls, * @param tgr response details */ static void -wire_transfer_cb (void *cls, +wire_transfer_cb (struct Inquiry *w, const struct TALER_EXCHANGE_GetTransfersResponse *tgr) { - struct Inquiry *w = cls; struct Exchange *e = w->exchange; const struct TALER_EXCHANGE_TransferData *td = NULL; diff --git a/src/testing/testing_api_cmd_abort_order.c b/src/testing/testing_api_cmd_abort_order.c @@ -22,6 +22,8 @@ * @author Marcello Stanisci */ #include "platform.h" +struct AbortState; +#define TALER_MERCHANT_POST_ORDERS_ABORT_RESULT_CLOSURE struct AbortState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include <taler/taler_signatures.h> @@ -168,10 +170,9 @@ build_coins (struct TALER_MERCHANT_PostOrdersAbortCoin **ac, * @param ar response */ static void -abort_cb (void *cls, +abort_cb (struct AbortState *as, const struct TALER_MERCHANT_PostOrdersAbortResponse *ar) { - struct AbortState *as = cls; as->oah = NULL; if (as->http_status != ar->hr.http_status) diff --git a/src/testing/testing_api_cmd_claim_order.c b/src/testing/testing_api_cmd_claim_order.c @@ -23,6 +23,8 @@ * @author Marcello Stanisci */ #include "platform.h" +struct OrderClaimState; +#define TALER_MERCHANT_POST_ORDERS_CLAIM_RESULT_CLOSURE struct OrderClaimState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -127,10 +129,9 @@ order_claim_cleanup (void *cls, * @param ocr response we got */ static void -order_claim_cb (void *cls, +order_claim_cb (struct OrderClaimState *pls, const struct TALER_MERCHANT_PostOrdersClaimResponse *ocr) { - struct OrderClaimState *pls = cls; pls->och = NULL; if (pls->http_status != ocr->hr.http_status) diff --git a/src/testing/testing_api_cmd_config.c b/src/testing/testing_api_cmd_config.c @@ -24,6 +24,8 @@ */ #include "platform.h" +struct ConfigState; +#define TALER_MERCHANT_GET_CONFIG_RESULT_CLOSURE struct ConfigState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_testing_lib.h" @@ -87,10 +89,9 @@ config_cleanup (void *cls, * @param cr response we got */ static void -config_cb (void *cls, +config_cb (struct ConfigState *cs, const struct TALER_MERCHANT_GetConfigResponse *cr) { - struct ConfigState *cs = cls; cs->vgh = NULL; if (cs->http_code != cr->hr.http_status) diff --git a/src/testing/testing_api_cmd_delete_account.c b/src/testing/testing_api_cmd_delete_account.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct DeleteAccountState; +#define TALER_MERCHANT_DELETE_PRIVATE_ACCOUNT_RESULT_CLOSURE struct DeleteAccountState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -70,11 +72,10 @@ struct DeleteAccountState * @param adr response being processed */ static void -delete_account_cb (void *cls, +delete_account_cb (struct DeleteAccountState *das, const struct TALER_MERCHANT_DeletePrivateAccountResponse *adr ) { - struct DeleteAccountState *das = cls; das->adh = NULL; if (das->http_status != adr->hr.http_status) diff --git a/src/testing/testing_api_cmd_delete_donau_instances.c b/src/testing/testing_api_cmd_delete_donau_instances.c @@ -21,6 +21,8 @@ */ #include "platform.h" +struct DeleteDonauState; +#define TALER_MERCHANT_DELETE_PRIVATE_DONAU_RESULT_CLOSURE struct DeleteDonauState #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" #include "taler/taler_merchant_testing_lib.h" @@ -64,10 +66,9 @@ struct DeleteDonauState * @param ddr HTTP response details */ static void -delete_donau_cb (void *cls, +delete_donau_cb (struct DeleteDonauState *dds, const struct TALER_MERCHANT_DeletePrivateDonauResponse *ddr) { - struct DeleteDonauState *dds = cls; dds->ddh = NULL; diff --git a/src/testing/testing_api_cmd_delete_instance.c b/src/testing/testing_api_cmd_delete_instance.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct DeleteInstanceState; +#define TALER_MERCHANT_DELETE_MANAGEMENT_INSTANCE_RESULT_CLOSURE struct DeleteInstanceState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -75,11 +77,10 @@ struct DeleteInstanceState * @param dir response being processed */ static void -delete_instance_cb (void *cls, +delete_instance_cb (struct DeleteInstanceState *dis, const struct TALER_MERCHANT_DeleteManagementInstanceResponse *dir) { - struct DeleteInstanceState *dis = cls; dis->igh = NULL; if (dis->http_status != dir->hr.http_status) diff --git a/src/testing/testing_api_cmd_delete_order.c b/src/testing/testing_api_cmd_delete_order.c @@ -22,6 +22,8 @@ * @author Jonathan Buchanan */ #include "platform.h" +struct DeleteOrderState; +#define TALER_MERCHANT_DELETE_PRIVATE_ORDER_RESULT_CLOSURE struct DeleteOrderState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -70,10 +72,9 @@ struct DeleteOrderState * @param dor response being processed */ static void -delete_order_cb (void *cls, +delete_order_cb (struct DeleteOrderState *dos, const struct TALER_MERCHANT_DeletePrivateOrderResponse *dor) { - struct DeleteOrderState *dos = cls; dos->odh = NULL; if (dos->http_status != dor->hr.http_status) diff --git a/src/testing/testing_api_cmd_delete_otp_device.c b/src/testing/testing_api_cmd_delete_otp_device.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct DeleteOtpDeviceState; +#define TALER_MERCHANT_DELETE_PRIVATE_OTP_DEVICE_RESULT_CLOSURE struct DeleteOtpDeviceState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -70,11 +72,10 @@ struct DeleteOtpDeviceState * @param dor response being processed */ static void -delete_otp_device_cb (void *cls, +delete_otp_device_cb (struct DeleteOtpDeviceState *dis, const struct TALER_MERCHANT_DeletePrivateOtpDeviceResponse *dor) { - struct DeleteOtpDeviceState *dis = cls; dis->tdh = NULL; if (dis->http_status != dor->hr.http_status) diff --git a/src/testing/testing_api_cmd_delete_product.c b/src/testing/testing_api_cmd_delete_product.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct DeleteProductState; +#define TALER_MERCHANT_DELETE_PRIVATE_PRODUCT_RESULT_CLOSURE struct DeleteProductState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -70,11 +72,10 @@ struct DeleteProductState * @param dpr response being processed */ static void -delete_product_cb (void *cls, +delete_product_cb (struct DeleteProductState *dis, const struct TALER_MERCHANT_DeletePrivateProductResponse *dpr ) { - struct DeleteProductState *dis = cls; dis->pdh = NULL; if (dis->http_status != dpr->hr.http_status) diff --git a/src/testing/testing_api_cmd_delete_template.c b/src/testing/testing_api_cmd_delete_template.c @@ -22,6 +22,8 @@ * @author Priscilla HUANG */ #include "platform.h" +struct DeleteTemplateState; +#define TALER_MERCHANT_DELETE_PRIVATE_TEMPLATE_RESULT_CLOSURE struct DeleteTemplateState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -70,11 +72,10 @@ struct DeleteTemplateState * @param dtr response being processed */ static void -delete_template_cb (void *cls, +delete_template_cb (struct DeleteTemplateState *dis, const struct TALER_MERCHANT_DeletePrivateTemplateResponse * dtr) { - struct DeleteTemplateState *dis = cls; dis->tdh = NULL; if (dis->http_status != dtr->hr.http_status) diff --git a/src/testing/testing_api_cmd_delete_transfer.c b/src/testing/testing_api_cmd_delete_transfer.c @@ -22,6 +22,8 @@ * @author Jonathan Buchanan */ #include "platform.h" +struct DeleteTransferState; +#define TALER_MERCHANT_DELETE_PRIVATE_TRANSFER_RESULT_CLOSURE struct DeleteTransferState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -70,11 +72,10 @@ struct DeleteTransferState * @param dtr response being processed */ static void -delete_transfer_cb (void *cls, +delete_transfer_cb (struct DeleteTransferState *dts, const struct TALER_MERCHANT_DeletePrivateTransferResponse * dtr) { - struct DeleteTransferState *dts = cls; dts->tdh = NULL; if (dts->http_status != dtr->hr.http_status) diff --git a/src/testing/testing_api_cmd_delete_unit.c b/src/testing/testing_api_cmd_delete_unit.c @@ -22,6 +22,8 @@ * @author Bohdan Potuzhnyi */ #include "platform.h" +struct DeleteUnitState; +#define TALER_MERCHANT_DELETE_PRIVATE_UNIT_RESULT_CLOSURE struct DeleteUnitState #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" #include "taler/taler_merchant_testing_lib.h" @@ -64,10 +66,9 @@ struct DeleteUnitState * Completion callback. */ static void -delete_unit_cb (void *cls, +delete_unit_cb (struct DeleteUnitState *dus, const struct TALER_MERCHANT_DeletePrivateUnitResponse *dur) { - struct DeleteUnitState *dus = cls; dus->udh = NULL; if (dus->http_status != dur->hr.http_status) diff --git a/src/testing/testing_api_cmd_delete_webhook.c b/src/testing/testing_api_cmd_delete_webhook.c @@ -22,6 +22,8 @@ * @author Priscilla HUANG */ #include "platform.h" +struct DeleteWebhookState; +#define TALER_MERCHANT_DELETE_PRIVATE_WEBHOOK_RESULT_CLOSURE struct DeleteWebhookState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -70,11 +72,10 @@ struct DeleteWebhookState * @param dwr response being processed */ static void -delete_webhook_cb (void *cls, +delete_webhook_cb (struct DeleteWebhookState *dis, const struct TALER_MERCHANT_DeletePrivateWebhookResponse *dwr ) { - struct DeleteWebhookState *dis = cls; dis->wdh = NULL; if (dis->http_status != dwr->hr.http_status) diff --git a/src/testing/testing_api_cmd_forget_order.c b/src/testing/testing_api_cmd_forget_order.c @@ -23,6 +23,8 @@ * @author Jonathan Buchanan */ #include "platform.h" +struct OrderForgetState; +#define TALER_MERCHANT_PATCH_PRIVATE_ORDERS_FORGET_RESULT_CLOSURE struct OrderForgetState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -114,11 +116,10 @@ order_forget_cleanup (void *cls, * @param result HTTP response we got */ static void -order_forget_cb (void *cls, +order_forget_cb (struct OrderForgetState *ofs, const struct TALER_MERCHANT_PatchPrivateOrdersForgetResponse * result) { - struct OrderForgetState *ofs = cls; const struct TALER_MERCHANT_HttpResponse *hr = &result->hr; ofs->ofh = NULL; diff --git a/src/testing/testing_api_cmd_get_donau_instances.c b/src/testing/testing_api_cmd_get_donau_instances.c @@ -23,6 +23,8 @@ * @author Vlada Svirsh */ #include "platform.h" +struct GetDonauInstancesState; +#define TALER_MERCHANT_GET_PRIVATE_DONAU_RESULT_CLOSURE struct GetDonauInstancesState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -67,11 +69,10 @@ struct GetDonauInstancesState * @param response response details from the Donau service */ static void -get_donau_instances_cb (void *cls, +get_donau_instances_cb (struct GetDonauInstancesState *gis, const struct TALER_MERCHANT_GetPrivateDonauResponse *response) { - struct GetDonauInstancesState *gis = cls; gis->dgh = NULL; diff --git a/src/testing/testing_api_cmd_get_instance.c b/src/testing/testing_api_cmd_get_instance.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct GetInstanceState; +#define TALER_MERCHANT_GET_MANAGEMENT_INSTANCE_RESULT_CLOSURE struct GetInstanceState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -80,10 +82,9 @@ struct GetInstanceState * @param igr response */ static void -get_instance_cb (void *cls, +get_instance_cb (struct GetInstanceState *gis, const struct TALER_MERCHANT_GetManagementInstanceResponse *igr) { - struct GetInstanceState *gis = cls; const struct TALER_TESTING_Command *instance_cmd; instance_cmd = TALER_TESTING_interpreter_lookup_command ( diff --git a/src/testing/testing_api_cmd_get_instances.c b/src/testing/testing_api_cmd_get_instances.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct GetInstancesState; +#define TALER_MERCHANT_GET_MANAGEMENT_INSTANCES_RESULT_CLOSURE struct GetInstancesState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -75,12 +77,11 @@ struct GetInstancesState * @param igr response */ static void -get_instances_cb (void *cls, +get_instances_cb (struct GetInstancesState *gis, const struct TALER_MERCHANT_GetManagementInstancesResponse * igr) { const struct TALER_MERCHANT_HttpResponse *hr = &igr->hr; - struct GetInstancesState *gis = cls; gis->igh = NULL; if (gis->http_status != hr->http_status) diff --git a/src/testing/testing_api_cmd_get_otp_device.c b/src/testing/testing_api_cmd_get_otp_device.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct GetOtpDeviceState; +#define TALER_MERCHANT_GET_PRIVATE_OTP_DEVICE_RESULT_CLOSURE struct GetOtpDeviceState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -75,10 +77,9 @@ struct GetOtpDeviceState * @param tgr HTTP response details */ static void -get_otp_device_cb (void *cls, +get_otp_device_cb (struct GetOtpDeviceState *gis, const struct TALER_MERCHANT_GetPrivateOtpDeviceResponse *tgr) { - struct GetOtpDeviceState *gis = cls; const struct TALER_TESTING_Command *otp_device_cmd; gis->igh = NULL; diff --git a/src/testing/testing_api_cmd_get_otp_devices.c b/src/testing/testing_api_cmd_get_otp_devices.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct GetOtpDevicesState; +#define TALER_MERCHANT_GET_PRIVATE_OTP_DEVICES_RESULT_CLOSURE struct GetOtpDevicesState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -75,11 +77,10 @@ struct GetOtpDevicesState * @param tgr response details */ static void -get_otp_devices_cb (void *cls, +get_otp_devices_cb (struct GetOtpDevicesState *gis, const struct TALER_MERCHANT_GetPrivateOtpDevicesResponse * tgr) { - struct GetOtpDevicesState *gis = cls; gis->igh = NULL; if (gis->http_status != tgr->hr.http_status) diff --git a/src/testing/testing_api_cmd_get_product.c b/src/testing/testing_api_cmd_get_product.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct GetProductState; +#define TALER_MERCHANT_GET_PRIVATE_PRODUCT_RESULT_CLOSURE struct GetProductState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -80,10 +82,9 @@ struct GetProductState * @param pgr response details */ static void -get_product_cb (void *cls, +get_product_cb (struct GetProductState *gis, const struct TALER_MERCHANT_GetPrivateProductResponse *pgr) { - struct GetProductState *gis = cls; const struct TALER_TESTING_Command *product_cmd; const struct TALER_TESTING_ProductUnitExpectations *ue = gis->unit_expectations; diff --git a/src/testing/testing_api_cmd_get_product_image.c b/src/testing/testing_api_cmd_get_product_image.c @@ -22,6 +22,8 @@ * @author Bohdan Potuzhnyi */ #include "platform.h" +struct GetProductImageState; +#define TALER_MERCHANT_GET_PRODUCTS_IMAGE_RESULT_CLOSURE struct GetProductImageState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -78,10 +80,9 @@ struct GetProductImageState * @param pir response details */ static void -get_product_image_cb (void *cls, +get_product_image_cb (struct GetProductImageState *gis, const struct TALER_MERCHANT_GetProductsImageResponse *pir) { - struct GetProductImageState *gis = cls; gis->pigh = NULL; if (gis->http_status != pir->hr.http_status) diff --git a/src/testing/testing_api_cmd_get_products.c b/src/testing/testing_api_cmd_get_products.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct GetProductsState; +#define TALER_MERCHANT_GET_PRIVATE_PRODUCTS_RESULT_CLOSURE struct GetProductsState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -75,10 +77,9 @@ struct GetProductsState * @param gpr response details */ static void -get_products_cb (void *cls, +get_products_cb (struct GetProductsState *gis, const struct TALER_MERCHANT_GetPrivateProductsResponse *gpr) { - struct GetProductsState *gis = cls; gis->igh = NULL; if (gis->http_status != gpr->hr.http_status) diff --git a/src/testing/testing_api_cmd_get_statisticsamount.c b/src/testing/testing_api_cmd_get_statisticsamount.c @@ -22,6 +22,8 @@ * @author Martin Schanzenbach */ #include "platform.h" +struct GetStatisticsAmountState; +#define TALER_MERCHANT_GET_PRIVATE_STATISTICS_AMOUNT_RESULT_CLOSURE struct GetStatisticsAmountState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -80,12 +82,11 @@ struct GetStatisticsAmountState * @param scgr response details */ static void -get_statisticsamount_cb (void *cls, +get_statisticsamount_cb (struct GetStatisticsAmountState *scs, const struct TALER_MERCHANT_GetPrivateStatisticsAmountResponse *scgr ) { - struct GetStatisticsAmountState *scs = cls; const struct TALER_MERCHANT_HttpResponse *hr = &scgr->hr; scs->scgh = NULL; diff --git a/src/testing/testing_api_cmd_get_statisticscounter.c b/src/testing/testing_api_cmd_get_statisticscounter.c @@ -22,6 +22,9 @@ * @author Martin Schanzenbach */ #include "platform.h" +struct GetStatisticsCounterState; +#define TALER_MERCHANT_GET_PRIVATE_STATISTICS_COUNTER_RESULT_CLOSURE struct \ + GetStatisticsCounterState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -81,10 +84,9 @@ struct GetStatisticsCounterState */ static void get_statisticscounter_cb ( - void *cls, + struct GetStatisticsCounterState *scs, const struct TALER_MERCHANT_GetPrivateStatisticsCounterResponse *scgr) { - struct GetStatisticsCounterState *scs = cls; const struct TALER_MERCHANT_HttpResponse *hr = &scgr->hr; scs->scgh = NULL; diff --git a/src/testing/testing_api_cmd_get_template.c b/src/testing/testing_api_cmd_get_template.c @@ -22,6 +22,8 @@ * @author Priscilla HUANG */ #include "platform.h" +struct GetTemplateState; +#define TALER_MERCHANT_GET_PRIVATE_TEMPLATE_RESULT_CLOSURE struct GetTemplateState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -75,10 +77,9 @@ struct GetTemplateState * @param tgr HTTP response details */ static void -get_template_cb (void *cls, +get_template_cb (struct GetTemplateState *gis, const struct TALER_MERCHANT_GetPrivateTemplateResponse *tgr) { - struct GetTemplateState *gis = cls; const struct TALER_TESTING_Command *template_cmd; gis->igh = NULL; diff --git a/src/testing/testing_api_cmd_get_templates.c b/src/testing/testing_api_cmd_get_templates.c @@ -22,6 +22,8 @@ * @author Priscilla HUANG */ #include "platform.h" +struct GetTemplatesState; +#define TALER_MERCHANT_GET_PRIVATE_TEMPLATES_RESULT_CLOSURE struct GetTemplatesState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -75,10 +77,9 @@ struct GetTemplatesState * @param tgr response details */ static void -get_templates_cb (void *cls, +get_templates_cb (struct GetTemplatesState *gis, const struct TALER_MERCHANT_GetPrivateTemplatesResponse *tgr) { - struct GetTemplatesState *gis = cls; gis->igh = NULL; if (gis->http_status != tgr->hr.http_status) diff --git a/src/testing/testing_api_cmd_get_transfers.c b/src/testing/testing_api_cmd_get_transfers.c @@ -23,6 +23,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct GetTransfersState; +#define TALER_MERCHANT_GET_PRIVATE_TRANSFERS_RESULT_CLOSURE struct GetTransfersState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -88,10 +90,9 @@ struct GetTransfersState */ static void get_transfers_cb ( - void *cls, + struct GetTransfersState *gts, const struct TALER_MERCHANT_GetPrivateTransfersResponse *gtr) { - struct GetTransfersState *gts = cls; gts->gth = NULL; if (gts->http_status != gtr->hr.http_status) diff --git a/src/testing/testing_api_cmd_get_unit.c b/src/testing/testing_api_cmd_get_unit.c @@ -22,6 +22,8 @@ * @author Bohdan Potuzhnyi */ #include "platform.h" +struct GetUnitState; +#define TALER_MERCHANT_GET_PRIVATE_UNIT_RESULT_CLOSURE struct GetUnitState #include <jansson.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -237,10 +239,9 @@ unit_matches_reference (const struct TALER_MERCHANT_UnitEntry *entry, * Completion callback. */ static void -get_unit_cb (void *cls, +get_unit_cb (struct GetUnitState *gug, const struct TALER_MERCHANT_GetPrivateUnitResponse *ugr) { - struct GetUnitState *gug = cls; gug->ugh = NULL; if (gug->http_status != ugr->hr.http_status) diff --git a/src/testing/testing_api_cmd_get_units.c b/src/testing/testing_api_cmd_get_units.c @@ -22,6 +22,8 @@ * @author Bohdan Potuzhnyi */ #include "platform.h" +struct GetUnitsState; +#define TALER_MERCHANT_GET_PRIVATE_UNITS_RESULT_CLOSURE struct GetUnitsState #include <jansson.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -217,10 +219,9 @@ check_unit_matches (const struct TALER_MERCHANT_UnitEntry *entry, * Completion callback for GET /private/units. */ static void -get_units_cb (void *cls, +get_units_cb (struct GetUnitsState *gus, const struct TALER_MERCHANT_GetPrivateUnitsResponse *ugr) { - struct GetUnitsState *gus = cls; gus->ugh = NULL; if (gus->http_status != ugr->hr.http_status) diff --git a/src/testing/testing_api_cmd_get_webhook.c b/src/testing/testing_api_cmd_get_webhook.c @@ -22,6 +22,8 @@ * @author Priscilla HUANG */ #include "platform.h" +struct GetWebhookState; +#define TALER_MERCHANT_GET_PRIVATE_WEBHOOK_RESULT_CLOSURE struct GetWebhookState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -75,10 +77,9 @@ struct GetWebhookState * @param wgr response details */ static void -get_webhook_cb (void *cls, +get_webhook_cb (struct GetWebhookState *gis, const struct TALER_MERCHANT_GetPrivateWebhookResponse *wgr) { - struct GetWebhookState *gis = cls; const struct TALER_TESTING_Command *webhook_cmd; gis->igh = NULL; diff --git a/src/testing/testing_api_cmd_get_webhooks.c b/src/testing/testing_api_cmd_get_webhooks.c @@ -22,6 +22,8 @@ * @author Priscilla HUANG */ #include "platform.h" +struct GetWebhooksState; +#define TALER_MERCHANT_GET_PRIVATE_WEBHOOKS_RESULT_CLOSURE struct GetWebhooksState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -75,10 +77,9 @@ struct GetWebhooksState * @param wgr response details */ static void -get_webhooks_cb (void *cls, +get_webhooks_cb (struct GetWebhooksState *gis, const struct TALER_MERCHANT_GetPrivateWebhooksResponse *wgr) { - struct GetWebhooksState *gis = cls; gis->igh = NULL; if (gis->http_status != wgr->hr.http_status) diff --git a/src/testing/testing_api_cmd_instance_auth.c b/src/testing/testing_api_cmd_instance_auth.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct AuthInstanceState; +#define TALER_MERCHANT_POST_MANAGEMENT_INSTANCES_AUTH_RESULT_CLOSURE struct AuthInstanceState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -75,11 +77,10 @@ struct AuthInstanceState * @param iar response being processed */ static void -auth_instance_cb (void *cls, +auth_instance_cb (struct AuthInstanceState *ais, const struct TALER_MERCHANT_PostManagementInstancesAuthResponse *iar) { - struct AuthInstanceState *ais = cls; ais->iaph = NULL; if (ais->http_status != iar->hr.http_status) diff --git a/src/testing/testing_api_cmd_instance_token.c b/src/testing/testing_api_cmd_instance_token.c @@ -22,6 +22,9 @@ * @author Martin Schanzenbach */ #include "platform.h" +struct TokenInstanceState; +#define TALER_MERCHANT_DELETE_PRIVATE_TOKEN_RESULT_CLOSURE struct TokenInstanceState +#define TALER_MERCHANT_POST_PRIVATE_TOKEN_RESULT_CLOSURE struct TokenInstanceState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -100,11 +103,10 @@ struct TokenInstanceState * @param ptr response being processed */ static void -token_instance_post_cb (void *cls, +token_instance_post_cb (struct TokenInstanceState *tis, const struct TALER_MERCHANT_PostPrivateTokenResponse * ptr) { - struct TokenInstanceState *tis = cls; tis->itph = NULL; if (tis->http_status != ptr->hr.http_status) @@ -146,10 +148,9 @@ token_instance_post_cb (void *cls, */ static void token_instance_delete_cb ( - void *cls, + struct TokenInstanceState *tis, const struct TALER_MERCHANT_DeletePrivateTokenResponse *dtr) { - struct TokenInstanceState *tis = cls; tis->itdh = NULL; if (tis->http_status != dtr->hr.http_status) diff --git a/src/testing/testing_api_cmd_kyc_get.c b/src/testing/testing_api_cmd_kyc_get.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct KycGetState; +#define TALER_MERCHANT_GET_PRIVATE_KYC_RESULT_CLOSURE struct KycGetState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -128,10 +130,9 @@ kyc_get_cleanup (void *cls, * @param kr response we got */ static void -kyc_get_cb (void *cls, +kyc_get_cb (struct KycGetState *cs, const struct TALER_MERCHANT_GetPrivateKycResponse *kr) { - struct KycGetState *cs = cls; cs->kgh = NULL; if (kr->hr.http_status != cs->expected_http_status) diff --git a/src/testing/testing_api_cmd_lock_product.c b/src/testing/testing_api_cmd_lock_product.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct LockProductState; +#define TALER_MERCHANT_POST_PRIVATE_PRODUCTS_LOCK_RESULT_CLOSURE struct LockProductState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -96,11 +98,10 @@ struct LockProductState * @param plr response being processed */ static void -lock_product_cb (void *cls, +lock_product_cb (struct LockProductState *pis, const struct TALER_MERCHANT_PostPrivateProductsLockResponse * plr) { - struct LockProductState *pis = cls; pis->iph = NULL; if (pis->http_status != plr->hr.http_status) diff --git a/src/testing/testing_api_cmd_patch_instance.c b/src/testing/testing_api_cmd_patch_instance.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct PatchInstanceState; +#define TALER_MERCHANT_PATCH_MANAGEMENT_INSTANCES_RESULT_CLOSURE struct PatchInstanceState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -100,11 +102,10 @@ struct PatchInstanceState * @param result response being processed */ static void -patch_instance_cb (void *cls, +patch_instance_cb (struct PatchInstanceState *pis, const struct TALER_MERCHANT_PatchManagementInstancesResponse *result) { - struct PatchInstanceState *pis = cls; const struct TALER_MERCHANT_HttpResponse *hr = &result->hr; pis->iph = NULL; diff --git a/src/testing/testing_api_cmd_patch_otp_device.c b/src/testing/testing_api_cmd_patch_otp_device.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct PatchOtpDeviceState; +#define TALER_MERCHANT_PATCH_PRIVATE_OTP_DEVICE_RESULT_CLOSURE struct PatchOtpDeviceState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -90,11 +92,10 @@ struct PatchOtpDeviceState * @param result response being processed */ static void -patch_otp_device_cb (void *cls, +patch_otp_device_cb (struct PatchOtpDeviceState *pis, const struct TALER_MERCHANT_PatchPrivateOtpDeviceResponse * result) { - struct PatchOtpDeviceState *pis = cls; const struct TALER_MERCHANT_HttpResponse *hr = &result->hr; pis->iph = NULL; diff --git a/src/testing/testing_api_cmd_patch_product.c b/src/testing/testing_api_cmd_patch_product.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct PatchProductState; +#define TALER_MERCHANT_PATCH_PRIVATE_PRODUCT_RESULT_CLOSURE struct PatchProductState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -244,11 +246,10 @@ default_precision_from_unit (const char *unit) * @param result response being processed */ static void -patch_product_cb (void *cls, +patch_product_cb (struct PatchProductState *pis, const struct TALER_MERCHANT_PatchPrivateProductResponse * result) { - struct PatchProductState *pis = cls; const struct TALER_MERCHANT_HttpResponse *hr = &result->hr; pis->iph = NULL; diff --git a/src/testing/testing_api_cmd_patch_template.c b/src/testing/testing_api_cmd_patch_template.c @@ -22,6 +22,8 @@ * @author Priscilla HUANG */ #include "platform.h" +struct PatchTemplateState; +#define TALER_MERCHANT_PATCH_PRIVATE_TEMPLATE_RESULT_CLOSURE struct PatchTemplateState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -85,11 +87,10 @@ struct PatchTemplateState * @param result response being processed */ static void -patch_template_cb (void *cls, +patch_template_cb (struct PatchTemplateState *pis, const struct TALER_MERCHANT_PatchPrivateTemplateResponse * result) { - struct PatchTemplateState *pis = cls; const struct TALER_MERCHANT_HttpResponse *hr = &result->hr; pis->iph = NULL; diff --git a/src/testing/testing_api_cmd_patch_unit.c b/src/testing/testing_api_cmd_patch_unit.c @@ -22,6 +22,8 @@ * @author Bohdan Potuzhnyi */ #include "platform.h" +struct PatchUnitState; +#define TALER_MERCHANT_PATCH_PRIVATE_UNIT_RESULT_CLOSURE struct PatchUnitState #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" #include "taler/taler_merchant_testing_lib.h" @@ -114,10 +116,9 @@ struct PatchUnitState * Completion callback for PATCH /private/units. */ static void -patch_unit_cb (void *cls, +patch_unit_cb (struct PatchUnitState *pus, const struct TALER_MERCHANT_PatchPrivateUnitResponse *result) { - struct PatchUnitState *pus = cls; const struct TALER_MERCHANT_HttpResponse *hr = &result->hr; pus->uph = NULL; diff --git a/src/testing/testing_api_cmd_patch_webhook.c b/src/testing/testing_api_cmd_patch_webhook.c @@ -22,6 +22,8 @@ * @author Priscilla HUANG */ #include "platform.h" +struct PatchWebhookState; +#define TALER_MERCHANT_PATCH_PRIVATE_WEBHOOK_RESULT_CLOSURE struct PatchWebhookState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -95,11 +97,10 @@ struct PatchWebhookState * @param result response being processed */ static void -patch_webhook_cb (void *cls, +patch_webhook_cb (struct PatchWebhookState *pis, const struct TALER_MERCHANT_PatchPrivateWebhookResponse * result) { - struct PatchWebhookState *pis = cls; const struct TALER_MERCHANT_HttpResponse *hr = &result->hr; pis->iph = NULL; diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c @@ -23,6 +23,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct PayState; +#define TALER_MERCHANT_POST_ORDERS_PAY_RESULT_CLOSURE struct PayState #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_json_lib.h> #include <gnunet/gnunet_time_lib.h> @@ -794,10 +796,9 @@ build_tokens (struct TALER_MERCHANT_PostOrdersPayUseToken **tokens, * @param pr HTTP response */ static void -pay_cb (void *cls, +pay_cb (struct PayState *ps, const struct TALER_MERCHANT_PostOrdersPayResponse *pr) { - struct PayState *ps = cls; ps->oph = NULL; if (ps->http_status != pr->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_account.c b/src/testing/testing_api_cmd_post_account.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct PostAccountState; +#define TALER_MERCHANT_POST_PRIVATE_ACCOUNTS_RESULT_CLOSURE struct PostAccountState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -85,10 +87,9 @@ struct PostAccountState * @param apr response being processed */ static void -post_account_cb (void *cls, +post_account_cb (struct PostAccountState *pas, const struct TALER_MERCHANT_PostPrivateAccountsResponse *apr) { - struct PostAccountState *pas = cls; pas->aph = NULL; if (pas->http_status != apr->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_categories.c b/src/testing/testing_api_cmd_post_categories.c @@ -19,6 +19,8 @@ * @author Bohdan Potuzhnyi */ #include "platform.h" +struct PostCategoriesState; +#define TALER_MERCHANT_POST_PRIVATE_CATEGORIES_RESULT_CLOSURE struct PostCategoriesState #include <jansson.h> #include <microhttpd.h> #include <taler/taler_testing_lib.h> @@ -79,11 +81,10 @@ struct PostCategoriesState * @param cpr response details */ static void -post_categories_cb (void *cls, +post_categories_cb (struct PostCategoriesState *pcs, const struct TALER_MERCHANT_PostPrivateCategoriesResponse * cpr) { - struct PostCategoriesState *pcs = cls; pcs->cph = NULL; if (pcs->http_status != cpr->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_donau_instances.c b/src/testing/testing_api_cmd_post_donau_instances.c @@ -24,6 +24,8 @@ */ #include "platform.h" +struct PostDonauState; +#define TALER_MERCHANT_POST_PRIVATE_DONAU_RESULT_CLOSURE struct PostDonauState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -75,10 +77,9 @@ struct PostDonauState * @param pdr response being processed */ static void -post_donau_cb (void *cls, +post_donau_cb (struct PostDonauState *pds, const struct TALER_MERCHANT_PostPrivateDonauResponse *pdr) { - struct PostDonauState *pds = cls; pds->dph = NULL; if (pds->http_status != pdr->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_instances.c b/src/testing/testing_api_cmd_post_instances.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct PostInstancesState; +#define TALER_MERCHANT_POST_MANAGEMENT_INSTANCES_RESULT_CLOSURE struct PostInstancesState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -106,10 +108,9 @@ struct PostInstancesState */ static void post_instances_cb ( - void *cls, + struct PostInstancesState *pis, const struct TALER_MERCHANT_PostManagementInstancesResponse *mir) { - struct PostInstancesState *pis = cls; pis->iph = NULL; if (pis->http_status != mir->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_orders.c b/src/testing/testing_api_cmd_post_orders.c @@ -24,6 +24,9 @@ */ #include "platform.h" +struct OrdersState; +#define TALER_MERCHANT_POST_PRIVATE_ORDERS_RESULT_CLOSURE struct OrdersState +#define TALER_MERCHANT_POST_ORDERS_CLAIM_RESULT_CLOSURE struct OrdersState #include <gnunet/gnunet_common.h> #include <gnunet/gnunet_time_lib.h> #include <jansson.h> @@ -198,10 +201,9 @@ orders_traits (void *cls, * @param ocr response we got */ static void -orders_claim_cb (void *cls, +orders_claim_cb (struct OrdersState *ps, const struct TALER_MERCHANT_PostOrdersClaimResponse *ocr) { - struct OrdersState *ps = cls; const char *error_name; unsigned int error_line; struct GNUNET_JSON_Specification spec[] = { @@ -263,10 +265,9 @@ orders_claim_cb (void *cls, * @param por details about the response */ static void -order_cb (void *cls, +order_cb (struct OrdersState *ps, const struct TALER_MERCHANT_PostPrivateOrdersResponse *por) { - struct OrdersState *ps = cls; ps->po = NULL; if (ps->http_status != por->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_orders_paid.c b/src/testing/testing_api_cmd_post_orders_paid.c @@ -22,6 +22,8 @@ * @author Jonathan Buchanan */ #include "platform.h" +struct PostOrdersPaidState; +#define TALER_MERCHANT_POST_ORDERS_PAID_RESULT_CLOSURE struct PostOrdersPaidState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -75,10 +77,9 @@ struct PostOrdersPaidState * @param opr the response. */ static void -paid_cb (void *cls, +paid_cb (struct PostOrdersPaidState *ops, const struct TALER_MERCHANT_PostOrdersPaidResponse *opr) { - struct PostOrdersPaidState *ops = cls; ops->oph = NULL; if (ops->http_status != opr->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_otp_devices.c b/src/testing/testing_api_cmd_post_otp_devices.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct PostOtpDevicesState; +#define TALER_MERCHANT_POST_PRIVATE_OTP_DEVICES_RESULT_CLOSURE struct PostOtpDevicesState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -90,11 +92,10 @@ struct PostOtpDevicesState * @param odr response being processed */ static void -post_otp_devices_cb (void *cls, +post_otp_devices_cb (struct PostOtpDevicesState *tis, const struct TALER_MERCHANT_PostPrivateOtpDevicesResponse * odr) { - struct PostOtpDevicesState *tis = cls; tis->iph = NULL; if (tis->http_status != odr->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_products.c b/src/testing/testing_api_cmd_post_products.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct PostProductsState; +#define TALER_MERCHANT_POST_PRIVATE_PRODUCTS_RESULT_CLOSURE struct PostProductsState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_testing_lib.h" @@ -249,10 +251,9 @@ default_precision_from_unit (const char *unit) * @param ppr response being processed */ static void -post_products_cb (void *cls, +post_products_cb (struct PostProductsState *pis, const struct TALER_MERCHANT_PostPrivateProductsResponse *ppr) { - struct PostProductsState *pis = cls; pis->iph = NULL; if (pis->http_status != ppr->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_templates.c b/src/testing/testing_api_cmd_post_templates.c @@ -22,6 +22,8 @@ * @author Priscilla HUANG */ #include "platform.h" +struct PostTemplatesState; +#define TALER_MERCHANT_POST_PRIVATE_TEMPLATES_RESULT_CLOSURE struct PostTemplatesState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -85,11 +87,10 @@ struct PostTemplatesState * @param ptr response being processed */ static void -post_templates_cb (void *cls, +post_templates_cb (struct PostTemplatesState *tis, const struct TALER_MERCHANT_PostPrivateTemplatesResponse *ptr ) { - struct PostTemplatesState *tis = cls; tis->iph = NULL; if (tis->http_status != ptr->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_tokenfamilies.c b/src/testing/testing_api_cmd_post_tokenfamilies.c @@ -23,6 +23,8 @@ * @author Christian Blättler */ #include "platform.h" +struct PostTokenFamiliesState; +#define TALER_MERCHANT_POST_PRIVATE_TOKENFAMILIES_RESULT_CLOSURE struct PostTokenFamiliesState #include <gnunet/gnunet_time_lib.h> #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> @@ -111,11 +113,10 @@ struct PostTokenFamiliesState * @param tfr response being processed */ static void -post_tokenfamilies_cb (void *cls, +post_tokenfamilies_cb (struct PostTokenFamiliesState *state, const struct TALER_MERCHANT_PostPrivateTokenfamiliesResponse *tfr) { - struct PostTokenFamiliesState *state = cls; state->handle = NULL; if (state->http_status != tfr->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_transfers.c b/src/testing/testing_api_cmd_post_transfers.c @@ -22,6 +22,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct PostTransfersState; +#define TALER_MERCHANT_POST_PRIVATE_TRANSFERS_RESULT_CLOSURE struct PostTransfersState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -126,10 +128,9 @@ struct PostTransfersState * @param ptr response details */ static void -transfers_cb (void *cls, +transfers_cb (struct PostTransfersState *pts, const struct TALER_MERCHANT_PostPrivateTransfersResponse *ptr) { - struct PostTransfersState *pts = cls; pts->pth = NULL; if (pts->http_status != ptr->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_units.c b/src/testing/testing_api_cmd_post_units.c @@ -22,6 +22,8 @@ * @author Bohdan Potuzhnyi */ #include "platform.h" +struct PostUnitState; +#define TALER_MERCHANT_POST_PRIVATE_UNITS_RESULT_CLOSURE struct PostUnitState #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" #include "taler/taler_merchant_testing_lib.h" @@ -99,10 +101,9 @@ struct PostUnitState * Completion callback for POST /private/units. */ static void -post_unit_cb (void *cls, +post_unit_cb (struct PostUnitState *pus, const struct TALER_MERCHANT_PostPrivateUnitsResponse *pur) { - struct PostUnitState *pus = cls; pus->uph = NULL; if (pus->http_status != pur->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_using_templates.c b/src/testing/testing_api_cmd_post_using_templates.c @@ -22,6 +22,9 @@ * @author Priscilla HUANG */ #include "platform.h" +struct PostUsingTemplatesState; +#define TALER_MERCHANT_POST_TEMPLATES_RESULT_CLOSURE struct PostUsingTemplatesState +#define TALER_MERCHANT_POST_ORDERS_CLAIM_RESULT_CLOSURE struct PostUsingTemplatesState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -170,10 +173,9 @@ struct PostUsingTemplatesState * @param ocr response we got */ static void -using_claim_cb (void *cls, +using_claim_cb (struct PostUsingTemplatesState *tis, const struct TALER_MERCHANT_PostOrdersClaimResponse *ocr) { - struct PostUsingTemplatesState *tis = cls; const char *error_name; unsigned int error_line; struct GNUNET_JSON_Specification spec[] = { @@ -237,10 +239,9 @@ using_claim_cb (void *cls, * @param por response being processed */ static void -post_using_templates_cb (void *cls, +post_using_templates_cb (struct PostUsingTemplatesState *tis, const struct TALER_MERCHANT_PostTemplatesResponse *por) { - struct PostUsingTemplatesState *tis = cls; tis->iph = NULL; if (tis->http_status != por->hr.http_status) diff --git a/src/testing/testing_api_cmd_post_webhooks.c b/src/testing/testing_api_cmd_post_webhooks.c @@ -22,6 +22,8 @@ * @author Priscilla HUANG */ #include "platform.h" +struct PostWebhooksState; +#define TALER_MERCHANT_POST_PRIVATE_WEBHOOKS_RESULT_CLOSURE struct PostWebhooksState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -95,10 +97,9 @@ struct PostWebhooksState * @param wpr response being processed */ static void -post_webhooks_cb (void *cls, +post_webhooks_cb (struct PostWebhooksState *wis, const struct TALER_MERCHANT_PostPrivateWebhooksResponse *wpr) { - struct PostWebhooksState *wis = cls; wis->iph = NULL; if (wis->http_status != wpr->hr.http_status) diff --git a/src/testing/testing_api_cmd_refund_order.c b/src/testing/testing_api_cmd_refund_order.c @@ -23,6 +23,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct RefundState; +#define TALER_MERCHANT_POST_PRIVATE_ORDERS_REFUND_RESULT_CLOSURE struct RefundState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -80,10 +82,9 @@ struct RefundState * @param rr response */ static void -refund_cb (void *cls, +refund_cb (struct RefundState *ris, const struct TALER_MERCHANT_PostPrivateOrdersRefundResponse *rr) { - struct RefundState *ris = cls; ris->orh = NULL; if (ris->http_code != rr->hr.http_status) diff --git a/src/testing/testing_api_cmd_wallet_get_template.c b/src/testing/testing_api_cmd_wallet_get_template.c @@ -19,6 +19,8 @@ * @author Bohdan Potuzhnyi */ #include "platform.h" +struct WalletGetTemplateState; +#define TALER_MERCHANT_GET_TEMPLATES_RESULT_CLOSURE struct WalletGetTemplateState #include <microhttpd.h> #include <jansson.h> #include <taler/taler_testing_lib.h> @@ -131,11 +133,10 @@ product_id_matches (const json_t *product, * @param tgr HTTP response details */ static void -wallet_get_template_cb (void *cls, +wallet_get_template_cb (struct WalletGetTemplateState *wgs, const struct TALER_MERCHANT_GetTemplatesResponse *tgr) { - struct WalletGetTemplateState *wgs = cls; wgs->igh = NULL; if (wgs->http_status != tgr->hr.http_status) diff --git a/src/testing/testing_api_cmd_wallet_post_orders_refund.c b/src/testing/testing_api_cmd_wallet_post_orders_refund.c @@ -23,6 +23,8 @@ * @author Christian Grothoff */ #include "platform.h" +struct WalletRefundState; +#define TALER_MERCHANT_POST_ORDERS_REFUND_RESULT_CLOSURE struct WalletRefundState #include <taler/taler_exchange_service.h> #include <taler/taler_testing_lib.h> #include "taler/taler_merchant_service.h" @@ -81,10 +83,9 @@ struct WalletRefundState */ static void refund_cb ( - void *cls, + struct WalletRefundState *wrs, const struct TALER_MERCHANT_PostOrdersRefundResponse *wrr) { - struct WalletRefundState *wrs = cls; wrs->orh = NULL; if (wrs->http_code != wrr->hr.http_status)