aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2015-06-25 18:11:07 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2015-06-25 18:11:07 -0700
commitfc0fa3381c7b7088936ce6f41a8f8c41ef3c38ac (patch)
tree3862e1000e7fbe9112b95ad840756e4dddfdaa66 /include
parent331d2da2a7832d4066a0ce1d6d979059fc78ec8d (diff)
Moar tests, fixed wrongly named vbles, minor bugs.
Diffstat (limited to 'include')
-rw-r--r--include/grpc/compression.h21
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);