From a5edf8ac9f03a368c87ea6163994d4ac3d62af06 Mon Sep 17 00:00:00 2001 From: Gabor X Toth <*@tg-x.net> Date: Thu, 7 May 2015 12:15:32 +0000 Subject: client_manager: add API for async operations --- src/include/gnunet_common.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/include/gnunet_common.h') diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index 880fc1fee..6a02190cc 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -248,6 +248,29 @@ struct GNUNET_MessageHeader }; + +/** + * Answer from service to client about last operation. + */ +struct GNUNET_OperationResultMessage +{ + struct GNUNET_MessageHeader header; + + uint32_t reserved GNUNET_PACKED; + + /** + * Operation ID. + */ + uint64_t op_id GNUNET_PACKED; + + /** + * Status code for the operation. + */ + uint64_t result_code GNUNET_PACKED; + + /* Followed by data. */ +}; + GNUNET_NETWORK_STRUCT_END /** @@ -273,6 +296,23 @@ typedef void (*GNUNET_ContinuationCallback) (void *cls); +/** + * Function called with the result of an asynchronous operation. + * + * @param cls + * Closure. + * @param result_code + * Result code for the operation. + * @param data + * Data result for the operation. + * @param data_size + * Size of @a data. + */ +typedef void +(*GNUNET_ResultCallback) (void *cls, int64_t result_code, + const void *data, uint16_t data_size); + + /* ****************************** logging ***************************** */ /** -- cgit v1.2.3