Craig Tiller | ebdef9d | 2015-11-19 17:09:49 -0800 | [diff] [blame] | 1 | /* |
| 2 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 3 | * Copyright 2015 gRPC authors. |
Craig Tiller | ebdef9d | 2015-11-19 17:09:49 -0800 | [diff] [blame] | 4 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 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 |
Craig Tiller | ebdef9d | 2015-11-19 17:09:49 -0800 | [diff] [blame] | 8 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Craig Tiller | ebdef9d | 2015-11-19 17:09:49 -0800 | [diff] [blame] | 10 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 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. |
Craig Tiller | ebdef9d | 2015-11-19 17:09:49 -0800 | [diff] [blame] | 16 | * |
| 17 | */ |
| 18 | |
Craig Tiller | 9a4dddd | 2016-03-25 17:08:13 -0700 | [diff] [blame] | 19 | #ifndef GRPC_CORE_LIB_COMPRESSION_ALGORITHM_METADATA_H |
| 20 | #define GRPC_CORE_LIB_COMPRESSION_ALGORITHM_METADATA_H |
Craig Tiller | ebdef9d | 2015-11-19 17:09:49 -0800 | [diff] [blame] | 21 | |
| 22 | #include <grpc/compression.h> |
Craig Tiller | 9533d04 | 2016-03-25 17:11:06 -0700 | [diff] [blame] | 23 | #include "src/core/lib/transport/metadata.h" |
Craig Tiller | ebdef9d | 2015-11-19 17:09:49 -0800 | [diff] [blame] | 24 | |
| 25 | /** Return compression algorithm based metadata value */ |
Craig Tiller | 7c70b6c | 2017-01-23 07:48:42 -0800 | [diff] [blame] | 26 | grpc_slice grpc_compression_algorithm_slice( |
Craig Tiller | ebdef9d | 2015-11-19 17:09:49 -0800 | [diff] [blame] | 27 | grpc_compression_algorithm algorithm); |
| 28 | |
Muxi Yan | 68a0fd5 | 2017-07-21 09:26:04 -0700 | [diff] [blame] | 29 | /** Return stream compression algorithm based metadata value */ |
| 30 | grpc_slice grpc_stream_compression_algorithm_slice( |
| 31 | grpc_stream_compression_algorithm algorithm); |
| 32 | |
Craig Tiller | ebdef9d | 2015-11-19 17:09:49 -0800 | [diff] [blame] | 33 | /** Return compression algorithm based metadata element (grpc-encoding: xxx) */ |
Craig Tiller | 7c70b6c | 2017-01-23 07:48:42 -0800 | [diff] [blame] | 34 | grpc_mdelem grpc_compression_encoding_mdelem( |
Craig Tiller | ebdef9d | 2015-11-19 17:09:49 -0800 | [diff] [blame] | 35 | grpc_compression_algorithm algorithm); |
| 36 | |
Muxi Yan | 68a0fd5 | 2017-07-21 09:26:04 -0700 | [diff] [blame] | 37 | /** Return stream compression algorithm based metadata element |
| 38 | * (content-encoding: xxx) */ |
| 39 | grpc_mdelem grpc_stream_compression_encoding_mdelem( |
| 40 | grpc_stream_compression_algorithm algorithm); |
| 41 | |
Craig Tiller | ebdef9d | 2015-11-19 17:09:49 -0800 | [diff] [blame] | 42 | /** Find compression algorithm based on passed in mdstr - returns |
| 43 | * GRPC_COMPRESS_ALGORITHM_COUNT on failure */ |
Craig Tiller | 7c70b6c | 2017-01-23 07:48:42 -0800 | [diff] [blame] | 44 | grpc_compression_algorithm grpc_compression_algorithm_from_slice( |
| 45 | grpc_slice str); |
Craig Tiller | ebdef9d | 2015-11-19 17:09:49 -0800 | [diff] [blame] | 46 | |
Muxi Yan | 68a0fd5 | 2017-07-21 09:26:04 -0700 | [diff] [blame] | 47 | /** Find stream compression algorithm based on passed in mdstr - returns |
| 48 | * GRPC_STREAM_COMPRESS_ALGORITHM_COUNT on failure */ |
| 49 | grpc_stream_compression_algorithm grpc_stream_compression_algorithm_from_slice( |
| 50 | grpc_slice str); |
| 51 | |
Craig Tiller | 9a4dddd | 2016-03-25 17:08:13 -0700 | [diff] [blame] | 52 | #endif /* GRPC_CORE_LIB_COMPRESSION_ALGORITHM_METADATA_H */ |