diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc/compression.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/grpc/compression.h b/include/grpc/compression.h index 61bce05b50..1cff5d2d7e 100644 --- a/include/grpc/compression.h +++ b/include/grpc/compression.h @@ -50,12 +50,29 @@ typedef enum { GRPC_COMPRESS_LEVEL_NONE = 0, GRPC_COMPRESS_LEVEL_LOW, GRPC_COMPRESS_LEVEL_MED, - GRPC_COMPRESS_LEVEL_HIGH + GRPC_COMPRESS_LEVEL_HIGH, + GRPC_COMPRESS_LEVEL_COUNT } grpc_compression_level; -const char *grpc_compression_algorithm_name( +/** Parses \a name as a grpc_compression_algorithm instance, updating \a + * algorithm. Returns 1 upon success, 0 otherwise. */ +int grpc_compression_algorithm_parse(const char *name, + grpc_compression_algorithm *algorithm); + +/** Updates \a name with the encoding name corresponding to a valid \a + * algorithm. Returns 1 upon success, 0 otherwise. */ +int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm, + char **name); + +/** Returns the compression level corresponding to \a algorithm. + * + * It abort()s for unknown algorithms. */ +grpc_compression_level grpc_compression_level_for_algorithm( grpc_compression_algorithm algorithm); +/** Returns the compression algorithm corresponding to \a level. + * + * It abort()s for unknown levels . */ grpc_compression_algorithm grpc_compression_algorithm_for_level( grpc_compression_level level); |