From 89c1428a60a6c5423ccad9ede60079c5e4cc79ac Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 19 Jul 2017 15:32:27 -0700 Subject: Propagate grpc_millis further --- src/core/ext/filters/client_channel/subchannel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/ext/filters/client_channel/subchannel.h') diff --git a/src/core/ext/filters/client_channel/subchannel.h b/src/core/ext/filters/client_channel/subchannel.h index 6d2abb04df..5ffc640573 100644 --- a/src/core/ext/filters/client_channel/subchannel.h +++ b/src/core/ext/filters/client_channel/subchannel.h @@ -103,7 +103,7 @@ typedef struct { grpc_polling_entity *pollent; grpc_slice path; gpr_timespec start_time; - gpr_timespec deadline; + grpc_millis deadline; gpr_arena *arena; grpc_call_context_element *context; } grpc_connected_subchannel_call_args; -- cgit v1.2.3 From a7e6d65a4864422854117149a6e98ff80e492fa9 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Wed, 20 Sep 2017 18:56:37 -0700 Subject: Changes for C to C++. Adding extern C to header files for compatibility. --- src/core/ext/census/base_resources.h | 10 +++++++++- src/core/ext/census/census_interface.h | 10 +++++++++- src/core/ext/census/census_log.h | 10 +++++++++- src/core/ext/census/hash_table.h | 10 +++++++++- src/core/ext/census/intrusive_hash_map.h | 8 ++++++++ src/core/ext/census/mlog.h | 10 +++++++++- src/core/ext/census/resource.h | 10 +++++++++- src/core/ext/census/trace_context.h | 10 +++++++++- src/core/ext/census/trace_propagation.h | 10 +++++++++- src/core/ext/census/tracing.h | 10 +++++++++- src/core/ext/census/window_stats.h | 10 +++++++++- src/core/ext/filters/client_channel/client_channel.h | 10 +++++++++- src/core/ext/filters/client_channel/client_channel_factory.h | 10 +++++++++- src/core/ext/filters/client_channel/connector.h | 10 +++++++++- src/core/ext/filters/client_channel/http_connect_handshaker.h | 10 +++++++++- src/core/ext/filters/client_channel/http_proxy.h | 10 +++++++++- src/core/ext/filters/client_channel/lb_policy.h | 8 ++++++++ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h | 10 +++++++++- .../filters/client_channel/lb_policy/grpclb/grpclb_channel.h | 8 ++++++++ .../client_channel/lb_policy/grpclb/grpclb_client_stats.h | 8 ++++++++ src/core/ext/filters/client_channel/lb_policy_factory.h | 10 +++++++++- src/core/ext/filters/client_channel/lb_policy_registry.h | 10 +++++++++- src/core/ext/filters/client_channel/parse_address.h | 10 +++++++++- src/core/ext/filters/client_channel/proxy_mapper.h | 10 +++++++++- src/core/ext/filters/client_channel/proxy_mapper_registry.h | 10 +++++++++- src/core/ext/filters/client_channel/resolver.h | 8 ++++++++ .../client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h | 8 ++++++++ .../client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h | 8 ++++++++ .../ext/filters/client_channel/resolver/fake/fake_resolver.h | 8 ++++++++ src/core/ext/filters/client_channel/resolver_factory.h | 10 +++++++++- src/core/ext/filters/client_channel/resolver_registry.h | 10 +++++++++- src/core/ext/filters/client_channel/retry_throttle.h | 10 +++++++++- src/core/ext/filters/client_channel/subchannel.h | 8 ++++++++ src/core/ext/filters/client_channel/subchannel_index.h | 10 +++++++++- src/core/ext/filters/client_channel/uri_parser.h | 10 +++++++++- src/core/ext/filters/deadline/deadline_filter.h | 10 +++++++++- .../ext/filters/load_reporting/server_load_reporting_plugin.h | 8 ++++++++ src/core/ext/filters/workarounds/workaround_utils.h | 10 +++++++++- src/core/ext/transport/chttp2/alpn/alpn.h | 10 +++++++++- src/core/ext/transport/chttp2/server/chttp2_server.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/bin_decoder.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/bin_encoder.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/chttp2_transport.h | 8 ++++++++ src/core/ext/transport/chttp2/transport/frame.h | 8 ++++++++ src/core/ext/transport/chttp2/transport/frame_data.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/frame_goaway.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/frame_ping.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/frame_rst_stream.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/frame_settings.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/frame_window_update.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/hpack_encoder.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/hpack_parser.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/hpack_table.h | 8 ++++++++ src/core/ext/transport/chttp2/transport/http2_settings.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/incoming_metadata.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/internal.h | 8 ++++++++ src/core/ext/transport/chttp2/transport/stream_map.h | 10 +++++++++- src/core/ext/transport/chttp2/transport/varint.h | 8 ++++++++ src/core/ext/transport/cronet/transport/cronet_transport.h | 10 +++++++++- src/core/lib/channel/channel_args.h | 10 +++++++++- src/core/lib/channel/connected_channel.h | 10 +++++++++- src/core/lib/channel/handshaker.h | 10 +++++++++- src/core/lib/channel/handshaker_factory.h | 10 +++++++++- src/core/lib/channel/handshaker_registry.h | 10 +++++++++- src/core/lib/compression/algorithm_metadata.h | 10 +++++++++- src/core/lib/compression/message_compress.h | 10 +++++++++- src/core/lib/compression/stream_compression.h | 8 ++++++++ src/core/lib/debug/stats.h | 8 ++++++++ src/core/lib/debug/stats_data.h | 8 ++++++++ src/core/lib/debug/trace.h | 8 ++++++++ src/core/lib/http/format_request.h | 10 +++++++++- src/core/lib/http/httpcli.h | 10 +++++++++- src/core/lib/http/parser.h | 10 +++++++++- src/core/lib/iomgr/call_combiner.h | 8 ++++++++ src/core/lib/iomgr/combiner.h | 8 ++++++++ src/core/lib/iomgr/endpoint.h | 10 +++++++++- src/core/lib/iomgr/endpoint_pair.h | 10 +++++++++- src/core/lib/iomgr/error_internal.h | 10 +++++++++- src/core/lib/iomgr/ev_epoll1_linux.h | 10 +++++++++- src/core/lib/iomgr/ev_epollex_linux.h | 10 +++++++++- src/core/lib/iomgr/ev_epollsig_linux.h | 8 ++++++++ src/core/lib/iomgr/ev_poll_posix.h | 10 +++++++++- src/core/lib/iomgr/ev_posix.h | 10 +++++++++- src/core/lib/iomgr/exec_ctx.h | 8 ++++++++ src/core/lib/iomgr/executor.h | 10 +++++++++- src/core/lib/iomgr/gethostname.h | 10 +++++++++- src/core/lib/iomgr/iocp_windows.h | 10 +++++++++- src/core/lib/iomgr/iomgr.h | 10 +++++++++- src/core/lib/iomgr/iomgr_internal.h | 10 +++++++++- src/core/lib/iomgr/is_epollexclusive_available.h | 10 +++++++++- src/core/lib/iomgr/lockfree_event.h | 10 +++++++++- src/core/lib/iomgr/network_status_tracker.h | 10 +++++++++- src/core/lib/iomgr/polling_entity.h | 10 +++++++++- src/core/lib/iomgr/pollset.h | 8 ++++++++ src/core/lib/iomgr/pollset_set.h | 10 +++++++++- src/core/lib/iomgr/pollset_uv.h | 10 +++++++++- src/core/lib/iomgr/pollset_windows.h | 10 +++++++++- src/core/lib/iomgr/resolve_address.h | 10 +++++++++- src/core/lib/iomgr/resource_quota.h | 10 +++++++++- src/core/lib/iomgr/sockaddr_utils.h | 10 +++++++++- src/core/lib/iomgr/socket_utils.h | 10 +++++++++- src/core/lib/iomgr/socket_utils_posix.h | 10 +++++++++- src/core/lib/iomgr/socket_windows.h | 10 +++++++++- src/core/lib/iomgr/tcp_client.h | 10 +++++++++- src/core/lib/iomgr/tcp_client_posix.h | 10 +++++++++- src/core/lib/iomgr/tcp_posix.h | 10 +++++++++- src/core/lib/iomgr/tcp_server.h | 10 +++++++++- src/core/lib/iomgr/tcp_server_utils_posix.h | 10 +++++++++- src/core/lib/iomgr/tcp_uv.h | 10 +++++++++- src/core/lib/iomgr/tcp_windows.h | 10 +++++++++- src/core/lib/iomgr/time_averaged_stats.h | 10 +++++++++- src/core/lib/iomgr/timer.h | 8 ++++++++ src/core/lib/iomgr/timer_heap.h | 10 +++++++++- src/core/lib/iomgr/timer_manager.h | 10 +++++++++- src/core/lib/iomgr/udp_server.h | 10 +++++++++- src/core/lib/iomgr/unix_sockets_posix.h | 10 +++++++++- src/core/lib/iomgr/wakeup_fd_cv.h | 10 +++++++++- src/core/lib/iomgr/wakeup_fd_posix.h | 8 ++++++++ src/core/lib/json/json.h | 10 +++++++++- src/core/lib/json/json_reader.h | 10 +++++++++- src/core/lib/json/json_writer.h | 10 +++++++++- src/core/lib/profiling/basic_timers.c | 4 ++-- .../lib/security/credentials/composite/composite_credentials.h | 8 ++++++++ src/core/lib/security/credentials/credentials.h | 8 ++++++++ src/core/lib/security/credentials/fake/fake_credentials.h | 10 +++++++++- src/core/lib/security/credentials/jwt/json_token.h | 10 +++++++++- src/core/lib/security/credentials/jwt/jwt_credentials.h | 10 +++++++++- src/core/lib/security/credentials/jwt/jwt_verifier.h | 8 ++++++++ src/core/lib/security/credentials/oauth2/oauth2_credentials.h | 10 +++++++++- src/core/lib/security/transport/lb_targets_info.h | 10 +++++++++- src/core/lib/security/transport/secure_endpoint.h | 10 +++++++++- src/core/lib/security/transport/security_connector.h | 8 ++++++++ src/core/lib/security/transport/security_handshaker.h | 10 +++++++++- src/core/lib/security/transport/tsi_error.h | 10 +++++++++- src/core/lib/security/util/json_util.h | 10 +++++++++- src/core/lib/slice/b64.h | 10 +++++++++- src/core/lib/slice/percent_encoding.h | 10 +++++++++- src/core/lib/slice/slice_hash_table.h | 10 +++++++++- src/core/lib/slice/slice_internal.h | 10 +++++++++- src/core/lib/slice/slice_traits.h | 10 +++++++++- src/core/lib/support/time_precise.c | 2 ++ src/core/lib/surface/channel.h | 8 ++++++++ src/core/lib/surface/channel_stack_type.h | 10 +++++++++- src/core/lib/surface/completion_queue_factory.h | 10 +++++++++- src/core/lib/surface/event_string.h | 10 +++++++++- src/core/lib/surface/init.h | 10 +++++++++- src/core/lib/surface/server.h | 10 +++++++++- src/core/lib/surface/validate_metadata.h | 10 +++++++++- src/core/lib/transport/bdp_estimator.h | 10 +++++++++- src/core/lib/transport/byte_stream.h | 10 +++++++++- src/core/lib/transport/connectivity_state.h | 10 +++++++++- src/core/lib/transport/error_utils.h | 10 +++++++++- src/core/lib/transport/pid_controller.h | 10 +++++++++- src/core/lib/transport/service_config.h | 10 +++++++++- src/core/lib/transport/status_conversion.h | 10 +++++++++- src/core/lib/transport/timeout_encoding.h | 10 +++++++++- src/core/lib/transport/transport_impl.h | 10 +++++++++- src/core/tsi/gts_transport_security.h | 10 +++++++++- 158 files changed, 1377 insertions(+), 127 deletions(-) (limited to 'src/core/ext/filters/client_channel/subchannel.h') diff --git a/src/core/ext/census/base_resources.h b/src/core/ext/census/base_resources.h index 78a4d1fae5..4b1b988e3f 100644 --- a/src/core/ext/census/base_resources.h +++ b/src/core/ext/census/base_resources.h @@ -18,7 +18,15 @@ #ifndef GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H #define GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H +#ifdef __cplusplus +extern "C" { +#endif + /* Define all base resources. This should be called by census initialization. */ void define_base_resources(); -#endif /* GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_CENSUS_BASE_RESOURCES_H */ \ No newline at end of file diff --git a/src/core/ext/census/census_interface.h b/src/core/ext/census/census_interface.h index a42b68ad65..12438e3c0a 100644 --- a/src/core/ext/census/census_interface.h +++ b/src/core/ext/census/census_interface.h @@ -24,6 +24,10 @@ /* Maximum length of an individual census trace annotation. */ #define CENSUS_MAX_ANNOTATION_LENGTH 200 +#ifdef __cplusplus +extern "C" { +#endif + /* Structure of a census op id. Define as structure because 64bit integer is not available on every platform for C89. */ typedef struct census_op_id { @@ -58,4 +62,8 @@ census_op_id census_tracing_start_op(void); /* Ends tracing. Calling this function will invalidate the input op_id. */ void census_tracing_end_op(census_op_id op_id); -#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_INTERFACE_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_INTERFACE_H */ \ No newline at end of file diff --git a/src/core/ext/census/census_log.h b/src/core/ext/census/census_log.h index 6b68b6bd37..cc9e008907 100644 --- a/src/core/ext/census/census_log.h +++ b/src/core/ext/census/census_log.h @@ -25,6 +25,10 @@ #define CENSUS_LOG_2_MAX_RECORD_SIZE 14 /* 2^14 = 16KB */ #define CENSUS_LOG_MAX_RECORD_SIZE (1 << CENSUS_LOG_2_MAX_RECORD_SIZE) +#ifdef __cplusplus +extern "C" { +#endif + /* Initialize the statistics logging subsystem with the given log size. A log size of 0 will result in the smallest possible log for the platform (approximately CENSUS_LOG_MAX_RECORD_SIZE * gpr_cpu_num_cores()). If @@ -73,4 +77,8 @@ size_t census_log_remaining_space(void); out-of-space. */ int census_log_out_of_space_count(void); -#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_LOG_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_LOG_H */ \ No newline at end of file diff --git a/src/core/ext/census/hash_table.h b/src/core/ext/census/hash_table.h index 75770641c5..c22ba8df9d 100644 --- a/src/core/ext/census/hash_table.h +++ b/src/core/ext/census/hash_table.h @@ -23,6 +23,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* A chain based hash table with fixed number of buckets. Your probably shouldn't use this code directly. It is implemented for the use case in census trace store and stats store, where number of entries in @@ -113,4 +117,8 @@ typedef void (*census_ht_itr_cb)(census_ht_key key, const void *val_ptr, should not invalidate data entries. */ uint64_t census_ht_for_all(const census_ht *ht, census_ht_itr_cb); -#endif /* GRPC_CORE_EXT_CENSUS_HASH_TABLE_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_CENSUS_HASH_TABLE_H */ \ No newline at end of file diff --git a/src/core/ext/census/intrusive_hash_map.h b/src/core/ext/census/intrusive_hash_map.h index f50de4fab4..2c7baa31fb 100644 --- a/src/core/ext/census/intrusive_hash_map.h +++ b/src/core/ext/census/intrusive_hash_map.h @@ -21,6 +21,10 @@ #include "src/core/ext/census/intrusive_hash_map_internal.h" +#ifdef __cplusplus +extern "C" { +#endif + /* intrusive_hash_map is a fast chained hash table. This hash map is faster than * a dense hash map when the application calls insert and erase more often than * find. When the workload is dominated by find() a dense hash map may be @@ -149,4 +153,8 @@ void intrusive_hash_map_clear(intrusive_hash_map *hash_map, void intrusive_hash_map_free(intrusive_hash_map *hash_map, void (*free_object)(void *)); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_CENSUS_INTRUSIVE_HASH_MAP_H */ diff --git a/src/core/ext/census/mlog.h b/src/core/ext/census/mlog.h index 6f3125944f..7b4d39272b 100644 --- a/src/core/ext/census/mlog.h +++ b/src/core/ext/census/mlog.h @@ -28,6 +28,10 @@ #define CENSUS_LOG_2_MAX_RECORD_SIZE 14 /* 2^14 = 16KB */ #define CENSUS_LOG_MAX_RECORD_SIZE (1 << CENSUS_LOG_2_MAX_RECORD_SIZE) +#ifdef __cplusplus +extern "C" { +#endif + /* Initialize the statistics logging subsystem with the given log size. A log size of 0 will result in the smallest possible log for the platform (approximately CENSUS_LOG_MAX_RECORD_SIZE * gpr_cpu_num_cores()). If @@ -77,4 +81,8 @@ size_t census_log_remaining_space(void); out-of-space. */ int64_t census_log_out_of_space_count(void); -#endif /* GRPC_CORE_EXT_CENSUS_MLOG_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_CENSUS_MLOG_H */ \ No newline at end of file diff --git a/src/core/ext/census/resource.h b/src/core/ext/census/resource.h index b8bda2c72e..5f7ac2ad27 100644 --- a/src/core/ext/census/resource.h +++ b/src/core/ext/census/resource.h @@ -23,6 +23,10 @@ #include #include "src/core/ext/census/gen/census.pb.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Internal representation of a resource. */ typedef struct { char *name; @@ -45,4 +49,8 @@ void shutdown_resources(void); from configuration files. */ int32_t define_resource(const resource *base); -#endif /* GRPC_CORE_EXT_CENSUS_RESOURCE_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_CENSUS_RESOURCE_H */ \ No newline at end of file diff --git a/src/core/ext/census/trace_context.h b/src/core/ext/census/trace_context.h index a7233e6a2b..c707c63263 100644 --- a/src/core/ext/census/trace_context.h +++ b/src/core/ext/census/trace_context.h @@ -39,6 +39,10 @@ 1 byte for is_sampled (bool) */ #define TRACE_MAX_CONTEXT_SIZE 31 +#ifdef __cplusplus +extern "C" { +#endif + /* Encode a trace context (ctxt) into proto format to the buffer provided. The size of buffer must be at least TRACE_MAX_CONTEXT_SIZE. On success, returns the number of bytes successfully encoded into buffer. On failure, returns 0. */ @@ -53,4 +57,8 @@ of these do not exist. On success, returns true and false otherwise. */ bool decode_trace_context(google_trace_TraceContext *ctxt, uint8_t *buffer, const size_t nbytes); -#endif /* GRPC_CORE_EXT_CENSUS_TRACE_CONTEXT_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_CENSUS_TRACE_CONTEXT_H */ \ No newline at end of file diff --git a/src/core/ext/census/trace_propagation.h b/src/core/ext/census/trace_propagation.h index eecfcb7d01..3394e9e0fd 100644 --- a/src/core/ext/census/trace_propagation.h +++ b/src/core/ext/census/trace_propagation.h @@ -21,6 +21,10 @@ #include "src/core/ext/census/tracing.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Encoding and decoding functions for receiving and sending trace contexts over the wire. Only RPC libraries should be calling these functions. These functions return the number of bytes encoded/decoded @@ -45,4 +49,8 @@ size_t trace_span_context_to_http_format(const trace_span_context *ctxt, size_t http_format_to_trace_span_context(const char *buf, size_t buf_size, trace_span_context *ctxt); -#endif /* GRPC_CORE_EXT_CENSUS_TRACE_PROPAGATION_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_CENSUS_TRACE_PROPAGATION_H */ \ No newline at end of file diff --git a/src/core/ext/census/tracing.h b/src/core/ext/census/tracing.h index 038c9e2790..5fcbb1e1f7 100644 --- a/src/core/ext/census/tracing.h +++ b/src/core/ext/census/tracing.h @@ -25,6 +25,10 @@ #include "src/core/ext/census/trace_label.h" #include "src/core/ext/census/trace_status.h" +#ifdef __cplusplus +extern "C" { +#endif + /* This is the low level tracing API that other languages will interface with. This is not intended to be accessed by the end-user, therefore it has been designed with performance in mind rather than ease of use. */ @@ -106,4 +110,8 @@ free to ignore all further calls using the Span. EndSpanOptions can optionally be NULL. */ void trace_end_span(const trace_status *status, trace_span_context *span_ctxt); -#endif /* GRPC_CORE_EXT_CENSUS_TRACING_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_CENSUS_TRACING_H */ \ No newline at end of file diff --git a/src/core/ext/census/window_stats.h b/src/core/ext/census/window_stats.h index ebe3732008..3b1d197f76 100644 --- a/src/core/ext/census/window_stats.h +++ b/src/core/ext/census/window_stats.h @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* Keep rolling sums of a user-defined statistic (containing a number of measurements) over a a number of time intervals ("windows"). For example, you can use a window_stats object to answer questions such as @@ -155,4 +159,8 @@ void census_window_stats_get_sums(const struct census_window_stats *wstats, assertion failure). This function is thread-compatible. */ void census_window_stats_destroy(struct census_window_stats *wstats); -#endif /* GRPC_CORE_EXT_CENSUS_WINDOW_STATS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_CENSUS_WINDOW_STATS_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/client_channel.h b/src/core/ext/filters/client_channel/client_channel.h index c99f0092e9..b32f378c6c 100644 --- a/src/core/ext/filters/client_channel/client_channel.h +++ b/src/core/ext/filters/client_channel/client_channel.h @@ -28,6 +28,10 @@ extern grpc_tracer_flag grpc_client_channel_trace; // Channel arg key for server URI string. #define GRPC_ARG_SERVER_URI "grpc.server_uri" +#ifdef __cplusplus +extern "C" { +#endif + /* A client channel is a channel that begins disconnected, and can connect to some endpoint on demand. If that endpoint disconnects, it will be connected to again later. @@ -52,4 +56,8 @@ void grpc_client_channel_watch_connectivity_state( grpc_subchannel_call *grpc_client_channel_get_subchannel_call( grpc_call_element *elem); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/client_channel_factory.h b/src/core/ext/filters/client_channel/client_channel_factory.h index ce6266c769..bad8b97042 100644 --- a/src/core/ext/filters/client_channel/client_channel_factory.h +++ b/src/core/ext/filters/client_channel/client_channel_factory.h @@ -27,6 +27,10 @@ // Channel arg key for client channel factory. #define GRPC_ARG_CLIENT_CHANNEL_FACTORY "grpc.client_channel_factory" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_client_channel_factory grpc_client_channel_factory; typedef struct grpc_client_channel_factory_vtable grpc_client_channel_factory_vtable; @@ -74,4 +78,8 @@ grpc_channel *grpc_client_channel_factory_create_channel( grpc_arg grpc_client_channel_factory_create_channel_arg( grpc_client_channel_factory *factory); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/connector.h b/src/core/ext/filters/client_channel/connector.h index 7f3d4a1cc0..79ccb0d9bf 100644 --- a/src/core/ext/filters/client_channel/connector.h +++ b/src/core/ext/filters/client_channel/connector.h @@ -23,6 +23,10 @@ #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/transport/transport.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_connector grpc_connector; typedef struct grpc_connector_vtable grpc_connector_vtable; @@ -70,4 +74,8 @@ void grpc_connector_connect(grpc_exec_ctx *exec_ctx, grpc_connector *connector, void grpc_connector_shutdown(grpc_exec_ctx *exec_ctx, grpc_connector *connector, grpc_error *why); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/http_connect_handshaker.h b/src/core/ext/filters/client_channel/http_connect_handshaker.h index 928a23dc93..5042c61bec 100644 --- a/src/core/ext/filters/client_channel/http_connect_handshaker.h +++ b/src/core/ext/filters/client_channel/http_connect_handshaker.h @@ -28,7 +28,15 @@ /// seperated by colons. #define GRPC_ARG_HTTP_CONNECT_HEADERS "grpc.http_connect_headers" +#ifdef __cplusplus +extern "C" { +#endif + /// Registers handshaker factory. void grpc_http_connect_register_handshaker_factory(); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/http_proxy.h b/src/core/ext/filters/client_channel/http_proxy.h index 34694931d0..65d52334af 100644 --- a/src/core/ext/filters/client_channel/http_proxy.h +++ b/src/core/ext/filters/client_channel/http_proxy.h @@ -19,6 +19,14 @@ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H +#ifdef __cplusplus +extern "C" { +#endif + void grpc_register_http_proxy_mapper(); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h index 645d51e138..010299c2f4 100644 --- a/src/core/ext/filters/client_channel/lb_policy.h +++ b/src/core/ext/filters/client_channel/lb_policy.h @@ -23,6 +23,10 @@ #include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/transport/connectivity_state.h" +#ifdef __cplusplus +extern "C" { +#endif + /** A load balancing policy: specified by a vtable and a struct (which is expected to be extended to contain some parameters) */ typedef struct grpc_lb_policy grpc_lb_policy; @@ -204,4 +208,8 @@ void grpc_lb_policy_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, const grpc_lb_policy_args *lb_policy_args); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_H */ diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h index 63ad66c5e9..c67df609fc 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h @@ -21,9 +21,17 @@ #include "src/core/ext/filters/client_channel/lb_policy_factory.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Returns a load balancing factory for the glb policy, which tries to connect * to a load balancing server to decide the next successfully connected * subchannel to pick. */ grpc_lb_policy_factory *grpc_glb_lb_factory_create(); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h index 6120bf53f7..e8599d1f51 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h @@ -23,6 +23,10 @@ #include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" #include "src/core/lib/slice/slice_hash_table.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Create the channel used for communicating with an LB service. * Note that an LB *service* may be comprised of several LB *servers*. * @@ -40,5 +44,9 @@ grpc_channel_args *grpc_lb_policy_grpclb_build_lb_channel_args( grpc_fake_resolver_response_generator *response_generator, const grpc_channel_args *args); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CHANNEL_H \ */ diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h index c51e2a431a..b38c076f38 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h @@ -23,6 +23,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_grpclb_client_stats grpc_grpclb_client_stats; typedef struct { @@ -61,5 +65,9 @@ void grpc_grpclb_client_stats_get_locked( void grpc_grpclb_dropped_call_counts_destroy( grpc_grpclb_dropped_call_counts* drop_entries); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CLIENT_STATS_H \ */ diff --git a/src/core/ext/filters/client_channel/lb_policy_factory.h b/src/core/ext/filters/client_channel/lb_policy_factory.h index cf0f8cb615..69bcba4232 100644 --- a/src/core/ext/filters/client_channel/lb_policy_factory.h +++ b/src/core/ext/filters/client_channel/lb_policy_factory.h @@ -29,6 +29,10 @@ // Channel arg key for grpc_lb_addresses. #define GRPC_ARG_LB_ADDRESSES "grpc.lb_addresses" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_lb_policy_factory grpc_lb_policy_factory; typedef struct grpc_lb_policy_factory_vtable grpc_lb_policy_factory_vtable; @@ -130,4 +134,8 @@ grpc_lb_policy *grpc_lb_policy_factory_create_lb_policy( grpc_exec_ctx *exec_ctx, grpc_lb_policy_factory *factory, grpc_lb_policy_args *args); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/lb_policy_registry.h b/src/core/ext/filters/client_channel/lb_policy_registry.h index f5995687cf..0867844c37 100644 --- a/src/core/ext/filters/client_channel/lb_policy_registry.h +++ b/src/core/ext/filters/client_channel/lb_policy_registry.h @@ -22,6 +22,10 @@ #include "src/core/ext/filters/client_channel/lb_policy_factory.h" #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Initialize the registry and set \a default_factory as the factory to be * returned when no name is provided in a lookup */ void grpc_lb_policy_registry_init(void); @@ -37,4 +41,8 @@ void grpc_register_lb_policy(grpc_lb_policy_factory *factory); grpc_lb_policy *grpc_lb_policy_create(grpc_exec_ctx *exec_ctx, const char *name, grpc_lb_policy_args *args); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/parse_address.h b/src/core/ext/filters/client_channel/parse_address.h index c90a827da5..742df380b7 100644 --- a/src/core/ext/filters/client_channel/parse_address.h +++ b/src/core/ext/filters/client_channel/parse_address.h @@ -24,6 +24,10 @@ #include "src/core/ext/filters/client_channel/uri_parser.h" #include "src/core/lib/iomgr/resolve_address.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Populate \a resolved_addr from \a uri, whose path is expected to contain a * unix socket path. Returns true upon success. */ bool grpc_parse_unix(const grpc_uri *uri, grpc_resolved_address *resolved_addr); @@ -45,4 +49,8 @@ bool grpc_parse_ipv4_hostport(const char *hostport, grpc_resolved_address *addr, bool grpc_parse_ipv6_hostport(const char *hostport, grpc_resolved_address *addr, bool log_errors); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PARSE_ADDRESS_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/proxy_mapper.h b/src/core/ext/filters/client_channel/proxy_mapper.h index a13861ccaf..1325a9f1f6 100644 --- a/src/core/ext/filters/client_channel/proxy_mapper.h +++ b/src/core/ext/filters/client_channel/proxy_mapper.h @@ -25,6 +25,10 @@ #include "src/core/lib/iomgr/resolve_address.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_proxy_mapper grpc_proxy_mapper; typedef struct { @@ -71,4 +75,8 @@ bool grpc_proxy_mapper_map_address(grpc_exec_ctx* exec_ctx, void grpc_proxy_mapper_destroy(grpc_proxy_mapper* mapper); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/proxy_mapper_registry.h b/src/core/ext/filters/client_channel/proxy_mapper_registry.h index 99e54d1a78..2d389f1c21 100644 --- a/src/core/ext/filters/client_channel/proxy_mapper_registry.h +++ b/src/core/ext/filters/client_channel/proxy_mapper_registry.h @@ -21,6 +21,10 @@ #include "src/core/ext/filters/client_channel/proxy_mapper.h" +#ifdef __cplusplus +extern "C" { +#endif + void grpc_proxy_mapper_registry_init(); void grpc_proxy_mapper_registry_shutdown(); @@ -41,4 +45,8 @@ bool grpc_proxy_mappers_map_address(grpc_exec_ctx* exec_ctx, grpc_resolved_address** new_address, grpc_channel_args** new_args); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/resolver.h b/src/core/ext/filters/client_channel/resolver.h index ae9c8f66fe..73fbbbbc3b 100644 --- a/src/core/ext/filters/client_channel/resolver.h +++ b/src/core/ext/filters/client_channel/resolver.h @@ -22,6 +22,10 @@ #include "src/core/ext/filters/client_channel/subchannel.h" #include "src/core/lib/iomgr/iomgr.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_resolver grpc_resolver; typedef struct grpc_resolver_vtable grpc_resolver_vtable; @@ -87,4 +91,8 @@ void grpc_resolver_next_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver, grpc_channel_args **result, grpc_closure *on_complete); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_H */ diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h index 386012d2ed..3d4309f2fa 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h @@ -22,6 +22,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/pollset_set.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_ares_ev_driver grpc_ares_ev_driver; /* Start \a ev_driver. It will keep working until all IO on its ares_channel is @@ -49,5 +53,9 @@ void grpc_ares_ev_driver_destroy(grpc_ares_ev_driver *ev_driver); void grpc_ares_ev_driver_shutdown(grpc_exec_ctx *exec_ctx, grpc_ares_ev_driver *ev_driver); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H \ */ diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h index 108333047d..38fbea9aac 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h @@ -25,6 +25,10 @@ #include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/iomgr/resolve_address.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_ares_request grpc_ares_request; /* Asynchronously resolve \a name. Use \a default_port if a port isn't @@ -65,5 +69,9 @@ grpc_error *grpc_ares_init(void); it has been called the same number of times as grpc_ares_init(). */ void grpc_ares_cleanup(void); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H \ */ diff --git a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h index c084ef2a58..005f5f9417 100644 --- a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +++ b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h @@ -24,6 +24,10 @@ #define GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR \ "grpc.fake_resolver.response_generator" +#ifdef __cplusplus +extern "C" { +#endif + void grpc_resolver_fake_init(); // Instances of \a grpc_fake_resolver_response_generator are passed to the @@ -56,5 +60,9 @@ grpc_fake_resolver_response_generator_ref( void grpc_fake_resolver_response_generator_unref( grpc_fake_resolver_response_generator* generator); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FAKE_FAKE_RESOLVER_H \ */ diff --git a/src/core/ext/filters/client_channel/resolver_factory.h b/src/core/ext/filters/client_channel/resolver_factory.h index 6bd7929d4e..6e533e3248 100644 --- a/src/core/ext/filters/client_channel/resolver_factory.h +++ b/src/core/ext/filters/client_channel/resolver_factory.h @@ -24,6 +24,10 @@ #include "src/core/ext/filters/client_channel/uri_parser.h" #include "src/core/lib/iomgr/pollset_set.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_resolver_factory grpc_resolver_factory; typedef struct grpc_resolver_factory_vtable grpc_resolver_factory_vtable; @@ -67,4 +71,8 @@ grpc_resolver *grpc_resolver_factory_create_resolver( char *grpc_resolver_factory_get_default_authority( grpc_resolver_factory *factory, grpc_uri *uri); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FACTORY_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/resolver_registry.h b/src/core/ext/filters/client_channel/resolver_registry.h index 692490543d..eb08d887b1 100644 --- a/src/core/ext/filters/client_channel/resolver_registry.h +++ b/src/core/ext/filters/client_channel/resolver_registry.h @@ -22,6 +22,10 @@ #include "src/core/ext/filters/client_channel/resolver_factory.h" #include "src/core/lib/iomgr/pollset_set.h" +#ifdef __cplusplus +extern "C" { +#endif + void grpc_resolver_registry_init(); void grpc_resolver_registry_shutdown(void); @@ -66,4 +70,8 @@ char *grpc_get_default_authority(grpc_exec_ctx *exec_ctx, const char *target); char *grpc_resolver_factory_add_default_prefix_if_needed( grpc_exec_ctx *exec_ctx, const char *target); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_REGISTRY_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/retry_throttle.h b/src/core/ext/filters/client_channel/retry_throttle.h index bf99297e98..3b849475b9 100644 --- a/src/core/ext/filters/client_channel/retry_throttle.h +++ b/src/core/ext/filters/client_channel/retry_throttle.h @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /// Tracks retry throttling data for an individual server name. typedef struct grpc_server_retry_throttle_data grpc_server_retry_throttle_data; @@ -47,4 +51,8 @@ void grpc_retry_throttle_map_shutdown(); grpc_server_retry_throttle_data* grpc_retry_throttle_map_get_data_for_server( const char* server_name, int max_milli_tokens, int milli_token_ratio); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/subchannel.h b/src/core/ext/filters/client_channel/subchannel.h index 51d712f6a7..c67ff97b0b 100644 --- a/src/core/ext/filters/client_channel/subchannel.h +++ b/src/core/ext/filters/client_channel/subchannel.h @@ -26,6 +26,10 @@ #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/metadata.h" +#ifdef __cplusplus +extern "C" { +#endif + // Channel arg containing a grpc_resolved_address to connect to. #define GRPC_ARG_SUBCHANNEL_ADDRESS "grpc.subchannel_address" @@ -188,4 +192,8 @@ const char *grpc_get_subchannel_address_uri_arg(const grpc_channel_args *args); /// Caller is responsible for freeing the string. grpc_arg grpc_create_subchannel_address_arg(const grpc_resolved_address *addr); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H */ diff --git a/src/core/ext/filters/client_channel/subchannel_index.h b/src/core/ext/filters/client_channel/subchannel_index.h index 92e36d5283..09bac3592c 100644 --- a/src/core/ext/filters/client_channel/subchannel_index.h +++ b/src/core/ext/filters/client_channel/subchannel_index.h @@ -21,6 +21,10 @@ #include "src/core/ext/filters/client_channel/subchannel.h" +#ifdef __cplusplus +extern "C" { +#endif + /** \file Provides an index of active subchannels so that they can be shared amongst channels */ @@ -78,4 +82,8 @@ void grpc_subchannel_index_unref(void); * force_creation set. */ void grpc_subchannel_index_test_only_set_force_creation(bool force_creation); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H */ \ No newline at end of file diff --git a/src/core/ext/filters/client_channel/uri_parser.h b/src/core/ext/filters/client_channel/uri_parser.h index 05ca2e00e4..43e8ae64e0 100644 --- a/src/core/ext/filters/client_channel/uri_parser.h +++ b/src/core/ext/filters/client_channel/uri_parser.h @@ -22,6 +22,10 @@ #include #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { char *scheme; char *authority; @@ -47,4 +51,8 @@ const char *grpc_uri_get_query_arg(const grpc_uri *uri, const char *key); /** destroy a uri */ void grpc_uri_destroy(grpc_uri *uri); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_URI_PARSER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_URI_PARSER_H */ \ No newline at end of file diff --git a/src/core/ext/filters/deadline/deadline_filter.h b/src/core/ext/filters/deadline/deadline_filter.h index 3eb102ad28..f4a1110ee6 100644 --- a/src/core/ext/filters/deadline/deadline_filter.h +++ b/src/core/ext/filters/deadline/deadline_filter.h @@ -20,6 +20,10 @@ #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/iomgr/timer.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum grpc_deadline_timer_state { GRPC_DEADLINE_STATE_INITIAL, GRPC_DEADLINE_STATE_PENDING, @@ -89,4 +93,8 @@ bool grpc_deadline_checking_enabled(const grpc_channel_args* args); extern const grpc_channel_filter grpc_client_deadline_filter; extern const grpc_channel_filter grpc_server_deadline_filter; -#endif /* GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H */ \ No newline at end of file diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h index 65a6d0900e..65e254eb53 100644 --- a/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h +++ b/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h @@ -23,6 +23,10 @@ #include "src/core/lib/channel/channel_stack.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Identifiers for the invocation point of the users LR callback */ typedef enum grpc_load_reporting_source { GRPC_LR_POINT_UNKNOWN = 0, @@ -55,5 +59,9 @@ typedef struct grpc_load_reporting_call_data { /** Return a \a grpc_arg enabling load reporting */ grpc_arg grpc_load_reporting_enable_arg(); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_PLUGIN_H \ */ diff --git a/src/core/ext/filters/workarounds/workaround_utils.h b/src/core/ext/filters/workarounds/workaround_utils.h index 2ad7a876d5..afd5291333 100644 --- a/src/core/ext/filters/workarounds/workaround_utils.h +++ b/src/core/ext/filters/workarounds/workaround_utils.h @@ -24,6 +24,10 @@ #define GRPC_WORKAROUND_PRIORITY_HIGH 10001 #define GRPC_WORKAROUND_PROIRITY_LOW 9999 +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_workaround_user_agent_md { bool workaround_active[GRPC_MAX_WORKAROUND_ID]; } grpc_workaround_user_agent_md; @@ -34,4 +38,8 @@ typedef bool (*user_agent_parser)(grpc_mdelem); void grpc_register_workaround(uint32_t id, user_agent_parser parser); -#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/alpn/alpn.h b/src/core/ext/transport/chttp2/alpn/alpn.h index 379af4b24c..5842204c20 100644 --- a/src/core/ext/transport/chttp2/alpn/alpn.h +++ b/src/core/ext/transport/chttp2/alpn/alpn.h @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* Retuns 1 if the version is supported, 0 otherwise. */ int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size); @@ -31,4 +35,8 @@ size_t grpc_chttp2_num_alpn_versions(void); * grpc_chttp2_num_alpn_versions()) */ const char *grpc_chttp2_get_alpn_version_index(size_t i); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_ALPN_ALPN_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_ALPN_ALPN_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.h b/src/core/ext/transport/chttp2/server/chttp2_server.h index ed968496f9..e1df28ed11 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.h +++ b/src/core/ext/transport/chttp2/server/chttp2_server.h @@ -23,10 +23,18 @@ #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + /// Adds a port to \a server. Sets \a port_num to the port number. /// Takes ownership of \a args. grpc_error *grpc_chttp2_server_add_port(grpc_exec_ctx *exec_ctx, grpc_server *server, const char *addr, grpc_channel_args *args, int *port_num); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.h b/src/core/ext/transport/chttp2/transport/bin_decoder.h index 047b33d587..f50e0a8ac4 100644 --- a/src/core/ext/transport/chttp2/transport/bin_decoder.h +++ b/src/core/ext/transport/chttp2/transport/bin_decoder.h @@ -22,6 +22,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + struct grpc_base64_decode_context { /* input/output: */ uint8_t *input_cur; @@ -49,4 +53,8 @@ grpc_slice grpc_chttp2_base64_decode_with_length(grpc_exec_ctx *exec_ctx, grpc_slice input, size_t output_length); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/bin_encoder.h b/src/core/ext/transport/chttp2/transport/bin_encoder.h index a8f36a345a..ae8219c5ce 100644 --- a/src/core/ext/transport/chttp2/transport/bin_encoder.h +++ b/src/core/ext/transport/chttp2/transport/bin_encoder.h @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* base64 encode a slice. Returns a new slice, does not take ownership of the input */ grpc_slice grpc_chttp2_base64_encode(grpc_slice input); @@ -36,4 +40,8 @@ grpc_slice grpc_chttp2_huffman_compress(grpc_slice input); return y; */ grpc_slice grpc_chttp2_base64_encode_and_huffman_compress(grpc_slice input); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/src/core/ext/transport/chttp2/transport/chttp2_transport.h index 55fb1a8343..321fca4c82 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.h +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.h @@ -23,6 +23,10 @@ #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/transport/transport.h" +#ifdef __cplusplus +extern "C" { +#endif + extern grpc_tracer_flag grpc_http_trace; extern grpc_tracer_flag grpc_flowctl_trace; extern grpc_tracer_flag grpc_trace_http2_stream_state; @@ -41,4 +45,8 @@ void grpc_chttp2_transport_start_reading(grpc_exec_ctx *exec_ctx, grpc_transport *transport, grpc_slice_buffer *read_buffer); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H */ diff --git a/src/core/ext/transport/chttp2/transport/frame.h b/src/core/ext/transport/chttp2/transport/frame.h index dba4c004ec..e7debdad79 100644 --- a/src/core/ext/transport/chttp2/transport/frame.h +++ b/src/core/ext/transport/chttp2/transport/frame.h @@ -24,6 +24,10 @@ #include "src/core/lib/iomgr/error.h" +#ifdef __cplusplus +extern "C" { +#endif + /* defined in internal.h */ typedef struct grpc_chttp2_stream grpc_chttp2_stream; typedef struct grpc_chttp2_transport grpc_chttp2_transport; @@ -43,4 +47,8 @@ typedef struct grpc_chttp2_transport grpc_chttp2_transport; #define GRPC_CHTTP2_DATA_FLAG_PADDED 8 #define GRPC_CHTTP2_FLAG_HAS_PRIORITY 0x20 +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_H */ diff --git a/src/core/ext/transport/chttp2/transport/frame_data.h b/src/core/ext/transport/chttp2/transport/frame_data.h index 3f1c787847..2df99ccf98 100644 --- a/src/core/ext/transport/chttp2/transport/frame_data.h +++ b/src/core/ext/transport/chttp2/transport/frame_data.h @@ -28,6 +28,10 @@ #include "src/core/lib/transport/byte_stream.h" #include "src/core/lib/transport/transport.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { GRPC_CHTTP2_DATA_FH_0, GRPC_CHTTP2_DATA_FH_1, @@ -80,4 +84,8 @@ grpc_error *grpc_deframe_unprocessed_incoming_frames( grpc_slice_buffer *slices, grpc_slice *slice_out, grpc_byte_stream **stream_out); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.h b/src/core/ext/transport/chttp2/transport/frame_goaway.h index abc48f30c6..ce6f18b35c 100644 --- a/src/core/ext/transport/chttp2/transport/frame_goaway.h +++ b/src/core/ext/transport/chttp2/transport/frame_goaway.h @@ -25,6 +25,10 @@ #include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { GRPC_CHTTP2_GOAWAY_LSI0, GRPC_CHTTP2_GOAWAY_LSI1, @@ -60,4 +64,8 @@ void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code, grpc_slice debug_data, grpc_slice_buffer *slice_buffer); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.h b/src/core/ext/transport/chttp2/transport/frame_ping.h index 5969ace9bd..91f16f050f 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.h +++ b/src/core/ext/transport/chttp2/transport/frame_ping.h @@ -23,6 +23,10 @@ #include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { uint8_t byte; uint8_t is_ack; @@ -41,4 +45,8 @@ grpc_error *grpc_chttp2_ping_parser_parse(grpc_exec_ctx *exec_ctx, void *parser, /* Test-only function for disabling ping ack */ void grpc_set_disable_ping_ack(bool disable_ping_ack); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_PING_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_PING_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h index d088221b52..bdca064a91 100644 --- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h @@ -24,6 +24,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/transport/transport.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { uint8_t byte; uint8_t reason_bytes[4]; @@ -40,4 +44,8 @@ grpc_error *grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx *exec_ctx, grpc_chttp2_stream *s, grpc_slice slice, int is_last); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.h b/src/core/ext/transport/chttp2/transport/frame_settings.h index 47479d675d..f0793f0e73 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.h +++ b/src/core/ext/transport/chttp2/transport/frame_settings.h @@ -25,6 +25,10 @@ #include "src/core/ext/transport/chttp2/transport/http2_settings.h" #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { GRPC_CHTTP2_SPS_ID0, GRPC_CHTTP2_SPS_ID1, @@ -58,4 +62,8 @@ grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx, grpc_chttp2_stream *s, grpc_slice slice, int is_last); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/frame_window_update.h b/src/core/ext/transport/chttp2/transport/frame_window_update.h index 698da4e351..29cf0cc740 100644 --- a/src/core/ext/transport/chttp2/transport/frame_window_update.h +++ b/src/core/ext/transport/chttp2/transport/frame_window_update.h @@ -24,6 +24,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/transport/transport.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { uint8_t byte; uint8_t is_connection_update; @@ -39,4 +43,8 @@ grpc_error *grpc_chttp2_window_update_parser_parse( grpc_exec_ctx *exec_ctx, void *parser, grpc_chttp2_transport *t, grpc_chttp2_stream *s, grpc_slice slice, int is_last); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/src/core/ext/transport/chttp2/transport/hpack_encoder.h index 271192f894..dc28b5566a 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.h +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.h @@ -34,6 +34,10 @@ /* maximum table size we'll actually use */ #define GRPC_CHTTP2_HPACKC_MAX_TABLE_SIZE (1024 * 1024) +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { uint32_t filter_elems_sum; uint32_t max_table_size; @@ -91,4 +95,8 @@ void grpc_chttp2_encode_header(grpc_exec_ctx *exec_ctx, const grpc_encode_header_options *options, grpc_slice_buffer *outbuf); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.h b/src/core/ext/transport/chttp2/transport/hpack_parser.h index 8fbc6a602b..6c36ebdf8d 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.h +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.h @@ -27,6 +27,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/transport/metadata.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_chttp2_hpack_parser grpc_chttp2_hpack_parser; typedef grpc_error *(*grpc_chttp2_hpack_parser_state)( @@ -111,4 +115,8 @@ grpc_error *grpc_chttp2_header_parser_parse(grpc_exec_ctx *exec_ctx, grpc_chttp2_stream *s, grpc_slice slice, int is_last); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/hpack_table.h b/src/core/ext/transport/chttp2/transport/hpack_table.h index 2cf8f68506..a3ce2730a8 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_table.h +++ b/src/core/ext/transport/chttp2/transport/hpack_table.h @@ -24,6 +24,10 @@ #include "src/core/lib/iomgr/error.h" #include "src/core/lib/transport/metadata.h" +#ifdef __cplusplus +extern "C" { +#endif + /* HPACK header table */ /* last index in the static table */ @@ -94,4 +98,8 @@ typedef struct { grpc_chttp2_hptbl_find_result grpc_chttp2_hptbl_find( const grpc_chttp2_hptbl *tbl, grpc_mdelem md); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_TABLE_H */ diff --git a/src/core/ext/transport/chttp2/transport/http2_settings.h b/src/core/ext/transport/chttp2/transport/http2_settings.h index 706dfc3139..01e80b8d01 100644 --- a/src/core/ext/transport/chttp2/transport/http2_settings.h +++ b/src/core/ext/transport/chttp2/transport/http2_settings.h @@ -35,6 +35,10 @@ typedef enum { } grpc_chttp2_setting_id; #define GRPC_CHTTP2_NUM_SETTINGS 7 + +#ifdef __cplusplus +extern "C" { +#endif extern const uint16_t grpc_setting_id_to_wire_id[]; bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id *out); @@ -56,4 +60,8 @@ typedef struct { extern const grpc_chttp2_setting_parameters grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS]; -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/incoming_metadata.h b/src/core/ext/transport/chttp2/transport/incoming_metadata.h index a951d8764c..9ffcabd0b9 100644 --- a/src/core/ext/transport/chttp2/transport/incoming_metadata.h +++ b/src/core/ext/transport/chttp2/transport/incoming_metadata.h @@ -21,6 +21,10 @@ #include "src/core/lib/transport/transport.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { gpr_arena *arena; grpc_metadata_batch batch; @@ -45,4 +49,8 @@ grpc_error *grpc_chttp2_incoming_metadata_buffer_replace_or_add( void grpc_chttp2_incoming_metadata_buffer_set_deadline( grpc_chttp2_incoming_metadata_buffer *buffer, gpr_timespec deadline); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 49022155aa..96af18f1d1 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -42,6 +42,10 @@ #include "src/core/lib/transport/pid_controller.h" #include "src/core/lib/transport/transport_impl.h" +#ifdef __cplusplus +extern "C" { +#endif + /* streams are kept in various linked lists depending on what things need to happen to them... this enum labels each list */ typedef enum { @@ -908,4 +912,8 @@ void grpc_chttp2_fail_pending_writes(grpc_exec_ctx *exec_ctx, void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args, bool is_client); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INTERNAL_H */ diff --git a/src/core/ext/transport/chttp2/transport/stream_map.h b/src/core/ext/transport/chttp2/transport/stream_map.h index 30c50ba32e..364d37c33a 100644 --- a/src/core/ext/transport/chttp2/transport/stream_map.h +++ b/src/core/ext/transport/chttp2/transport/stream_map.h @@ -23,6 +23,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* Data structure to map a uint32_t to a data object (represented by a void*) Represented as a sorted array of keys, and a corresponding array of values. @@ -65,4 +69,8 @@ void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map *map, void *value), void *user_data); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H */ \ No newline at end of file diff --git a/src/core/ext/transport/chttp2/transport/varint.h b/src/core/ext/transport/chttp2/transport/varint.h index 5a2b670f06..d3a9d902c4 100644 --- a/src/core/ext/transport/chttp2/transport/varint.h +++ b/src/core/ext/transport/chttp2/transport/varint.h @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* Helpers for hpack varint encoding */ /* length of a value that needs varint tail encoding (it's bigger than can be @@ -57,4 +61,8 @@ void grpc_chttp2_hpack_write_varint_tail(uint32_t tail_value, uint8_t* target, } \ } while (0) +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_VARINT_H */ diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.h b/src/core/ext/transport/cronet/transport/cronet_transport.h index 3bd4249b79..c473afa100 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.h +++ b/src/core/ext/transport/cronet/transport/cronet_transport.h @@ -21,8 +21,16 @@ #include "src/core/lib/transport/transport.h" +#ifdef __cplusplus +extern "C" { +#endif + grpc_transport *grpc_create_cronet_transport(void *engine, const char *target, const grpc_channel_args *args, void *reserved); -#endif /* GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_TRANSPORT_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_TRANSPORT_H */ \ No newline at end of file diff --git a/src/core/lib/channel/channel_args.h b/src/core/lib/channel/channel_args.h index 0599e189c3..2837174f49 100644 --- a/src/core/lib/channel/channel_args.h +++ b/src/core/lib/channel/channel_args.h @@ -23,6 +23,10 @@ #include #include "src/core/lib/iomgr/socket_mutator.h" +#ifdef __cplusplus +extern "C" { +#endif + // Channel args are intentionally immutable, to avoid the need for locking. /** Copy the arguments in \a src into a new instance */ @@ -149,4 +153,8 @@ grpc_arg grpc_channel_arg_integer_create(char *name, int value); grpc_arg grpc_channel_arg_pointer_create(char *name, void *value, const grpc_arg_pointer_vtable *vtable); -#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */ \ No newline at end of file diff --git a/src/core/lib/channel/connected_channel.h b/src/core/lib/channel/connected_channel.h index 10c98cce54..b55a1089a0 100644 --- a/src/core/lib/channel/connected_channel.h +++ b/src/core/lib/channel/connected_channel.h @@ -21,6 +21,10 @@ #include "src/core/lib/channel/channel_stack_builder.h" +#ifdef __cplusplus +extern "C" { +#endif + extern const grpc_channel_filter grpc_connected_filter; bool grpc_add_connected_filter(grpc_exec_ctx *exec_ctx, @@ -30,4 +34,8 @@ bool grpc_add_connected_filter(grpc_exec_ctx *exec_ctx, /* Debug helper to dig the transport stream out of a call element */ grpc_stream *grpc_connected_channel_get_stream(grpc_call_element *elem); -#endif /* GRPC_CORE_LIB_CHANNEL_CONNECTED_CHANNEL_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_CHANNEL_CONNECTED_CHANNEL_H */ \ No newline at end of file diff --git a/src/core/lib/channel/handshaker.h b/src/core/lib/channel/handshaker.h index eb9a59bd08..a857cde791 100644 --- a/src/core/lib/channel/handshaker.h +++ b/src/core/lib/channel/handshaker.h @@ -26,6 +26,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/tcp_server.h" +#ifdef __cplusplus +extern "C" { +#endif + /// Handshakers are used to perform initial handshakes on a connection /// before the client sends the initial request. Some examples of what /// a handshaker can be used for includes support for HTTP CONNECT on @@ -164,4 +168,8 @@ void grpc_handshake_manager_pending_list_remove(grpc_handshake_manager** head, void grpc_handshake_manager_pending_list_shutdown_all( grpc_exec_ctx* exec_ctx, grpc_handshake_manager* head, grpc_error* why); -#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */ \ No newline at end of file diff --git a/src/core/lib/channel/handshaker_factory.h b/src/core/lib/channel/handshaker_factory.h index 6238e735dc..2a130de252 100644 --- a/src/core/lib/channel/handshaker_factory.h +++ b/src/core/lib/channel/handshaker_factory.h @@ -24,6 +24,10 @@ #include "src/core/lib/channel/handshaker.h" #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + // A handshaker factory is used to create handshakers. typedef struct grpc_handshaker_factory grpc_handshaker_factory; @@ -48,4 +52,8 @@ void grpc_handshaker_factory_add_handshakers( void grpc_handshaker_factory_destroy( grpc_exec_ctx *exec_ctx, grpc_handshaker_factory *handshaker_factory); -#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_FACTORY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_FACTORY_H */ \ No newline at end of file diff --git a/src/core/lib/channel/handshaker_registry.h b/src/core/lib/channel/handshaker_registry.h index a3b2ac1dc7..e96bf06b6a 100644 --- a/src/core/lib/channel/handshaker_registry.h +++ b/src/core/lib/channel/handshaker_registry.h @@ -24,6 +24,10 @@ #include "src/core/lib/channel/handshaker_factory.h" #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { HANDSHAKER_CLIENT = 0, HANDSHAKER_SERVER, @@ -45,4 +49,8 @@ void grpc_handshakers_add(grpc_exec_ctx* exec_ctx, const grpc_channel_args* args, grpc_handshake_manager* handshake_mgr); -#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_REGISTRY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_REGISTRY_H */ \ No newline at end of file diff --git a/src/core/lib/compression/algorithm_metadata.h b/src/core/lib/compression/algorithm_metadata.h index 08feafc1bb..3eb7088230 100644 --- a/src/core/lib/compression/algorithm_metadata.h +++ b/src/core/lib/compression/algorithm_metadata.h @@ -22,6 +22,10 @@ #include #include "src/core/lib/transport/metadata.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Return compression algorithm based metadata value */ grpc_slice grpc_compression_algorithm_slice( grpc_compression_algorithm algorithm); @@ -49,4 +53,8 @@ grpc_compression_algorithm grpc_compression_algorithm_from_slice( grpc_stream_compression_algorithm grpc_stream_compression_algorithm_from_slice( grpc_slice str); -#endif /* GRPC_CORE_LIB_COMPRESSION_ALGORITHM_METADATA_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_COMPRESSION_ALGORITHM_METADATA_H */ \ No newline at end of file diff --git a/src/core/lib/compression/message_compress.h b/src/core/lib/compression/message_compress.h index ca8ca37f8e..d2545a02c2 100644 --- a/src/core/lib/compression/message_compress.h +++ b/src/core/lib/compression/message_compress.h @@ -22,6 +22,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* compress 'input' to 'output' using 'algorithm'. On success, appends compressed slices to output and returns 1. On failure, appends uncompressed slices to output and returns 0. */ @@ -36,4 +40,8 @@ int grpc_msg_decompress(grpc_exec_ctx* exec_ctx, grpc_compression_algorithm algorithm, grpc_slice_buffer* input, grpc_slice_buffer* output); -#endif /* GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H */ \ No newline at end of file diff --git a/src/core/lib/compression/stream_compression.h b/src/core/lib/compression/stream_compression.h index 6d073280fa..901f9357ee 100644 --- a/src/core/lib/compression/stream_compression.h +++ b/src/core/lib/compression/stream_compression.h @@ -24,6 +24,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #include "src/core/lib/transport/static_metadata.h" typedef struct grpc_stream_compression_vtable grpc_stream_compression_vtable; @@ -111,4 +115,8 @@ void grpc_stream_compression_context_destroy( int grpc_stream_compression_method_parse( grpc_slice value, bool is_compress, grpc_stream_compression_method *method); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/core/lib/debug/stats.h b/src/core/lib/debug/stats.h index 09d190d488..fec1d651e6 100644 --- a/src/core/lib/debug/stats.h +++ b/src/core/lib/debug/stats.h @@ -23,6 +23,10 @@ #include "src/core/lib/debug/stats_data.h" #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_stats_data { gpr_atm counters[GRPC_STATS_COUNTER_COUNT]; gpr_atm histograms[GRPC_STATS_HISTOGRAM_BUCKETS]; @@ -58,4 +62,8 @@ double grpc_stats_histo_percentile(const grpc_stats_data *data, size_t grpc_stats_histo_count(const grpc_stats_data *data, grpc_stats_histograms histogram); +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/core/lib/debug/stats_data.h b/src/core/lib/debug/stats_data.h index 28dab00117..cf5bafbd04 100644 --- a/src/core/lib/debug/stats_data.h +++ b/src/core/lib/debug/stats_data.h @@ -24,6 +24,10 @@ #include #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED, GRPC_STATS_COUNTER_SERVER_CALLS_CREATED, @@ -467,4 +471,8 @@ extern const int *const grpc_stats_histo_bucket_boundaries[13]; extern void (*const grpc_stats_inc_histogram[13])(grpc_exec_ctx *exec_ctx, int x); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_DEBUG_STATS_DATA_H */ diff --git a/src/core/lib/debug/trace.h b/src/core/lib/debug/trace.h index 64f2e3fc33..558ba942bb 100644 --- a/src/core/lib/debug/trace.h +++ b/src/core/lib/debug/trace.h @@ -23,6 +23,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #if defined(__has_feature) #if __has_feature(thread_sanitizer) #define GRPC_THREADSAFE_TRACER @@ -52,4 +56,8 @@ void grpc_register_tracer(grpc_tracer_flag *flag); void grpc_tracer_init(const char *env_var_name); void grpc_tracer_shutdown(void); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_DEBUG_TRACE_H */ diff --git a/src/core/lib/http/format_request.h b/src/core/lib/http/format_request.h index 12b42e42fa..a559aac660 100644 --- a/src/core/lib/http/format_request.h +++ b/src/core/lib/http/format_request.h @@ -22,6 +22,10 @@ #include #include "src/core/lib/http/httpcli.h" +#ifdef __cplusplus +extern "C" { +#endif + grpc_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request); grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request, const char *body_bytes, @@ -29,4 +33,8 @@ grpc_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request, grpc_slice grpc_httpcli_format_connect_request( const grpc_httpcli_request *request); -#endif /* GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H */ \ No newline at end of file diff --git a/src/core/lib/http/httpcli.h b/src/core/lib/http/httpcli.h index 809618695e..630481da54 100644 --- a/src/core/lib/http/httpcli.h +++ b/src/core/lib/http/httpcli.h @@ -32,6 +32,10 @@ /* User agent this library reports */ #define GRPC_HTTPCLI_USER_AGENT "grpc-httpcli/0.0" +#ifdef __cplusplus +extern "C" { +#endif + /* Tracks in-progress http requests TODO(ctiller): allow caching and capturing multiple requests for the same content and combining them */ @@ -123,4 +127,8 @@ typedef int (*grpc_httpcli_post_override)( void grpc_httpcli_set_override(grpc_httpcli_get_override get, grpc_httpcli_post_override post); -#endif /* GRPC_CORE_LIB_HTTP_HTTPCLI_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_HTTP_HTTPCLI_H */ \ No newline at end of file diff --git a/src/core/lib/http/parser.h b/src/core/lib/http/parser.h index c8dced3901..5484948bea 100644 --- a/src/core/lib/http/parser.h +++ b/src/core/lib/http/parser.h @@ -27,6 +27,10 @@ /* Maximum length of a header string of the form 'Key: Value\r\n' */ #define GRPC_HTTP_PARSER_MAX_HEADER_LENGTH 4096 +#ifdef __cplusplus +extern "C" { +#endif + /* A single header to be passed in a request */ typedef struct grpc_http_header { char *key; @@ -109,4 +113,8 @@ void grpc_http_response_destroy(grpc_http_response *response); extern grpc_tracer_flag grpc_http1_trace; -#endif /* GRPC_CORE_LIB_HTTP_PARSER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_HTTP_PARSER_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/call_combiner.h b/src/core/lib/iomgr/call_combiner.h index 5cfb3f0c07..527f84fce0 100644 --- a/src/core/lib/iomgr/call_combiner.h +++ b/src/core/lib/iomgr/call_combiner.h @@ -27,6 +27,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/support/mpscq.h" +#ifdef __cplusplus +extern "C" { +#endif + // A simple, lock-free mechanism for serializing activity related to a // single call. This is similar to a combiner but is more lightweight. // @@ -118,4 +122,8 @@ void grpc_call_combiner_cancel(grpc_exec_ctx* exec_ctx, grpc_call_combiner* call_combiner, grpc_error* error); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_IOMGR_CALL_COMBINER_H */ diff --git a/src/core/lib/iomgr/combiner.h b/src/core/lib/iomgr/combiner.h index 8e0434369d..10e5fb480d 100644 --- a/src/core/lib/iomgr/combiner.h +++ b/src/core/lib/iomgr/combiner.h @@ -26,6 +26,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/support/mpscq.h" +#ifdef __cplusplus +extern "C" { +#endif + // Provides serialized access to some resource. // Each action queued on a combiner is executed serially in a borrowed thread. // The actual thread executing actions may change over time (but there will only @@ -63,4 +67,8 @@ bool grpc_combiner_continue_exec_ctx(grpc_exec_ctx *exec_ctx); extern grpc_tracer_flag grpc_combiner_trace; +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_IOMGR_COMBINER_H */ diff --git a/src/core/lib/iomgr/endpoint.h b/src/core/lib/iomgr/endpoint.h index 8f0523a981..16ff0ab733 100644 --- a/src/core/lib/iomgr/endpoint.h +++ b/src/core/lib/iomgr/endpoint.h @@ -26,6 +26,10 @@ #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/iomgr/resource_quota.h" +#ifdef __cplusplus +extern "C" { +#endif + /* An endpoint caps a streaming channel between two communicating processes. Examples may be: a tcp socket, , or some shared memory. */ @@ -95,4 +99,8 @@ struct grpc_endpoint { const grpc_endpoint_vtable *vtable; }; -#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/endpoint_pair.h b/src/core/lib/iomgr/endpoint_pair.h index b60e62fc3e..f8830022f4 100644 --- a/src/core/lib/iomgr/endpoint_pair.h +++ b/src/core/lib/iomgr/endpoint_pair.h @@ -21,6 +21,10 @@ #include "src/core/lib/iomgr/endpoint.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { grpc_endpoint *client; grpc_endpoint *server; @@ -29,4 +33,8 @@ typedef struct { grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char *name, grpc_channel_args *args); -#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_PAIR_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_PAIR_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/error_internal.h b/src/core/lib/iomgr/error_internal.h index 7507484557..f718e06d4e 100644 --- a/src/core/lib/iomgr/error_internal.h +++ b/src/core/lib/iomgr/error_internal.h @@ -24,6 +24,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_linked_error grpc_linked_error; struct grpc_linked_error { @@ -57,4 +61,8 @@ struct grpc_error { bool grpc_error_is_special(grpc_error *err); -#endif /* GRPC_CORE_LIB_IOMGR_ERROR_INTERNAL_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_ERROR_INTERNAL_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/ev_epoll1_linux.h b/src/core/lib/iomgr/ev_epoll1_linux.h index 0696e0df40..66fd826b49 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.h +++ b/src/core/lib/iomgr/ev_epoll1_linux.h @@ -22,8 +22,16 @@ #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/port.h" +#ifdef __cplusplus +extern "C" { +#endif + // a polling engine that utilizes a singleton epoll set and turnstile polling const grpc_event_engine_vtable *grpc_init_epoll1_linux(bool explicit_request); -#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLL1_LINUX_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLL1_LINUX_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/ev_epollex_linux.h b/src/core/lib/iomgr/ev_epollex_linux.h index cff9b43c02..58cc5a24f8 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.h +++ b/src/core/lib/iomgr/ev_epollex_linux.h @@ -22,7 +22,15 @@ #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/port.h" +#ifdef __cplusplus +extern "C" { +#endif + const grpc_event_engine_vtable *grpc_init_epollex_linux( bool explicitly_requested); -#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLEX_LINUX_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLEX_LINUX_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/ev_epollsig_linux.h b/src/core/lib/iomgr/ev_epollsig_linux.h index 88328682b3..c04ff27400 100644 --- a/src/core/lib/iomgr/ev_epollsig_linux.h +++ b/src/core/lib/iomgr/ev_epollsig_linux.h @@ -22,6 +22,10 @@ #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/port.h" +#ifdef __cplusplus +extern "C" { +#endif + const grpc_event_engine_vtable *grpc_init_epollsig_linux(bool explicit_request); #ifdef GRPC_LINUX_EPOLL @@ -30,4 +34,8 @@ void *grpc_pollset_get_polling_island(grpc_pollset *ps); bool grpc_are_polling_islands_equal(void *p, void *q); #endif /* defined(GRPC_LINUX_EPOLL) */ +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLLSIG_LINUX_H */ diff --git a/src/core/lib/iomgr/ev_poll_posix.h b/src/core/lib/iomgr/ev_poll_posix.h index d444e60944..84b68155b5 100644 --- a/src/core/lib/iomgr/ev_poll_posix.h +++ b/src/core/lib/iomgr/ev_poll_posix.h @@ -21,7 +21,15 @@ #include "src/core/lib/iomgr/ev_posix.h" +#ifdef __cplusplus +extern "C" { +#endif + const grpc_event_engine_vtable *grpc_init_poll_posix(bool explicit_request); const grpc_event_engine_vtable *grpc_init_poll_cv_posix(bool explicit_request); -#endif /* GRPC_CORE_LIB_IOMGR_EV_POLL_POSIX_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_EV_POLL_POSIX_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h index 1ff2ff1413..5ad1c13ee6 100644 --- a/src/core/lib/iomgr/ev_posix.h +++ b/src/core/lib/iomgr/ev_posix.h @@ -27,6 +27,10 @@ #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/iomgr/wakeup_fd_posix.h" +#ifdef __cplusplus +extern "C" { +#endif + extern grpc_tracer_flag grpc_polling_trace; /* Disabled by default */ typedef struct grpc_fd grpc_fd; @@ -158,4 +162,8 @@ extern grpc_poll_function_type grpc_poll_function; void grpc_set_event_engine_test_only(const grpc_event_engine_vtable *); const grpc_event_engine_vtable *grpc_get_event_engine_test_only(); -#endif /* GRPC_CORE_LIB_IOMGR_EV_POSIX_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_EV_POSIX_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/exec_ctx.h b/src/core/lib/iomgr/exec_ctx.h index c89792c8c4..a93728f0a6 100644 --- a/src/core/lib/iomgr/exec_ctx.h +++ b/src/core/lib/iomgr/exec_ctx.h @@ -22,6 +22,10 @@ #include #include "src/core/lib/iomgr/closure.h" +#ifdef __cplusplus +extern "C" { +#endif + /* #define GRPC_EXECUTION_CONTEXT_SANITIZER 1 */ /** A workqueue represents a list of work to be executed asynchronously. @@ -106,4 +110,8 @@ void grpc_exec_ctx_global_init(void); void grpc_exec_ctx_global_init(void); void grpc_exec_ctx_global_shutdown(void); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_IOMGR_EXEC_CTX_H */ diff --git a/src/core/lib/iomgr/executor.h b/src/core/lib/iomgr/executor.h index 0412c02790..ab3fc901de 100644 --- a/src/core/lib/iomgr/executor.h +++ b/src/core/lib/iomgr/executor.h @@ -21,6 +21,10 @@ #include "src/core/lib/iomgr/closure.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { GRPC_EXECUTOR_SHORT, GRPC_EXECUTOR_LONG @@ -45,4 +49,8 @@ bool grpc_executor_is_threaded(); grpc_executor_shutdown */ void grpc_executor_set_threading(grpc_exec_ctx *exec_ctx, bool enable); -#endif /* GRPC_CORE_LIB_IOMGR_EXECUTOR_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_EXECUTOR_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/gethostname.h b/src/core/lib/iomgr/gethostname.h index 9c6b9d8d42..4dcf50c591 100644 --- a/src/core/lib/iomgr/gethostname.h +++ b/src/core/lib/iomgr/gethostname.h @@ -19,8 +19,16 @@ #ifndef GRPC_CORE_LIB_IOMGR_GETHOSTNAME_H #define GRPC_CORE_LIB_IOMGR_GETHOSTNAME_H +#ifdef __cplusplus +extern "C" { +#endif + // Returns the hostname of the local machine. // Caller takes ownership of result. char *grpc_gethostname(); -#endif /* GRPC_CORE_LIB_IOMGR_GETHOSTNAME_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_GETHOSTNAME_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/iocp_windows.h b/src/core/lib/iomgr/iocp_windows.h index 9c89e868c5..341c159501 100644 --- a/src/core/lib/iomgr/iocp_windows.h +++ b/src/core/lib/iomgr/iocp_windows.h @@ -23,6 +23,10 @@ #include "src/core/lib/iomgr/socket_windows.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { GRPC_IOCP_WORK_WORK, GRPC_IOCP_WORK_TIMEOUT, @@ -37,4 +41,8 @@ void grpc_iocp_flush(void); void grpc_iocp_shutdown(void); void grpc_iocp_add_socket(grpc_winsocket *); -#endif /* GRPC_CORE_LIB_IOMGR_IOCP_WINDOWS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_IOCP_WINDOWS_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/iomgr.h b/src/core/lib/iomgr/iomgr.h index e3cd6ebe79..fea08496fe 100644 --- a/src/core/lib/iomgr/iomgr.h +++ b/src/core/lib/iomgr/iomgr.h @@ -22,6 +22,10 @@ #include #include "src/core/lib/iomgr/port.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Initializes the iomgr. */ void grpc_iomgr_init(grpc_exec_ctx *exec_ctx); @@ -32,4 +36,8 @@ void grpc_iomgr_start(grpc_exec_ctx *exec_ctx); * exec_ctx. */ void grpc_iomgr_shutdown(grpc_exec_ctx *exec_ctx); -#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/iomgr_internal.h b/src/core/lib/iomgr/iomgr_internal.h index 836d82515d..005abbed13 100644 --- a/src/core/lib/iomgr/iomgr_internal.h +++ b/src/core/lib/iomgr/iomgr_internal.h @@ -23,6 +23,10 @@ #include "src/core/lib/iomgr/iomgr.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_iomgr_object { char *name; struct grpc_iomgr_object *next; @@ -40,4 +44,8 @@ void grpc_iomgr_platform_shutdown(void); bool grpc_iomgr_abort_on_leaks(void); -#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/is_epollexclusive_available.h b/src/core/lib/iomgr/is_epollexclusive_available.h index 1d2e133a3b..5c3e483065 100644 --- a/src/core/lib/iomgr/is_epollexclusive_available.h +++ b/src/core/lib/iomgr/is_epollexclusive_available.h @@ -21,6 +21,14 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + bool grpc_is_epollexclusive_available(void); -#endif /* GRPC_CORE_LIB_IOMGR_IS_EPOLLEXCLUSIVE_AVAILABLE_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_IS_EPOLLEXCLUSIVE_AVAILABLE_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/lockfree_event.h b/src/core/lib/iomgr/lockfree_event.h index 6a14a0f3b2..925f004945 100644 --- a/src/core/lib/iomgr/lockfree_event.h +++ b/src/core/lib/iomgr/lockfree_event.h @@ -25,6 +25,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + void grpc_lfev_init(gpr_atm *state); void grpc_lfev_destroy(gpr_atm *state); bool grpc_lfev_is_shutdown(gpr_atm *state); @@ -37,4 +41,8 @@ bool grpc_lfev_set_shutdown(grpc_exec_ctx *exec_ctx, gpr_atm *state, void grpc_lfev_set_ready(grpc_exec_ctx *exec_ctx, gpr_atm *state, const char *variable); -#endif /* GRPC_CORE_LIB_IOMGR_LOCKFREE_EVENT_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_LOCKFREE_EVENT_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/network_status_tracker.h b/src/core/lib/iomgr/network_status_tracker.h index c0295c1f74..af50d51257 100644 --- a/src/core/lib/iomgr/network_status_tracker.h +++ b/src/core/lib/iomgr/network_status_tracker.h @@ -20,6 +20,10 @@ #define GRPC_CORE_LIB_IOMGR_NETWORK_STATUS_TRACKER_H #include "src/core/lib/iomgr/endpoint.h" +#ifdef __cplusplus +extern "C" { +#endif + void grpc_network_status_init(void); void grpc_network_status_shutdown(void); @@ -27,4 +31,8 @@ void grpc_network_status_register_endpoint(grpc_endpoint *ep); void grpc_network_status_unregister_endpoint(grpc_endpoint *ep); void grpc_network_status_shutdown_all_endpoints(); -#endif /* GRPC_CORE_LIB_IOMGR_NETWORK_STATUS_TRACKER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_NETWORK_STATUS_TRACKER_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/polling_entity.h b/src/core/lib/iomgr/polling_entity.h index a161e1fea6..4a37acf212 100644 --- a/src/core/lib/iomgr/polling_entity.h +++ b/src/core/lib/iomgr/polling_entity.h @@ -22,6 +22,10 @@ #include "src/core/lib/iomgr/pollset.h" #include "src/core/lib/iomgr/pollset_set.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum grpc_pollset_tag { GRPC_POLLS_NONE, GRPC_POLLS_POLLSET, @@ -64,4 +68,8 @@ void grpc_polling_entity_add_to_pollset_set(grpc_exec_ctx *exec_ctx, void grpc_polling_entity_del_from_pollset_set(grpc_exec_ctx *exec_ctx, grpc_polling_entity *pollent, grpc_pollset_set *pss_dst); -#endif /* GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/pollset.h b/src/core/lib/iomgr/pollset.h index a0f6b3a9d3..28d63949ea 100644 --- a/src/core/lib/iomgr/pollset.h +++ b/src/core/lib/iomgr/pollset.h @@ -25,6 +25,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifndef NDEBUG extern grpc_tracer_flag grpc_trace_fd_refcount; #endif @@ -80,4 +84,8 @@ grpc_error *grpc_pollset_kick(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, grpc_pollset_worker *specific_worker) GRPC_MUST_USE_RESULT; +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_IOMGR_POLLSET_H */ diff --git a/src/core/lib/iomgr/pollset_set.h b/src/core/lib/iomgr/pollset_set.h index 29c0f03561..17df86542d 100644 --- a/src/core/lib/iomgr/pollset_set.h +++ b/src/core/lib/iomgr/pollset_set.h @@ -21,6 +21,10 @@ #include "src/core/lib/iomgr/pollset.h" +#ifdef __cplusplus +extern "C" { +#endif + /* A grpc_pollset_set is a set of pollsets that are interested in an action. Adding a pollset to a pollset_set automatically adds any fd's (etc) that have been registered with the set_set to that pollset. @@ -44,4 +48,8 @@ void grpc_pollset_set_del_pollset_set(grpc_exec_ctx *exec_ctx, grpc_pollset_set *bag, grpc_pollset_set *item); -#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_SET_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_SET_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/pollset_uv.h b/src/core/lib/iomgr/pollset_uv.h index 566c110ca6..d8f72ff867 100644 --- a/src/core/lib/iomgr/pollset_uv.h +++ b/src/core/lib/iomgr/pollset_uv.h @@ -19,9 +19,17 @@ #ifndef GRPC_CORE_LIB_IOMGR_POLLSET_UV_H #define GRPC_CORE_LIB_IOMGR_POLLSET_UV_H +#ifdef __cplusplus +extern "C" { +#endif + extern int grpc_pollset_work_run_loop; void grpc_pollset_global_init(void); void grpc_pollset_global_shutdown(void); -#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_UV_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_UV_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/pollset_windows.h b/src/core/lib/iomgr/pollset_windows.h index 71878c3d30..7733d26471 100644 --- a/src/core/lib/iomgr/pollset_windows.h +++ b/src/core/lib/iomgr/pollset_windows.h @@ -23,6 +23,10 @@ #include "src/core/lib/iomgr/socket_windows.h" +#ifdef __cplusplus +extern "C" { +#endif + /* There isn't really any such thing as a pollset under Windows, due to the nature of the IO completion ports. A Windows "pollset" is merely a mutex used to synchronize with the IOCP, and workers are condition variables @@ -60,4 +64,8 @@ struct grpc_pollset { void grpc_pollset_global_init(void); void grpc_pollset_global_shutdown(void); -#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/resolve_address.h b/src/core/lib/iomgr/resolve_address.h index fe1dd78576..4a6df2cf26 100644 --- a/src/core/lib/iomgr/resolve_address.h +++ b/src/core/lib/iomgr/resolve_address.h @@ -25,6 +25,10 @@ #define GRPC_MAX_SOCKADDR_SIZE 128 +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { char addr[GRPC_MAX_SOCKADDR_SIZE]; size_t len; @@ -52,4 +56,8 @@ extern grpc_error *(*grpc_blocking_resolve_address)( const char *name, const char *default_port, grpc_resolved_addresses **addresses); -#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/resource_quota.h b/src/core/lib/iomgr/resource_quota.h index d66f9ae774..3afb525434 100644 --- a/src/core/lib/iomgr/resource_quota.h +++ b/src/core/lib/iomgr/resource_quota.h @@ -24,6 +24,10 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + /** \file Tracks resource usage against a pool. The current implementation tracks only memory usage, but in the future @@ -150,4 +154,8 @@ grpc_slice grpc_resource_user_slice_malloc(grpc_exec_ctx *exec_ctx, grpc_resource_user *resource_user, size_t size); -#endif /* GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/sockaddr_utils.h b/src/core/lib/iomgr/sockaddr_utils.h index a589a19705..129bb54fc9 100644 --- a/src/core/lib/iomgr/sockaddr_utils.h +++ b/src/core/lib/iomgr/sockaddr_utils.h @@ -21,6 +21,10 @@ #include "src/core/lib/iomgr/resolve_address.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Returns true if addr is an IPv4-mapped IPv6 address within the ::ffff:0.0.0.0/96 range, or false otherwise. @@ -77,4 +81,8 @@ const char *grpc_sockaddr_get_uri_scheme(const grpc_resolved_address *addr); int grpc_sockaddr_get_family(const grpc_resolved_address *resolved_addr); -#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_UTILS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_UTILS_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/socket_utils.h b/src/core/lib/iomgr/socket_utils.h index 03fe46e5e9..f319e931b6 100644 --- a/src/core/lib/iomgr/socket_utils.h +++ b/src/core/lib/iomgr/socket_utils.h @@ -21,7 +21,15 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* A wrapper for inet_ntop on POSIX systems and InetNtop on Windows systems */ const char *grpc_inet_ntop(int af, const void *src, char *dst, size_t size); -#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/socket_utils_posix.h b/src/core/lib/iomgr/socket_utils_posix.h index eef80b439e..623b83f08b 100644 --- a/src/core/lib/iomgr/socket_utils_posix.h +++ b/src/core/lib/iomgr/socket_utils_posix.h @@ -29,6 +29,10 @@ #include "src/core/lib/iomgr/socket_factory_posix.h" #include "src/core/lib/iomgr/socket_mutator.h" +#ifdef __cplusplus +extern "C" { +#endif + /* a wrapper for accept or accept4 */ int grpc_accept4(int sockfd, grpc_resolved_address *resolved_addr, int nonblock, int cloexec); @@ -129,4 +133,8 @@ grpc_error *grpc_create_dualstack_socket_using_factory( grpc_socket_factory *factory, const grpc_resolved_address *addr, int type, int protocol, grpc_dualstack_mode *dsmode, int *newfd); -#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_POSIX_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_POSIX_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/socket_windows.h b/src/core/lib/iomgr/socket_windows.h index 67dc4ca53e..a00a7615a3 100644 --- a/src/core/lib/iomgr/socket_windows.h +++ b/src/core/lib/iomgr/socket_windows.h @@ -28,6 +28,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/iomgr_internal.h" +#ifdef __cplusplus +extern "C" { +#endif + /* This holds the data for an outstanding read or write on a socket. The mutex to protect the concurrent access to that data is the one inside the winsocket wrapper. */ @@ -107,4 +111,8 @@ void grpc_socket_become_ready(grpc_exec_ctx *exec_ctx, grpc_winsocket *winsocket, grpc_winsocket_callback_info *ci); -#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_WINDOWS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_WINDOWS_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/tcp_client.h b/src/core/lib/iomgr/tcp_client.h index 6c9e51ae84..18cf6114f2 100644 --- a/src/core/lib/iomgr/tcp_client.h +++ b/src/core/lib/iomgr/tcp_client.h @@ -25,6 +25,10 @@ #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/iomgr/resolve_address.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Asynchronously connect to an address (specified as (addr, len)), and call cb with arg and the completed connection when done (or call cb with arg and NULL on failure). @@ -37,4 +41,8 @@ void grpc_tcp_client_connect(grpc_exec_ctx *exec_ctx, grpc_closure *on_connect, const grpc_resolved_address *addr, gpr_timespec deadline); -#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/tcp_client_posix.h b/src/core/lib/iomgr/tcp_client_posix.h index b5a3814799..0b9775504c 100644 --- a/src/core/lib/iomgr/tcp_client_posix.h +++ b/src/core/lib/iomgr/tcp_client_posix.h @@ -23,8 +23,16 @@ #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/tcp_client.h" +#ifdef __cplusplus +extern "C" { +#endif + grpc_endpoint *grpc_tcp_client_create_from_fd( grpc_exec_ctx *exec_ctx, grpc_fd *fd, const grpc_channel_args *channel_args, const char *addr_str); -#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/tcp_posix.h b/src/core/lib/iomgr/tcp_posix.h index 6831a4a57f..dda78b2f8e 100644 --- a/src/core/lib/iomgr/tcp_posix.h +++ b/src/core/lib/iomgr/tcp_posix.h @@ -33,6 +33,10 @@ #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/ev_posix.h" +#ifdef __cplusplus +extern "C" { +#endif + extern grpc_tracer_flag grpc_tcp_trace; /* Create a tcp endpoint given a file desciptor and a read slice size. @@ -53,4 +57,8 @@ int grpc_tcp_fd(grpc_endpoint *ep); void grpc_tcp_destroy_and_release_fd(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, int *fd, grpc_closure *done); -#endif /* GRPC_CORE_LIB_IOMGR_TCP_POSIX_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_TCP_POSIX_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/tcp_server.h b/src/core/lib/iomgr/tcp_server.h index 8a126b6dee..3f190ac285 100644 --- a/src/core/lib/iomgr/tcp_server.h +++ b/src/core/lib/iomgr/tcp_server.h @@ -25,6 +25,10 @@ #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/resolve_address.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Forward decl of grpc_tcp_server */ typedef struct grpc_tcp_server grpc_tcp_server; @@ -98,4 +102,8 @@ void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s); void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s); -#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/tcp_server_utils_posix.h b/src/core/lib/iomgr/tcp_server_utils_posix.h index 85dea515d9..4bb0660f09 100644 --- a/src/core/lib/iomgr/tcp_server_utils_posix.h +++ b/src/core/lib/iomgr/tcp_server_utils_posix.h @@ -24,6 +24,10 @@ #include "src/core/lib/iomgr/socket_utils_posix.h" #include "src/core/lib/iomgr/tcp_server.h" +#ifdef __cplusplus +extern "C" { +#endif + /* one listening port */ typedef struct grpc_tcp_listener { int fd; @@ -117,4 +121,8 @@ grpc_error *grpc_tcp_server_prepare_socket(int fd, /* Ruturn true if the platform supports ifaddrs */ bool grpc_tcp_server_have_ifaddrs(void); -#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_UTILS_POSIX_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_UTILS_POSIX_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/tcp_uv.h b/src/core/lib/iomgr/tcp_uv.h index 0e67481d35..ba7db8a0f7 100644 --- a/src/core/lib/iomgr/tcp_uv.h +++ b/src/core/lib/iomgr/tcp_uv.h @@ -38,8 +38,16 @@ extern grpc_tracer_flag grpc_tcp_trace; #define GRPC_TCP_DEFAULT_READ_SLICE_SIZE 8192 +#ifdef __cplusplus +extern "C" { +#endif + grpc_endpoint *grpc_tcp_create(uv_tcp_t *handle, grpc_resource_quota *resource_quota, char *peer_string); -#endif /* GRPC_CORE_LIB_IOMGR_TCP_UV_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_TCP_UV_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/tcp_windows.h b/src/core/lib/iomgr/tcp_windows.h index 864184ce84..1c935da2a2 100644 --- a/src/core/lib/iomgr/tcp_windows.h +++ b/src/core/lib/iomgr/tcp_windows.h @@ -32,6 +32,10 @@ #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/socket_windows.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Create a tcp endpoint given a winsock handle. * Takes ownership of the handle. */ @@ -41,4 +45,8 @@ grpc_endpoint *grpc_tcp_create(grpc_exec_ctx *exec_ctx, grpc_winsocket *socket, grpc_error *grpc_tcp_prepare_socket(SOCKET sock); -#endif /* GRPC_CORE_LIB_IOMGR_TCP_WINDOWS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_TCP_WINDOWS_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/time_averaged_stats.h b/src/core/lib/iomgr/time_averaged_stats.h index 8745f7fa13..e255b58fee 100644 --- a/src/core/lib/iomgr/time_averaged_stats.h +++ b/src/core/lib/iomgr/time_averaged_stats.h @@ -19,6 +19,10 @@ #ifndef GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H #define GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H +#ifdef __cplusplus +extern "C" { +#endif + /* This tracks a time-decaying weighted average. It works by collecting batches of samples and then mixing their average into a time-decaying weighted mean. It is designed for batch operations where we do many adds @@ -70,4 +74,8 @@ void grpc_time_averaged_stats_add_sample(grpc_time_averaged_stats* stats, value. */ double grpc_time_averaged_stats_update_average(grpc_time_averaged_stats* stats); -#endif /* GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_TIME_AVERAGED_STATS_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/timer.h b/src/core/lib/iomgr/timer.h index ac392f87fe..466600d582 100644 --- a/src/core/lib/iomgr/timer.h +++ b/src/core/lib/iomgr/timer.h @@ -32,6 +32,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/iomgr.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_timer grpc_timer; /* Initialize *timer. When expired or canceled, closure will be called with @@ -103,4 +107,8 @@ void grpc_timer_consume_kick(void); void grpc_kick_poller(void); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_IOMGR_TIMER_H */ diff --git a/src/core/lib/iomgr/timer_heap.h b/src/core/lib/iomgr/timer_heap.h index 0d64199ab9..f15e8a3abb 100644 --- a/src/core/lib/iomgr/timer_heap.h +++ b/src/core/lib/iomgr/timer_heap.h @@ -21,6 +21,10 @@ #include "src/core/lib/iomgr/timer.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { grpc_timer **timers; uint32_t timer_count; @@ -39,4 +43,8 @@ void grpc_timer_heap_pop(grpc_timer_heap *heap); int grpc_timer_heap_is_empty(grpc_timer_heap *heap); -#endif /* GRPC_CORE_LIB_IOMGR_TIMER_HEAP_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_TIMER_HEAP_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/timer_manager.h b/src/core/lib/iomgr/timer_manager.h index 0ba502928a..d8a59a9477 100644 --- a/src/core/lib/iomgr/timer_manager.h +++ b/src/core/lib/iomgr/timer_manager.h @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* Timer Manager tries to keep one thread waiting for the next timeout at all times */ @@ -34,4 +38,8 @@ void grpc_timer_manager_set_threading(bool enabled); * disabled */ void grpc_timer_manager_tick(void); -#endif /* GRPC_CORE_LIB_IOMGR_TIMER_MANAGER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_TIMER_MANAGER_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/udp_server.h b/src/core/lib/iomgr/udp_server.h index 881468ea2c..bcd8572260 100644 --- a/src/core/lib/iomgr/udp_server.h +++ b/src/core/lib/iomgr/udp_server.h @@ -23,6 +23,10 @@ #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/resolve_address.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Forward decl of struct grpc_server */ /* This is not typedef'ed to avoid a typedef-redefinition error */ struct grpc_server; @@ -73,4 +77,8 @@ int grpc_udp_server_add_port(grpc_udp_server *s, void grpc_udp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_udp_server *server, grpc_closure *on_done); -#endif /* GRPC_CORE_LIB_IOMGR_UDP_SERVER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_UDP_SERVER_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/unix_sockets_posix.h b/src/core/lib/iomgr/unix_sockets_posix.h index 25b64b3eec..b96131ae1c 100644 --- a/src/core/lib/iomgr/unix_sockets_posix.h +++ b/src/core/lib/iomgr/unix_sockets_posix.h @@ -25,6 +25,10 @@ #include "src/core/lib/iomgr/resolve_address.h" +#ifdef __cplusplus +extern "C" { +#endif + void grpc_create_socketpair_if_unix(int sv[2]); grpc_error *grpc_resolve_unix_domain_address( @@ -38,4 +42,8 @@ void grpc_unlink_if_unix_domain_socket( char *grpc_sockaddr_to_uri_unix_if_possible( const grpc_resolved_address *resolved_addr); -#endif /* GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/wakeup_fd_cv.h b/src/core/lib/iomgr/wakeup_fd_cv.h index dc170ad5b4..34bc42fd7f 100644 --- a/src/core/lib/iomgr/wakeup_fd_cv.h +++ b/src/core/lib/iomgr/wakeup_fd_cv.h @@ -40,6 +40,10 @@ #define GRPC_FD_TO_IDX(fd) (-(fd)-1) #define GRPC_IDX_TO_FD(idx) (-(idx)-1) +#ifdef __cplusplus +extern "C" { +#endif + typedef struct cv_node { gpr_cv* cv; struct cv_node* next; @@ -62,4 +66,8 @@ typedef struct cv_fd_table { grpc_poll_function_type poll; } cv_fd_table; -#endif /* GRPC_CORE_LIB_IOMGR_WAKEUP_FD_CV_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_WAKEUP_FD_CV_H */ \ No newline at end of file diff --git a/src/core/lib/iomgr/wakeup_fd_posix.h b/src/core/lib/iomgr/wakeup_fd_posix.h index a9584d0d48..ae7849f98c 100644 --- a/src/core/lib/iomgr/wakeup_fd_posix.h +++ b/src/core/lib/iomgr/wakeup_fd_posix.h @@ -49,6 +49,10 @@ #include "src/core/lib/iomgr/error.h" +#ifdef __cplusplus +extern "C" { +#endif + void grpc_wakeup_fd_global_init(void); void grpc_wakeup_fd_global_destroy(void); @@ -91,4 +95,8 @@ void grpc_wakeup_fd_destroy(grpc_wakeup_fd* fd_info); * wakeup_fd_nospecial.c if no such implementation exists. */ extern const grpc_wakeup_fd_vtable grpc_specialized_wakeup_fd_vtable; +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_IOMGR_WAKEUP_FD_POSIX_H */ diff --git a/src/core/lib/json/json.h b/src/core/lib/json/json.h index bbd43025eb..81b7e0c9da 100644 --- a/src/core/lib/json/json.h +++ b/src/core/lib/json/json.h @@ -23,6 +23,10 @@ #include "src/core/lib/json/json_common.h" +#ifdef __cplusplus +extern "C" { +#endif + /* A tree-like structure to hold json values. The key and value pointers * are not owned by it. */ @@ -70,4 +74,8 @@ char* grpc_json_dump_to_string(grpc_json* json, int indent); grpc_json* grpc_json_create(grpc_json_type type); void grpc_json_destroy(grpc_json* json); -#endif /* GRPC_CORE_LIB_JSON_JSON_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_JSON_JSON_H */ \ No newline at end of file diff --git a/src/core/lib/json/json_reader.h b/src/core/lib/json/json_reader.h index 577fbbbaf6..ab2384f7a7 100644 --- a/src/core/lib/json/json_reader.h +++ b/src/core/lib/json/json_reader.h @@ -22,6 +22,10 @@ #include #include "src/core/lib/json/json_common.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { GRPC_JSON_STATE_OBJECT_KEY_BEGIN, GRPC_JSON_STATE_OBJECT_KEY_STRING, @@ -142,4 +146,8 @@ void grpc_json_reader_init(grpc_json_reader *reader, */ int grpc_json_reader_is_complete(grpc_json_reader *reader); -#endif /* GRPC_CORE_LIB_JSON_JSON_READER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_JSON_JSON_READER_H */ \ No newline at end of file diff --git a/src/core/lib/json/json_writer.h b/src/core/lib/json/json_writer.h index 8779039d42..18bd2a80fe 100644 --- a/src/core/lib/json/json_writer.h +++ b/src/core/lib/json/json_writer.h @@ -35,6 +35,10 @@ #include "src/core/lib/json/json_common.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_json_writer_vtable { /* Adds a character to the output stream. */ void (*output_char)(void *userdata, char); @@ -79,4 +83,8 @@ void grpc_json_writer_value_raw_with_len(grpc_json_writer *writer, void grpc_json_writer_value_string(grpc_json_writer *writer, const char *string); -#endif /* GRPC_CORE_LIB_JSON_JSON_WRITER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_JSON_JSON_WRITER_H */ \ No newline at end of file diff --git a/src/core/lib/profiling/basic_timers.c b/src/core/lib/profiling/basic_timers.c index c7645b74f2..ab9d60481c 100644 --- a/src/core/lib/profiling/basic_timers.c +++ b/src/core/lib/profiling/basic_timers.c @@ -18,10 +18,10 @@ #include -#ifdef GRPC_BASIC_PROFILER - #include "src/core/lib/profiling/timers.h" +#ifdef GRPC_BASIC_PROFILER + #include #include #include diff --git a/src/core/lib/security/credentials/composite/composite_credentials.h b/src/core/lib/security/credentials/composite/composite_credentials.h index 3076afcb7e..6e9f9a8f6f 100644 --- a/src/core/lib/security/credentials/composite/composite_credentials.h +++ b/src/core/lib/security/credentials/composite/composite_credentials.h @@ -21,6 +21,10 @@ #include "src/core/lib/security/credentials/credentials.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { grpc_call_credentials **creds_array; size_t num_creds; @@ -53,5 +57,9 @@ typedef struct { grpc_call_credentials_array inner; } grpc_composite_call_credentials; +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_COMPOSITE_COMPOSITE_CREDENTIALS_H \ */ diff --git a/src/core/lib/security/credentials/credentials.h b/src/core/lib/security/credentials/credentials.h index 04a54b0ca8..73e39ae039 100644 --- a/src/core/lib/security/credentials/credentials.h +++ b/src/core/lib/security/credentials/credentials.h @@ -29,6 +29,10 @@ #include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/security/transport/security_connector.h" +#ifdef __cplusplus +extern "C" { +#endif + struct grpc_http_response; /* --- Constants. --- */ @@ -252,4 +256,8 @@ grpc_credentials_metadata_request *grpc_credentials_metadata_request_create( void grpc_credentials_metadata_request_destroy( grpc_exec_ctx *exec_ctx, grpc_credentials_metadata_request *r); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_CREDENTIALS_H */ diff --git a/src/core/lib/security/credentials/fake/fake_credentials.h b/src/core/lib/security/credentials/fake/fake_credentials.h index aa0f3b6e20..64f6f439f0 100644 --- a/src/core/lib/security/credentials/fake/fake_credentials.h +++ b/src/core/lib/security/credentials/fake/fake_credentials.h @@ -21,6 +21,10 @@ #include "src/core/lib/security/credentials/credentials.h" +#ifdef __cplusplus +extern "C" { +#endif + /* -- Fake transport security credentials. -- */ /* Creates a fake transport security credentials object for testing. */ @@ -56,4 +60,8 @@ typedef struct { bool is_async; } grpc_md_only_test_credentials; -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H */ \ No newline at end of file diff --git a/src/core/lib/security/credentials/jwt/json_token.h b/src/core/lib/security/credentials/jwt/json_token.h index e50790ef2e..486fd981af 100644 --- a/src/core/lib/security/credentials/jwt/json_token.h +++ b/src/core/lib/security/credentials/jwt/json_token.h @@ -28,6 +28,10 @@ #define GRPC_JWT_OAUTH2_AUDIENCE "https://www.googleapis.com/oauth2/v3/token" +#ifdef __cplusplus +extern "C" { +#endif + /* --- auth_json_key parsing. --- */ typedef struct { @@ -70,4 +74,8 @@ typedef char *(*grpc_jwt_encode_and_sign_override)( void grpc_jwt_encode_and_sign_set_override( grpc_jwt_encode_and_sign_override func); -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JSON_TOKEN_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JSON_TOKEN_H */ \ No newline at end of file diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.h b/src/core/lib/security/credentials/jwt/jwt_credentials.h index 07f4022669..c09485fd55 100644 --- a/src/core/lib/security/credentials/jwt/jwt_credentials.h +++ b/src/core/lib/security/credentials/jwt/jwt_credentials.h @@ -22,6 +22,10 @@ #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/credentials/jwt/json_token.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { grpc_call_credentials base; @@ -45,4 +49,8 @@ grpc_service_account_jwt_access_credentials_create_from_auth_json_key( grpc_exec_ctx *exec_ctx, grpc_auth_json_key key, gpr_timespec token_lifetime); -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H */ \ No newline at end of file diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.h b/src/core/lib/security/credentials/jwt/jwt_verifier.h index 8fac452d4e..0603811627 100644 --- a/src/core/lib/security/credentials/jwt/jwt_verifier.h +++ b/src/core/lib/security/credentials/jwt/jwt_verifier.h @@ -32,6 +32,10 @@ #define GRPC_GOOGLE_SERVICE_ACCOUNTS_KEY_URL_PREFIX \ "www.googleapis.com/robot/v1/metadata/x509" +#ifdef __cplusplus +extern "C" { +#endif + /* --- grpc_jwt_verifier_status. --- */ typedef enum { @@ -122,4 +126,8 @@ grpc_jwt_verifier_status grpc_jwt_claims_check(const grpc_jwt_claims *claims, const char *audience); const char *grpc_jwt_issuer_email_domain(const char *issuer); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_VERIFIER_H */ diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h index d9ad6691b8..c8a9333417 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h @@ -22,6 +22,10 @@ #include "src/core/lib/json/json.h" #include "src/core/lib/security/credentials/credentials.h" +#ifdef __cplusplus +extern "C" { +#endif + // auth_refresh_token parsing. typedef struct { const char *type; @@ -102,4 +106,8 @@ grpc_oauth2_token_fetcher_credentials_parse_server_response( grpc_exec_ctx *exec_ctx, const struct grpc_http_response *response, grpc_mdelem *token_md, gpr_timespec *token_lifetime); -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_OAUTH2_OAUTH2_CREDENTIALS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_OAUTH2_OAUTH2_CREDENTIALS_H */ \ No newline at end of file diff --git a/src/core/lib/security/transport/lb_targets_info.h b/src/core/lib/security/transport/lb_targets_info.h index c3d685df5f..705d33b0ab 100644 --- a/src/core/lib/security/transport/lb_targets_info.h +++ b/src/core/lib/security/transport/lb_targets_info.h @@ -21,6 +21,10 @@ #include "src/core/lib/slice/slice_hash_table.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Return a channel argument containing \a targets_info. */ grpc_arg grpc_lb_targets_info_create_channel_arg( grpc_slice_hash_table *targets_info); @@ -29,4 +33,8 @@ grpc_arg grpc_lb_targets_info_create_channel_arg( grpc_slice_hash_table *grpc_lb_targets_info_find_in_args( const grpc_channel_args *args); -#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_LB_TARGETS_INFO_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_LB_TARGETS_INFO_H */ \ No newline at end of file diff --git a/src/core/lib/security/transport/secure_endpoint.h b/src/core/lib/security/transport/secure_endpoint.h index 3323a6ff42..832cc1c0ce 100644 --- a/src/core/lib/security/transport/secure_endpoint.h +++ b/src/core/lib/security/transport/secure_endpoint.h @@ -22,6 +22,10 @@ #include #include "src/core/lib/iomgr/endpoint.h" +#ifdef __cplusplus +extern "C" { +#endif + struct tsi_frame_protector; struct tsi_zero_copy_grpc_protector; @@ -36,4 +40,8 @@ grpc_endpoint *grpc_secure_endpoint_create( grpc_endpoint *to_wrap, grpc_slice *leftover_slices, size_t leftover_nslices); -#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H */ \ No newline at end of file diff --git a/src/core/lib/security/transport/security_connector.h b/src/core/lib/security/transport/security_connector.h index 4f9b63ad20..4d87cd0c80 100644 --- a/src/core/lib/security/transport/security_connector.h +++ b/src/core/lib/security/transport/security_connector.h @@ -29,6 +29,10 @@ #include "src/core/tsi/ssl_transport_security.h" #include "src/core/tsi/transport_security_interface.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifndef NDEBUG extern grpc_tracer_flag grpc_trace_security_connector_refcount; #endif @@ -245,4 +249,8 @@ tsi_peer tsi_shallow_peer_from_ssl_auth_context( const grpc_auth_context *auth_context); void tsi_shallow_peer_destruct(tsi_peer *peer); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_CONNECTOR_H */ diff --git a/src/core/lib/security/transport/security_handshaker.h b/src/core/lib/security/transport/security_handshaker.h index 95bf127fc6..345065f26c 100644 --- a/src/core/lib/security/transport/security_handshaker.h +++ b/src/core/lib/security/transport/security_handshaker.h @@ -23,6 +23,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/security/transport/security_connector.h" +#ifdef __cplusplus +extern "C" { +#endif + /// Creates a security handshaker using \a handshaker. grpc_handshaker *grpc_security_handshaker_create( grpc_exec_ctx *exec_ctx, tsi_handshaker *handshaker, @@ -31,4 +35,8 @@ grpc_handshaker *grpc_security_handshaker_create( /// Registers security handshaker factories. void grpc_security_register_handshaker_factories(); -#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H */ \ No newline at end of file diff --git a/src/core/lib/security/transport/tsi_error.h b/src/core/lib/security/transport/tsi_error.h index 87a63a8a7c..4c78b06603 100644 --- a/src/core/lib/security/transport/tsi_error.h +++ b/src/core/lib/security/transport/tsi_error.h @@ -22,6 +22,14 @@ #include "src/core/lib/iomgr/error.h" #include "src/core/tsi/transport_security_interface.h" +#ifdef __cplusplus +extern "C" { +#endif + grpc_error *grpc_set_tsi_error_result(grpc_error *error, tsi_result result); -#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H */ \ No newline at end of file diff --git a/src/core/lib/security/util/json_util.h b/src/core/lib/security/util/json_util.h index 5ea831e27e..43a2f6b9d1 100644 --- a/src/core/lib/security/util/json_util.h +++ b/src/core/lib/security/util/json_util.h @@ -28,6 +28,10 @@ #define GRPC_AUTH_JSON_TYPE_SERVICE_ACCOUNT "service_account" #define GRPC_AUTH_JSON_TYPE_AUTHORIZED_USER "authorized_user" +#ifdef __cplusplus +extern "C" { +#endif + // Gets a child property from a json node. const char *grpc_json_get_string_property(const grpc_json *json, const char *prop_name); @@ -37,4 +41,8 @@ const char *grpc_json_get_string_property(const grpc_json *json, bool grpc_copy_json_string_property(const grpc_json *json, const char *prop_name, char **copied_value); -#endif /* GRPC_CORE_LIB_SECURITY_UTIL_JSON_UTIL_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SECURITY_UTIL_JSON_UTIL_H */ \ No newline at end of file diff --git a/src/core/lib/slice/b64.h b/src/core/lib/slice/b64.h index 3fd15febe5..c01da56575 100644 --- a/src/core/lib/slice/b64.h +++ b/src/core/lib/slice/b64.h @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* Encodes data using base64. It is the caller's responsability to free the returned char * using gpr_free. Returns NULL on NULL input. TODO(makdharma) : change the flags to bool from int */ @@ -47,4 +51,8 @@ grpc_slice grpc_base64_decode(grpc_exec_ctx *exec_ctx, const char *b64, grpc_slice grpc_base64_decode_with_len(grpc_exec_ctx *exec_ctx, const char *b64, size_t b64_len, int url_safe); -#endif /* GRPC_CORE_LIB_SLICE_B64_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SLICE_B64_H */ \ No newline at end of file diff --git a/src/core/lib/slice/percent_encoding.h b/src/core/lib/slice/percent_encoding.h index faae26a683..e6f85120c3 100644 --- a/src/core/lib/slice/percent_encoding.h +++ b/src/core/lib/slice/percent_encoding.h @@ -30,6 +30,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* URL percent encoding spec bitfield (usabel as 'unreserved_bytes' in grpc_percent_encode_slice, grpc_strict_percent_decode_slice). Flags [A-Za-z0-9-_.~] as unreserved bytes for the percent encoding routines @@ -60,4 +64,8 @@ bool grpc_strict_percent_decode_slice(grpc_slice slice_in, This cannot fail. */ grpc_slice grpc_permissive_percent_decode_slice(grpc_slice slice_in); -#endif /* GRPC_CORE_LIB_SLICE_PERCENT_ENCODING_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SLICE_PERCENT_ENCODING_H */ \ No newline at end of file diff --git a/src/core/lib/slice/slice_hash_table.h b/src/core/lib/slice/slice_hash_table.h index 339078fef5..3c3f0e61f3 100644 --- a/src/core/lib/slice/slice_hash_table.h +++ b/src/core/lib/slice/slice_hash_table.h @@ -19,6 +19,10 @@ #include "src/core/lib/transport/metadata.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Hash table implementation. * * This implementation uses open addressing @@ -67,4 +71,8 @@ void *grpc_slice_hash_table_get(const grpc_slice_hash_table *table, int grpc_slice_hash_table_cmp(const grpc_slice_hash_table *a, const grpc_slice_hash_table *b); -#endif /* GRPC_CORE_LIB_SLICE_SLICE_HASH_TABLE_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SLICE_SLICE_HASH_TABLE_H */ \ No newline at end of file diff --git a/src/core/lib/slice/slice_internal.h b/src/core/lib/slice/slice_internal.h index 6df0b4b50b..8591185c53 100644 --- a/src/core/lib/slice/slice_internal.h +++ b/src/core/lib/slice/slice_internal.h @@ -24,6 +24,10 @@ #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + grpc_slice grpc_slice_ref_internal(grpc_slice slice); void grpc_slice_unref_internal(grpc_exec_ctx *exec_ctx, grpc_slice slice); void grpc_slice_buffer_reset_and_unref_internal(grpc_exec_ctx *exec_ctx, @@ -46,4 +50,8 @@ grpc_slice grpc_slice_maybe_static_intern(grpc_slice slice, uint32_t grpc_static_slice_hash(grpc_slice s); int grpc_static_slice_eq(grpc_slice a, grpc_slice b); -#endif /* GRPC_CORE_LIB_SLICE_SLICE_INTERNAL_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SLICE_SLICE_INTERNAL_H */ \ No newline at end of file diff --git a/src/core/lib/slice/slice_traits.h b/src/core/lib/slice/slice_traits.h index 4b898bdcd4..1eda17cf00 100644 --- a/src/core/lib/slice/slice_traits.h +++ b/src/core/lib/slice/slice_traits.h @@ -22,8 +22,16 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + bool grpc_slice_is_legal_header(grpc_slice s); bool grpc_slice_is_legal_nonbin_header(grpc_slice s); bool grpc_slice_is_bin_suffixed(grpc_slice s); -#endif /* GRPC_CORE_LIB_SLICE_SLICE_TRAITS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SLICE_SLICE_TRAITS_H */ \ No newline at end of file diff --git a/src/core/lib/support/time_precise.c b/src/core/lib/support/time_precise.c index 6ce19e53cc..05ef7c59bc 100644 --- a/src/core/lib/support/time_precise.c +++ b/src/core/lib/support/time_precise.c @@ -20,6 +20,8 @@ #include #include +#include "src/core/lib/support/time_precise.h" + #ifdef GRPC_TIMERS_RDTSC #if defined(__i386__) static void gpr_get_cycle_counter(int64_t int *clk) { diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h index 528bb868e2..427422b565 100644 --- a/src/core/lib/surface/channel.h +++ b/src/core/lib/surface/channel.h @@ -23,6 +23,10 @@ #include "src/core/lib/channel/channel_stack_builder.h" #include "src/core/lib/surface/channel_stack_type.h" +#ifdef __cplusplus +extern "C" { +#endif + grpc_channel *grpc_channel_create(grpc_exec_ctx *exec_ctx, const char *target, const grpc_channel_args *args, grpc_channel_stack_type channel_stack_type, @@ -81,4 +85,8 @@ void grpc_channel_internal_unref(grpc_exec_ctx *exec_ctx, grpc_compression_options grpc_channel_compression_options( const grpc_channel *channel); +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_H */ diff --git a/src/core/lib/surface/channel_stack_type.h b/src/core/lib/surface/channel_stack_type.h index 3f0e14ffc0..903b90a071 100644 --- a/src/core/lib/surface/channel_stack_type.h +++ b/src/core/lib/surface/channel_stack_type.h @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { // normal top-half client channel with load-balancing, connection management GRPC_CLIENT_CHANNEL, @@ -42,4 +46,8 @@ bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type); const char *grpc_channel_stack_type_string(grpc_channel_stack_type type); -#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_STACK_TYPE_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_STACK_TYPE_H */ \ No newline at end of file diff --git a/src/core/lib/surface/completion_queue_factory.h b/src/core/lib/surface/completion_queue_factory.h index 89be8f8216..cb0af6f0fb 100644 --- a/src/core/lib/surface/completion_queue_factory.h +++ b/src/core/lib/surface/completion_queue_factory.h @@ -22,6 +22,10 @@ #include #include "src/core/lib/surface/completion_queue.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_completion_queue_factory_vtable { grpc_completion_queue* (*create)(const grpc_completion_queue_factory*, const grpc_completion_queue_attributes*); @@ -33,4 +37,8 @@ struct grpc_completion_queue_factory { grpc_completion_queue_factory_vtable* vtable; }; -#endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_FACTORY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_FACTORY_H */ \ No newline at end of file diff --git a/src/core/lib/surface/event_string.h b/src/core/lib/surface/event_string.h index f00efca7f3..127609c404 100644 --- a/src/core/lib/surface/event_string.h +++ b/src/core/lib/surface/event_string.h @@ -21,7 +21,15 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /* Returns a string describing an event. Must be later freed with gpr_free() */ char *grpc_event_string(grpc_event *ev); -#endif /* GRPC_CORE_LIB_SURFACE_EVENT_STRING_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SURFACE_EVENT_STRING_H */ \ No newline at end of file diff --git a/src/core/lib/surface/init.h b/src/core/lib/surface/init.h index 9353208332..b2f48576e5 100644 --- a/src/core/lib/surface/init.h +++ b/src/core/lib/surface/init.h @@ -19,9 +19,17 @@ #ifndef GRPC_CORE_LIB_SURFACE_INIT_H #define GRPC_CORE_LIB_SURFACE_INIT_H +#ifdef __cplusplus +extern "C" { +#endif + void grpc_register_security_filters(void); void grpc_security_pre_init(void); void grpc_security_init(void); int grpc_is_initialized(void); -#endif /* GRPC_CORE_LIB_SURFACE_INIT_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SURFACE_INIT_H */ \ No newline at end of file diff --git a/src/core/lib/surface/server.h b/src/core/lib/surface/server.h index dd5639d97a..1114715833 100644 --- a/src/core/lib/surface/server.h +++ b/src/core/lib/surface/server.h @@ -24,6 +24,10 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/transport/transport.h" +#ifdef __cplusplus +extern "C" { +#endif + extern const grpc_channel_filter grpc_server_top_filter; /** Lightweight tracing of server channel state */ @@ -54,4 +58,8 @@ int grpc_server_has_open_connections(grpc_server *server); void grpc_server_get_pollsets(grpc_server *server, grpc_pollset ***pollsets, size_t *pollset_count); -#endif /* GRPC_CORE_LIB_SURFACE_SERVER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SURFACE_SERVER_H */ \ No newline at end of file diff --git a/src/core/lib/surface/validate_metadata.h b/src/core/lib/surface/validate_metadata.h index de869d89b4..aa02419d9f 100644 --- a/src/core/lib/surface/validate_metadata.h +++ b/src/core/lib/surface/validate_metadata.h @@ -22,7 +22,15 @@ #include #include "src/core/lib/iomgr/error.h" +#ifdef __cplusplus +extern "C" { +#endif + grpc_error *grpc_validate_header_key_is_legal(grpc_slice slice); grpc_error *grpc_validate_header_nonbin_value_is_legal(grpc_slice slice); -#endif /* GRPC_CORE_LIB_SURFACE_VALIDATE_METADATA_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_SURFACE_VALIDATE_METADATA_H */ \ No newline at end of file diff --git a/src/core/lib/transport/bdp_estimator.h b/src/core/lib/transport/bdp_estimator.h index 1ef0dc99dd..21c27ec6af 100644 --- a/src/core/lib/transport/bdp_estimator.h +++ b/src/core/lib/transport/bdp_estimator.h @@ -27,6 +27,10 @@ #define GRPC_BDP_SAMPLES 16 #define GRPC_BDP_MIN_SAMPLES_FOR_ESTIMATE 3 +#ifdef __cplusplus +extern "C" { +#endif + extern grpc_tracer_flag grpc_bdp_estimator_trace; typedef enum { @@ -66,4 +70,8 @@ void grpc_bdp_estimator_start_ping(grpc_bdp_estimator *estimator); // Completes a previously started ping void grpc_bdp_estimator_complete_ping(grpc_bdp_estimator *estimator); -#endif /* GRPC_CORE_LIB_TRANSPORT_BDP_ESTIMATOR_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_TRANSPORT_BDP_ESTIMATOR_H */ \ No newline at end of file diff --git a/src/core/lib/transport/byte_stream.h b/src/core/lib/transport/byte_stream.h index be2a35213e..d3e04df5c0 100644 --- a/src/core/lib/transport/byte_stream.h +++ b/src/core/lib/transport/byte_stream.h @@ -28,6 +28,10 @@ /** Mask of all valid internal flags. */ #define GRPC_WRITE_INTERNAL_USED_MASK (GRPC_WRITE_INTERNAL_COMPRESS) +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_byte_stream grpc_byte_stream; typedef struct { @@ -135,4 +139,8 @@ void grpc_caching_byte_stream_init(grpc_caching_byte_stream *stream, // Resets the byte stream to the start of the underlying stream. void grpc_caching_byte_stream_reset(grpc_caching_byte_stream *stream); -#endif /* GRPC_CORE_LIB_TRANSPORT_BYTE_STREAM_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_TRANSPORT_BYTE_STREAM_H */ \ No newline at end of file diff --git a/src/core/lib/transport/connectivity_state.h b/src/core/lib/transport/connectivity_state.h index 2fece6cc21..1796a540a7 100644 --- a/src/core/lib/transport/connectivity_state.h +++ b/src/core/lib/transport/connectivity_state.h @@ -23,6 +23,10 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/iomgr/exec_ctx.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_connectivity_state_watcher { /** we keep watchers in a linked list */ struct grpc_connectivity_state_watcher *next; @@ -84,4 +88,8 @@ bool grpc_connectivity_state_notify_on_state_change( grpc_exec_ctx *exec_ctx, grpc_connectivity_state_tracker *tracker, grpc_connectivity_state *current, grpc_closure *notify); -#endif /* GRPC_CORE_LIB_TRANSPORT_CONNECTIVITY_STATE_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_TRANSPORT_CONNECTIVITY_STATE_H */ \ No newline at end of file diff --git a/src/core/lib/transport/error_utils.h b/src/core/lib/transport/error_utils.h index e530884215..18ff54839c 100644 --- a/src/core/lib/transport/error_utils.h +++ b/src/core/lib/transport/error_utils.h @@ -22,6 +22,10 @@ #include "src/core/lib/iomgr/error.h" #include "src/core/lib/transport/http2_errors.h" +#ifdef __cplusplus +extern "C" { +#endif + /// A utility function to get the status code and message to be returned /// to the application. If not set in the top-level message, looks /// through child errors until it finds the first one with these attributes. @@ -38,4 +42,8 @@ void grpc_error_get_status(grpc_error *error, gpr_timespec deadline, /// GRPC_ERROR_CANCELLED bool grpc_error_has_clear_grpc_status(grpc_error *error); -#endif /* GRPC_CORE_LIB_TRANSPORT_ERROR_UTILS_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_TRANSPORT_ERROR_UTILS_H */ \ No newline at end of file diff --git a/src/core/lib/transport/pid_controller.h b/src/core/lib/transport/pid_controller.h index 9352b2643f..17feabfd39 100644 --- a/src/core/lib/transport/pid_controller.h +++ b/src/core/lib/transport/pid_controller.h @@ -19,6 +19,10 @@ #ifndef GRPC_CORE_LIB_TRANSPORT_PID_CONTROLLER_H #define GRPC_CORE_LIB_TRANSPORT_PID_CONTROLLER_H +#ifdef __cplusplus +extern "C" { +#endif + /* \file Simple PID controller. Implements a proportional-integral-derivative controller. Used when we want to iteratively control a variable to converge some other @@ -59,4 +63,8 @@ double grpc_pid_controller_update(grpc_pid_controller *pid_controller, /** Returns the last control value calculated */ double grpc_pid_controller_last(grpc_pid_controller *pid_controller); -#endif /* GRPC_CORE_LIB_TRANSPORT_PID_CONTROLLER_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_TRANSPORT_PID_CONTROLLER_H */ \ No newline at end of file diff --git a/src/core/lib/transport/service_config.h b/src/core/lib/transport/service_config.h index 84110abc36..c485f52472 100644 --- a/src/core/lib/transport/service_config.h +++ b/src/core/lib/transport/service_config.h @@ -22,6 +22,10 @@ #include "src/core/lib/json/json.h" #include "src/core/lib/slice/slice_hash_table.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_service_config grpc_service_config; grpc_service_config* grpc_service_config_create(const char* json_string); @@ -59,4 +63,8 @@ void* grpc_method_config_table_get(grpc_exec_ctx* exec_ctx, const grpc_slice_hash_table* table, grpc_slice path); -#endif /* GRPC_CORE_LIB_TRANSPORT_SERVICE_CONFIG_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_TRANSPORT_SERVICE_CONFIG_H */ \ No newline at end of file diff --git a/src/core/lib/transport/status_conversion.h b/src/core/lib/transport/status_conversion.h index e93f3dfd9b..b257998e4d 100644 --- a/src/core/lib/transport/status_conversion.h +++ b/src/core/lib/transport/status_conversion.h @@ -22,6 +22,10 @@ #include #include "src/core/lib/transport/http2_errors.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Conversion of grpc status codes to http2 error codes (for RST_STREAM) */ grpc_http2_error_code grpc_status_to_http2_error(grpc_status_code status); grpc_status_code grpc_http2_error_to_grpc_status(grpc_http2_error_code error, @@ -31,4 +35,8 @@ grpc_status_code grpc_http2_error_to_grpc_status(grpc_http2_error_code error, grpc_status_code grpc_http2_status_to_grpc_status(int status); int grpc_status_to_http2_status(grpc_status_code status); -#endif /* GRPC_CORE_LIB_TRANSPORT_STATUS_CONVERSION_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_TRANSPORT_STATUS_CONVERSION_H */ \ No newline at end of file diff --git a/src/core/lib/transport/timeout_encoding.h b/src/core/lib/transport/timeout_encoding.h index 7ff35c4083..1f4e206f8a 100644 --- a/src/core/lib/transport/timeout_encoding.h +++ b/src/core/lib/transport/timeout_encoding.h @@ -26,9 +26,17 @@ #define GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE (GPR_LTOA_MIN_BUFSIZE + 1) +#ifdef __cplusplus +extern "C" { +#endif + /* Encode/decode timeouts to the GRPC over HTTP/2 format; encoding may round up arbitrarily */ void grpc_http2_encode_timeout(gpr_timespec timeout, char *buffer); int grpc_http2_decode_timeout(grpc_slice text, gpr_timespec *timeout); -#endif /* GRPC_CORE_LIB_TRANSPORT_TIMEOUT_ENCODING_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_TRANSPORT_TIMEOUT_ENCODING_H */ \ No newline at end of file diff --git a/src/core/lib/transport/transport_impl.h b/src/core/lib/transport/transport_impl.h index bbae69c223..41d34d3954 100644 --- a/src/core/lib/transport/transport_impl.h +++ b/src/core/lib/transport/transport_impl.h @@ -21,6 +21,10 @@ #include "src/core/lib/transport/transport.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct grpc_transport_vtable { /* Memory required for a single stream element - this is allocated by upper layers and initialized by the transport */ @@ -69,4 +73,8 @@ struct grpc_transport { const grpc_transport_vtable *vtable; }; -#endif /* GRPC_CORE_LIB_TRANSPORT_TRANSPORT_IMPL_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_LIB_TRANSPORT_TRANSPORT_IMPL_H */ \ No newline at end of file diff --git a/src/core/tsi/gts_transport_security.h b/src/core/tsi/gts_transport_security.h index 538e1030bc..b988c3f861 100644 --- a/src/core/tsi/gts_transport_security.h +++ b/src/core/tsi/gts_transport_security.h @@ -23,6 +23,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct gts_shared_resource { gpr_thd_id thread_id; grpc_channel *channel; @@ -34,4 +38,8 @@ typedef struct gts_shared_resource { * TSI handshakes. */ gts_shared_resource *gts_get_shared_resource(void); -#endif /* GRPC_CORE_TSI_GTS_TRANSPORT_SECURITY_H */ +#ifdef __cplusplus +} +#endif + +#endif /* GRPC_CORE_TSI_GTS_TRANSPORT_SECURITY_H */ \ No newline at end of file -- cgit v1.2.3