GRPC Core  0.11.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
channel_args.c File Reference
#include <grpc/grpc.h>
#include "src/core/channel/channel_args.h"
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>

Functions

grpc_channel_argsgrpc_channel_args_copy_and_add (const grpc_channel_args *src, const grpc_arg *to_add, size_t num_to_add)
 Copy some arguments and add the to_add parameter in the end. More...
 
grpc_channel_argsgrpc_channel_args_copy (const grpc_channel_args *src)
 
grpc_channel_argsgrpc_channel_args_merge (const grpc_channel_args *a, const grpc_channel_args *b)
 Copy args from a then args from b into a new channel args. More...
 
void grpc_channel_args_destroy (grpc_channel_args *a)
 Destroy arguments created by grpc_channel_args_copy. More...
 
int grpc_channel_args_is_census_enabled (const grpc_channel_args *a)
 Reads census_enabled settings from channel args. More...
 
grpc_compression_algorithm grpc_channel_args_get_compression_algorithm (const grpc_channel_args *a)
 Returns the compression algorithm set in a. More...
 
grpc_channel_argsgrpc_channel_args_set_compression_algorithm (grpc_channel_args *a, grpc_compression_algorithm algorithm)
 Returns a channel arg instance with compression enabled. More...
 
grpc_channel_argsgrpc_channel_args_compression_algorithm_set_state (grpc_channel_args **a, grpc_compression_algorithm algorithm, int state)
 Sets the support for the given compression algorithm. More...
 
int grpc_channel_args_compression_algorithm_get_states (const grpc_channel_args *a)
 Returns the bitset representing the support state (true for enabled, false for disabled) for compression algorithms. More...
 

Function Documentation

int grpc_channel_args_compression_algorithm_get_states ( const grpc_channel_args a)

Returns the bitset representing the support state (true for enabled, false for disabled) for compression algorithms.

The i-th bit of the returned bitset corresponds to the i-th entry in the grpc_compression_algorithm enum.

grpc_channel_args* grpc_channel_args_compression_algorithm_set_state ( grpc_channel_args **  a,
grpc_compression_algorithm  algorithm,
int  enabled 
)

Sets the support for the given compression algorithm.

By default, all compression algorithms are enabled. It's an error to disable an algorithm set by grpc_channel_args_set_compression_algorithm.

Returns an instance will the updated algorithm states. The a pointer is modified to point to the returned instance (which may be different from the input value of a).

grpc_channel_args* grpc_channel_args_copy ( const grpc_channel_args src)
grpc_channel_args* grpc_channel_args_copy_and_add ( const grpc_channel_args src,
const grpc_arg to_add,
size_t  num_to_add 
)

Copy some arguments and add the to_add parameter in the end.

If to_add is NULL, it is equivalent to call grpc_channel_args_copy.

void grpc_channel_args_destroy ( grpc_channel_args a)

Destroy arguments created by grpc_channel_args_copy.

grpc_compression_algorithm grpc_channel_args_get_compression_algorithm ( const grpc_channel_args a)

Returns the compression algorithm set in a.

int grpc_channel_args_is_census_enabled ( const grpc_channel_args a)

Reads census_enabled settings from channel args.

Returns 1 if census_enabled is specified in channel args, otherwise returns 0.

grpc_channel_args* grpc_channel_args_merge ( const grpc_channel_args a,
const grpc_channel_args b 
)

Copy args from a then args from b into a new channel args.

grpc_channel_args* grpc_channel_args_set_compression_algorithm ( grpc_channel_args a,
grpc_compression_algorithm  algorithm 
)

Returns a channel arg instance with compression enabled.

If a is non-NULL, its args are copied. N.B. GRPC_COMPRESS_NONE disables compression for the channel.