GRPC C++  1.30.0
compression.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_COMPRESSION_H
20 #define GRPC_COMPRESSION_H
21 
23 
24 #include <stdlib.h>
25 
27 #include <grpc/slice.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
35  grpc_compression_algorithm algorithm);
36 
39  grpc_compression_algorithm algorithm);
40 
44  grpc_slice value, grpc_compression_algorithm* algorithm);
45 
50  grpc_compression_algorithm algorithm, const char** name);
51 
55  grpc_compression_level level, uint32_t accepted_encodings);
56 
58 
62 
66 
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif /* GRPC_COMPRESSION_H */
grpc_compression_algorithm_is_stream
GRPCAPI int grpc_compression_algorithm_is_stream(grpc_compression_algorithm algorithm)
Return if an algorithm is stream compression algorithm.
grpc_compression_algorithm
grpc_compression_algorithm
The various compression algorithms supported by gRPC (not sorted by compression level)
Definition: compression_types.h:57
grpc_compression_options
Definition: compression_types.h:79
grpc_compression_options_enable_algorithm
GRPCAPI void grpc_compression_options_enable_algorithm(grpc_compression_options *opts, grpc_compression_algorithm algorithm)
Mark algorithm as enabled in opts.
grpc_compression_algorithm_is_message
GRPCAPI int grpc_compression_algorithm_is_message(grpc_compression_algorithm algorithm)
Return if an algorithm is message compression algorithm.
grpc_compression_algorithm_name
GRPCAPI int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm, const char **name)
Updates name with the encoding name corresponding to a valid algorithm.
grpc_slice
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1].
Definition: slice.h:60
grpc_compression_options_disable_algorithm
GRPCAPI void grpc_compression_options_disable_algorithm(grpc_compression_options *opts, grpc_compression_algorithm algorithm)
Mark algorithm as disabled in opts.
compression_types.h
slice.h
grpc_compression_options_is_algorithm_enabled
GRPCAPI int grpc_compression_options_is_algorithm_enabled(const grpc_compression_options *opts, grpc_compression_algorithm algorithm)
Returns true if algorithm is marked as enabled in opts.
grpc_compression_options_init
GRPCAPI void grpc_compression_options_init(grpc_compression_options *opts)
port_platform.h
grpc_compression_level
grpc_compression_level
Compression levels allow a party with knowledge of its peer's accepted encodings to request compressi...
Definition: compression_types.h:71
grpc_compression_algorithm_for_level
GRPCAPI grpc_compression_algorithm grpc_compression_algorithm_for_level(grpc_compression_level level, uint32_t accepted_encodings)
Returns the compression algorithm corresponding to level for the compression algorithms encoded in th...
GRPCAPI
#define GRPCAPI
Definition: port_platform.h:615
grpc_compression_algorithm_parse
GRPCAPI int grpc_compression_algorithm_parse(grpc_slice value, grpc_compression_algorithm *algorithm)
Parses the slice as a grpc_compression_algorithm instance and updating algorithm.