aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'src/ruby')
-rw-r--r--src/ruby/ext/grpc/rb_compression_options.c17
-rw-r--r--src/ruby/ext/grpc/rb_grpc_imports.generated.c14
-rw-r--r--src/ruby/ext/grpc/rb_grpc_imports.generated.h22
3 files changed, 30 insertions, 23 deletions
diff --git a/src/ruby/ext/grpc/rb_compression_options.c b/src/ruby/ext/grpc/rb_compression_options.c
index 3365b1784d..683f84c69e 100644
--- a/src/ruby/ext/grpc/rb_compression_options.c
+++ b/src/ruby/ext/grpc/rb_compression_options.c
@@ -23,6 +23,7 @@
#include "rb_grpc_imports.generated.h"
#include <grpc/compression.h>
+#include <grpc/compression_ruby.h>
#include <grpc/grpc.h>
#include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/grpc_types.h>
@@ -127,11 +128,11 @@ grpc_compression_level grpc_rb_compression_options_level_name_to_value_internal(
if (id_compress_level_none == SYM2ID(level_name)) {
return GRPC_COMPRESS_LEVEL_NONE;
} else if (id_compress_level_low == SYM2ID(level_name)) {
- return GRPC_COMPRESS_LEVEL_LOW;
+ return GRPC_COMPRESS_LEVEL_MESSAGE_LOW;
} else if (id_compress_level_medium == SYM2ID(level_name)) {
- return GRPC_COMPRESS_LEVEL_MED;
+ return GRPC_COMPRESS_LEVEL_MESSAGE_MED;
} else if (id_compress_level_high == SYM2ID(level_name)) {
- return GRPC_COMPRESS_LEVEL_HIGH;
+ return GRPC_COMPRESS_LEVEL_MESSAGE_HIGH;
}
rb_raise(rb_eArgError,
@@ -174,7 +175,7 @@ void grpc_rb_compression_options_algorithm_name_to_value_internal(
/* Raise an error if the name isn't recognized as a compression algorithm by
* the algorithm parse function
* in GRPC core. */
- if (!grpc_compression_algorithm_parse(name_slice, algorithm_value)) {
+ if (!grpc_compression_algorithm_parse_ruby(name_slice, algorithm_value)) {
tmp_str = grpc_slice_to_c_string(name_slice);
rb_raise(rb_eNameError, "Invalid compression algorithm name: %s", tmp_str);
}
@@ -264,11 +265,11 @@ VALUE grpc_rb_compression_options_level_value_to_name_internal(
switch (compression_value) {
case GRPC_COMPRESS_LEVEL_NONE:
return ID2SYM(id_compress_level_none);
- case GRPC_COMPRESS_LEVEL_LOW:
+ case GRPC_COMPRESS_LEVEL_MESSAGE_LOW:
return ID2SYM(id_compress_level_low);
- case GRPC_COMPRESS_LEVEL_MED:
+ case GRPC_COMPRESS_LEVEL_MESSAGE_MED:
return ID2SYM(id_compress_level_medium);
- case GRPC_COMPRESS_LEVEL_HIGH:
+ case GRPC_COMPRESS_LEVEL_MESSAGE_HIGH:
return ID2SYM(id_compress_level_high);
default:
rb_raise(
@@ -286,7 +287,7 @@ VALUE grpc_rb_compression_options_algorithm_value_to_name_internal(
grpc_compression_algorithm internal_value) {
char *algorithm_name = NULL;
- if (!grpc_compression_algorithm_name(internal_value, &algorithm_name)) {
+ if (!grpc_compression_algorithm_name_ruby(internal_value, &algorithm_name)) {
rb_raise(rb_eArgError, "Failed to convert algorithm value to name");
}
diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c
index 648d515003..6af5021d19 100644
--- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c
+++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c
@@ -22,16 +22,17 @@
#include "rb_grpc_imports.generated.h"
+grpc_compression_algorithm_is_message_type grpc_compression_algorithm_is_message_import;
+grpc_compression_algorithm_is_stream_type grpc_compression_algorithm_is_stream_import;
grpc_compression_algorithm_parse_type grpc_compression_algorithm_parse_import;
grpc_compression_algorithm_name_type grpc_compression_algorithm_name_import;
-grpc_stream_compression_algorithm_name_type grpc_stream_compression_algorithm_name_import;
grpc_compression_algorithm_for_level_type grpc_compression_algorithm_for_level_import;
-grpc_stream_compression_algorithm_for_level_type grpc_stream_compression_algorithm_for_level_import;
grpc_compression_options_init_type grpc_compression_options_init_import;
grpc_compression_options_enable_algorithm_type grpc_compression_options_enable_algorithm_import;
grpc_compression_options_disable_algorithm_type grpc_compression_options_disable_algorithm_import;
grpc_compression_options_is_algorithm_enabled_type grpc_compression_options_is_algorithm_enabled_import;
-grpc_compression_options_is_stream_compression_algorithm_enabled_type grpc_compression_options_is_stream_compression_algorithm_enabled_import;
+grpc_compression_algorithm_parse_ruby_type grpc_compression_algorithm_parse_ruby_import;
+grpc_compression_algorithm_name_ruby_type grpc_compression_algorithm_name_ruby_import;
grpc_metadata_array_init_type grpc_metadata_array_init_import;
grpc_metadata_array_destroy_type grpc_metadata_array_destroy_import;
grpc_call_details_init_type grpc_call_details_init_import;
@@ -309,16 +310,17 @@ gpr_sleep_until_type gpr_sleep_until_import;
gpr_timespec_to_micros_type gpr_timespec_to_micros_import;
void grpc_rb_load_imports(HMODULE library) {
+ grpc_compression_algorithm_is_message_import = (grpc_compression_algorithm_is_message_type) GetProcAddress(library, "grpc_compression_algorithm_is_message");
+ grpc_compression_algorithm_is_stream_import = (grpc_compression_algorithm_is_stream_type) GetProcAddress(library, "grpc_compression_algorithm_is_stream");
grpc_compression_algorithm_parse_import = (grpc_compression_algorithm_parse_type) GetProcAddress(library, "grpc_compression_algorithm_parse");
grpc_compression_algorithm_name_import = (grpc_compression_algorithm_name_type) GetProcAddress(library, "grpc_compression_algorithm_name");
- grpc_stream_compression_algorithm_name_import = (grpc_stream_compression_algorithm_name_type) GetProcAddress(library, "grpc_stream_compression_algorithm_name");
grpc_compression_algorithm_for_level_import = (grpc_compression_algorithm_for_level_type) GetProcAddress(library, "grpc_compression_algorithm_for_level");
- grpc_stream_compression_algorithm_for_level_import = (grpc_stream_compression_algorithm_for_level_type) GetProcAddress(library, "grpc_stream_compression_algorithm_for_level");
grpc_compression_options_init_import = (grpc_compression_options_init_type) GetProcAddress(library, "grpc_compression_options_init");
grpc_compression_options_enable_algorithm_import = (grpc_compression_options_enable_algorithm_type) GetProcAddress(library, "grpc_compression_options_enable_algorithm");
grpc_compression_options_disable_algorithm_import = (grpc_compression_options_disable_algorithm_type) GetProcAddress(library, "grpc_compression_options_disable_algorithm");
grpc_compression_options_is_algorithm_enabled_import = (grpc_compression_options_is_algorithm_enabled_type) GetProcAddress(library, "grpc_compression_options_is_algorithm_enabled");
- grpc_compression_options_is_stream_compression_algorithm_enabled_import = (grpc_compression_options_is_stream_compression_algorithm_enabled_type) GetProcAddress(library, "grpc_compression_options_is_stream_compression_algorithm_enabled");
+ grpc_compression_algorithm_parse_ruby_import = (grpc_compression_algorithm_parse_ruby_type) GetProcAddress(library, "grpc_compression_algorithm_parse_ruby");
+ grpc_compression_algorithm_name_ruby_import = (grpc_compression_algorithm_name_ruby_type) GetProcAddress(library, "grpc_compression_algorithm_name_ruby");
grpc_metadata_array_init_import = (grpc_metadata_array_init_type) GetProcAddress(library, "grpc_metadata_array_init");
grpc_metadata_array_destroy_import = (grpc_metadata_array_destroy_type) GetProcAddress(library, "grpc_metadata_array_destroy");
grpc_call_details_init_import = (grpc_call_details_init_type) GetProcAddress(library, "grpc_call_details_init");
diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h
index 4f2383e982..63aeea760e 100644
--- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h
+++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h
@@ -26,6 +26,7 @@
#include <windows.h>
#include <grpc/compression.h>
+#include <grpc/compression_ruby.h>
#include <grpc/grpc.h>
#include <grpc/grpc_posix.h>
#include <grpc/grpc_security.h>
@@ -46,21 +47,21 @@
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
+typedef int(*grpc_compression_algorithm_is_message_type)(grpc_compression_algorithm algorithm);
+extern grpc_compression_algorithm_is_message_type grpc_compression_algorithm_is_message_import;
+#define grpc_compression_algorithm_is_message grpc_compression_algorithm_is_message_import
+typedef int(*grpc_compression_algorithm_is_stream_type)(grpc_compression_algorithm algorithm);
+extern grpc_compression_algorithm_is_stream_type grpc_compression_algorithm_is_stream_import;
+#define grpc_compression_algorithm_is_stream grpc_compression_algorithm_is_stream_import
typedef int(*grpc_compression_algorithm_parse_type)(grpc_slice value, grpc_compression_algorithm *algorithm);
extern grpc_compression_algorithm_parse_type grpc_compression_algorithm_parse_import;
#define grpc_compression_algorithm_parse grpc_compression_algorithm_parse_import
typedef int(*grpc_compression_algorithm_name_type)(grpc_compression_algorithm algorithm, const char **name);
extern grpc_compression_algorithm_name_type grpc_compression_algorithm_name_import;
#define grpc_compression_algorithm_name grpc_compression_algorithm_name_import
-typedef int(*grpc_stream_compression_algorithm_name_type)(grpc_stream_compression_algorithm algorithm, const char **name);
-extern grpc_stream_compression_algorithm_name_type grpc_stream_compression_algorithm_name_import;
-#define grpc_stream_compression_algorithm_name grpc_stream_compression_algorithm_name_import
typedef grpc_compression_algorithm(*grpc_compression_algorithm_for_level_type)(grpc_compression_level level, uint32_t accepted_encodings);
extern grpc_compression_algorithm_for_level_type grpc_compression_algorithm_for_level_import;
#define grpc_compression_algorithm_for_level grpc_compression_algorithm_for_level_import
-typedef grpc_stream_compression_algorithm(*grpc_stream_compression_algorithm_for_level_type)(grpc_stream_compression_level level, uint32_t accepted_stream_encodings);
-extern grpc_stream_compression_algorithm_for_level_type grpc_stream_compression_algorithm_for_level_import;
-#define grpc_stream_compression_algorithm_for_level grpc_stream_compression_algorithm_for_level_import
typedef void(*grpc_compression_options_init_type)(grpc_compression_options *opts);
extern grpc_compression_options_init_type grpc_compression_options_init_import;
#define grpc_compression_options_init grpc_compression_options_init_import
@@ -73,9 +74,12 @@ extern grpc_compression_options_disable_algorithm_type grpc_compression_options_
typedef int(*grpc_compression_options_is_algorithm_enabled_type)(const grpc_compression_options *opts, grpc_compression_algorithm algorithm);
extern grpc_compression_options_is_algorithm_enabled_type grpc_compression_options_is_algorithm_enabled_import;
#define grpc_compression_options_is_algorithm_enabled grpc_compression_options_is_algorithm_enabled_import
-typedef int(*grpc_compression_options_is_stream_compression_algorithm_enabled_type)(const grpc_compression_options *opts, grpc_stream_compression_algorithm algorithm);
-extern grpc_compression_options_is_stream_compression_algorithm_enabled_type grpc_compression_options_is_stream_compression_algorithm_enabled_import;
-#define grpc_compression_options_is_stream_compression_algorithm_enabled grpc_compression_options_is_stream_compression_algorithm_enabled_import
+typedef int(*grpc_compression_algorithm_parse_ruby_type)(grpc_slice value, grpc_compression_algorithm *algorithm);
+extern grpc_compression_algorithm_parse_ruby_type grpc_compression_algorithm_parse_ruby_import;
+#define grpc_compression_algorithm_parse_ruby grpc_compression_algorithm_parse_ruby_import
+typedef int(*grpc_compression_algorithm_name_ruby_type)(grpc_compression_algorithm algorithm, const char **name);
+extern grpc_compression_algorithm_name_ruby_type grpc_compression_algorithm_name_ruby_import;
+#define grpc_compression_algorithm_name_ruby grpc_compression_algorithm_name_ruby_import
typedef void(*grpc_metadata_array_init_type)(grpc_metadata_array *array);
extern grpc_metadata_array_init_type grpc_metadata_array_init_import;
#define grpc_metadata_array_init grpc_metadata_array_init_import