diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc/compression.h | 10 | ||||
-rw-r--r-- | include/grpc/impl/codegen/compression_types.h | 21 |
2 files changed, 3 insertions, 28 deletions
diff --git a/include/grpc/compression.h b/include/grpc/compression.h index c30f28e924..d47074c9b7 100644 --- a/include/grpc/compression.h +++ b/include/grpc/compression.h @@ -30,16 +30,12 @@ extern "C" { #endif -/** Parses \a value as a grpc_compression_algorithm instance, updating \a - * algorithm. Returns 1 upon success, 0 otherwise. */ +/** Parses the first \a name_length bytes of \a name as a + * grpc_compression_algorithm instance, updating \a algorithm. Returns 1 upon + * success, 0 otherwise. */ GRPCAPI int grpc_compression_algorithm_parse( grpc_slice value, grpc_compression_algorithm *algorithm); -/** Parses \a value as a grpc_compression_algorithm instance for stream - * compression, updating \a algorithm. Returns 1 upon success, 0 otherwise. */ -GRPCAPI int grpc_stream_compression_algorithm_parse( - grpc_slice value, grpc_compression_algorithm *algorithm); - /** Updates \a name with the encoding name corresponding to a valid \a * algorithm. Note that \a name is statically allocated and must *not* be freed. * Returns 1 upon success, 0 otherwise. */ diff --git a/include/grpc/impl/codegen/compression_types.h b/include/grpc/impl/codegen/compression_types.h index e51099f8d5..e39c13e88d 100644 --- a/include/grpc/impl/codegen/compression_types.h +++ b/include/grpc/impl/codegen/compression_types.h @@ -58,21 +58,9 @@ typedef enum { GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_GZIP, /* TODO(ctiller): snappy */ - GRPC_STREAM_COMPRESS_GZIP, GRPC_COMPRESS_ALGORITHMS_COUNT } grpc_compression_algorithm; -#define GRPC_IS_STREAM_COMPRESSION_ALGORITHM(x) \ - ((x) >= GRPC_STREAM_COMPRESS_GZIP && (x) < GRPC_COMPRESS_ALGORITHMS_COUNT) -#define GRPC_IS_MESSAGE_COMPRESSION_ALGORITHM(x) \ - ((x) >= GRPC_COMPRESS_DEFLATE && (x) <= GRPC_COMPRESS_GZIP) -#define GRPC_STREAM_COMPRESS_FLAG_OFFSET \ - (GRPC_STREAM_COMPRESS_GZIP - GRPC_COMPRESS_DEFLATE) -#define GRPC_MESSAGE_COMPRESSION_ALGORITHM_MASK \ - ((1u << GRPC_COMPRESS_DEFLATE) | (1u << GRPC_COMPRESS_GZIP)) -#define GRPC_STREAM_COMPRESSION_ALGORITHM_MASK \ - ((1u << GRPC_STREAM_COMPRESS_GZIP)) - /** Compression levels allow a party with knowledge of its peer's accepted * encodings to request compression in an abstract way. The level-algorithm * mapping is performed internally and depends on the peer's supported @@ -82,18 +70,9 @@ typedef enum { GRPC_COMPRESS_LEVEL_LOW, GRPC_COMPRESS_LEVEL_MED, GRPC_COMPRESS_LEVEL_HIGH, - GRPC_STREAM_COMPRESS_LEVEL_LOW, - GRPC_STREAM_COMPRESS_LEVEL_MED, - GRPC_STREAM_COMPRESS_LEVEL_HIGH, GRPC_COMPRESS_LEVEL_COUNT } grpc_compression_level; -#define GRPC_IS_STREAM_COMPRESSION_LEVEL(x) \ - (((x) >= GRPC_STREAM_COMPRESS_LEVEL_LOW) && \ - ((x) <= GRPC_STREAM_COMPRESS_LEVEL_HIGH)) -#define GRPC_IS_MESSAGE_COMPRESSION_LEVEL(x) \ - (((x) >= GRPC_COMPRESS_LEVEL_LOW) && ((x) <= GRPC_COMPRESS_LEVEL_HIGH)) - typedef struct grpc_compression_options { /** All algs are enabled by default. This option corresponds to the channel * argument key behind \a GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET |