GRPC Core  0.11.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
compression.h File Reference
#include <stdlib.h>
#include <grpc/support/port_platform.h>

Go to the source code of this file.

Data Structures

struct  grpc_compression_options
 

Macros

#define GRPC_COMPRESSION_ALGORITHM_ARG   "grpc.compression_algorithm"
 To be used in channel arguments. More...
 
#define GRPC_COMPRESSION_ALGORITHM_STATE_ARG   "grpc.compression_algorithm_state"
 

Typedefs

typedef struct
grpc_compression_options 
grpc_compression_options
 

Enumerations

enum  grpc_compression_algorithm { GRPC_COMPRESS_NONE = 0, GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_ALGORITHMS_COUNT }
 
enum  grpc_compression_level {
  GRPC_COMPRESS_LEVEL_NONE = 0, GRPC_COMPRESS_LEVEL_LOW, GRPC_COMPRESS_LEVEL_MED, GRPC_COMPRESS_LEVEL_HIGH,
  GRPC_COMPRESS_LEVEL_COUNT
}
 

Functions

int grpc_compression_algorithm_parse (const char *name, size_t name_length, grpc_compression_algorithm *algorithm)
 Parses the first name_length bytes of name as a grpc_compression_algorithm instance, updating algorithm. More...
 
int grpc_compression_algorithm_name (grpc_compression_algorithm algorithm, char **name)
 Updates name with the encoding name corresponding to a valid algorithm. More...
 
grpc_compression_level grpc_compression_level_for_algorithm (grpc_compression_algorithm algorithm)
 Returns the compression level corresponding to algorithm. More...
 
grpc_compression_algorithm grpc_compression_algorithm_for_level (grpc_compression_level level)
 Returns the compression algorithm corresponding to level. More...
 
void grpc_compression_options_init (grpc_compression_options *opts)
 
void grpc_compression_options_enable_algorithm (grpc_compression_options *opts, grpc_compression_algorithm algorithm)
 Mark algorithm as enabled in opts. More...
 
void grpc_compression_options_disable_algorithm (grpc_compression_options *opts, grpc_compression_algorithm algorithm)
 Mark algorithm as disabled in opts. More...
 
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. More...
 

Macro Definition Documentation

#define GRPC_COMPRESSION_ALGORITHM_ARG   "grpc.compression_algorithm"

To be used in channel arguments.

#define GRPC_COMPRESSION_ALGORITHM_STATE_ARG   "grpc.compression_algorithm_state"

Typedef Documentation

Enumeration Type Documentation

Enumerator
GRPC_COMPRESS_NONE 
GRPC_COMPRESS_DEFLATE 
GRPC_COMPRESS_GZIP 
GRPC_COMPRESS_ALGORITHMS_COUNT 
Enumerator
GRPC_COMPRESS_LEVEL_NONE 
GRPC_COMPRESS_LEVEL_LOW 
GRPC_COMPRESS_LEVEL_MED 
GRPC_COMPRESS_LEVEL_HIGH 
GRPC_COMPRESS_LEVEL_COUNT 

Function Documentation

grpc_compression_algorithm grpc_compression_algorithm_for_level ( grpc_compression_level  level)

Returns the compression algorithm corresponding to level.

It abort()s for unknown levels .

int grpc_compression_algorithm_name ( grpc_compression_algorithm  algorithm,
char **  name 
)

Updates name with the encoding name corresponding to a valid algorithm.

Returns 1 upon success, 0 otherwise.

int grpc_compression_algorithm_parse ( const char *  name,
size_t  name_length,
grpc_compression_algorithm algorithm 
)

Parses the first name_length bytes of name as a grpc_compression_algorithm instance, updating algorithm.

Returns 1 upon success, 0 otherwise.

grpc_compression_level grpc_compression_level_for_algorithm ( grpc_compression_algorithm  algorithm)

Returns the compression level corresponding to algorithm.

It abort()s for unknown algorithms.

void grpc_compression_options_disable_algorithm ( grpc_compression_options opts,
grpc_compression_algorithm  algorithm 
)

Mark algorithm as disabled in opts.

void grpc_compression_options_enable_algorithm ( grpc_compression_options opts,
grpc_compression_algorithm  algorithm 
)

Mark algorithm as enabled in opts.

void grpc_compression_options_init ( grpc_compression_options opts)
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.