inc/c_util/channel.h (25 lines of code) (raw):

// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #ifndef CHANNEL_H #define CHANNEL_H #include "macro_utils/macro_utils.h" #include "c_pal/thandle.h" #include "c_pal/threadpool.h" #include "c_pal/thandle_log_context_handle.h" #include "c_util/async_op.h" #include "c_util/rc_ptr.h" #include "c_util/rc_string.h" #include "c_util/channel_common.h" #include "umock_c/umock_c_prod.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef struct CHANNEL_TAG CHANNEL; THANDLE_TYPE_DECLARE(CHANNEL); MOCKABLE_FUNCTION(, THANDLE(CHANNEL), channel_create, THANDLE(PTR(LOG_CONTEXT_HANDLE)), log_context, THANDLE(THREADPOOL), threadpool); MOCKABLE_FUNCTION(, int, channel_open, THANDLE(CHANNEL), channel); MOCKABLE_FUNCTION(, void, channel_close, THANDLE(CHANNEL), channel); MOCKABLE_FUNCTION(, CHANNEL_RESULT, channel_pull, THANDLE(CHANNEL), channel, THANDLE(RC_STRING), correlation_id, ON_DATA_AVAILABLE_CB, on_data_available_cb, void*, pull_context, THANDLE(ASYNC_OP)*, out_op_pull); MOCKABLE_FUNCTION(, CHANNEL_RESULT, channel_push, THANDLE(CHANNEL), channel, THANDLE(RC_STRING), correlation_id, THANDLE(RC_PTR), data, ON_DATA_CONSUMED_CB, on_data_consumed_cb, void*, push_context, THANDLE(ASYNC_OP)*, out_op_push); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CHANNEL_H */