GRPC C++  1.66.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 
22 #include <stdlib.h>
23 
24 #include <grpc/impl/compression_types.h> // IWYU pragma: export
25 #include <grpc/slice.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
34  grpc_compression_algorithm algorithm);
35 
38  grpc_compression_algorithm algorithm);
39 
43  grpc_slice name, grpc_compression_algorithm* algorithm);
44 
49  grpc_compression_algorithm algorithm, const char** name);
50 
54  grpc_compression_level level, uint32_t accepted_encodings);
55 
57 
61 
65 
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #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.
GRPCAPI
#define GRPCAPI
Definition: port_platform.h:725
grpc_compression_algorithm
grpc_compression_algorithm
The various compression algorithms supported by gRPC (not sorted by compression level)
Definition: compression_types.h:60
grpc_compression_options
Definition: compression_types.h:80
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_type.h:63
grpc_compression_algorithm_parse
GRPCAPI int grpc_compression_algorithm_parse(grpc_slice name, grpc_compression_algorithm *algorithm)
Parses the slice as a grpc_compression_algorithm instance and updating algorithm.
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)
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:72
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...
port_platform.h