aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/slice
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-09-20 18:56:37 -0700
committerGravatar Yash Tibrewal <yashkt@google.com>2017-10-02 16:23:34 -0700
commita7e6d65a4864422854117149a6e98ff80e492fa9 (patch)
treef45e79512522e1584a1f4d6f2ed25755fc97eb97 /src/core/lib/slice
parentac0c2d9036814b56a3f8d99d6f8cbafeed671eca (diff)
Changes for C to C++. Adding extern C to header files for compatibility.
Diffstat (limited to 'src/core/lib/slice')
-rw-r--r--src/core/lib/slice/b64.h10
-rw-r--r--src/core/lib/slice/percent_encoding.h10
-rw-r--r--src/core/lib/slice/slice_hash_table.h10
-rw-r--r--src/core/lib/slice/slice_internal.h10
-rw-r--r--src/core/lib/slice/slice_traits.h10
5 files changed, 45 insertions, 5 deletions
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 <grpc/slice.h>
+#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 <grpc/slice.h>
+#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 <grpc/slice.h>
#include <stdbool.h>
+#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