diff options
author | David Garcia Quintas <dgq@google.com> | 2016-02-17 17:43:42 -0800 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2016-02-17 17:43:42 -0800 |
commit | 10e269897f3f664edb22befc646522b18e2d3586 (patch) | |
tree | b47e1f3bd2f920ba55d676207b0f8682f1d73880 /include | |
parent | 5e07d76a86c42e4e4e5d103b7579e364339af4d0 (diff) | |
parent | 3cce2ecb12a8528487e83389cdfd0e32ca0633b7 (diff) |
Merge branch 'master' of github.com:grpc/grpc into alarm_cpp
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc++/support/channel_arguments.h | 11 | ||||
-rw-r--r-- | include/grpc/grpc_security.h | 3 | ||||
-rw-r--r-- | include/grpc/impl/codegen/grpc_types.h | 9 | ||||
-rw-r--r-- | include/grpc/support/avl.h | 5 | ||||
-rw-r--r-- | include/grpc/support/useful.h | 4 |
5 files changed, 22 insertions, 10 deletions
diff --git a/include/grpc++/support/channel_arguments.h b/include/grpc++/support/channel_arguments.h index a2960a7ecc..4e530d4b89 100644 --- a/include/grpc++/support/channel_arguments.h +++ b/include/grpc++/support/channel_arguments.h @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -51,7 +51,7 @@ class ChannelArgumentsTest; /// concrete setters are provided. class ChannelArguments { public: - ChannelArguments() {} + ChannelArguments(); ~ChannelArguments() {} ChannelArguments(const ChannelArguments& other); @@ -62,8 +62,8 @@ class ChannelArguments { void Swap(ChannelArguments& other); - /// Populates this instance with the arguments from \a channel_args. Does not - /// take ownership of \a channel_args. + /// Dump arguments in this instance to \a channel_args. Does not take + /// ownership of \a channel_args. /// /// Note that the underlying arguments are shared. Changes made to either \a /// channel_args or this instance would be reflected on both. @@ -77,6 +77,9 @@ class ChannelArguments { /// Set the compression algorithm for the channel. void SetCompressionAlgorithm(grpc_compression_algorithm algorithm); + /// The given string will be sent at the front of the user agent string. + void SetUserAgentPrefix(const grpc::string& user_agent_prefix); + // Generic channel argument setters. Only for advanced use cases. /// Set an integer argument \a value under \a key. void SetInt(const grpc::string& key, int value); diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h index 3de5cae8be..ef7205ded8 100644 --- a/include/grpc/grpc_security.h +++ b/include/grpc/grpc_security.h @@ -167,7 +167,8 @@ typedef grpc_ssl_roots_override_result (*grpc_ssl_roots_override_callback)( before any ssl credentials are created to have the desired side effect. If GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is set to a valid path, the callback will not be called. */ -void grpc_set_ssl_roots_override_callback(grpc_ssl_roots_override_callback cb); +GRPCAPI void grpc_set_ssl_roots_override_callback( + grpc_ssl_roots_override_callback cb); /* Object that holds a private key / certificate chain pair in PEM format. */ typedef struct { diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index ea1e96cf1d..b11f6ffec4 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -68,6 +68,12 @@ typedef enum { GRPC_ARG_POINTER } grpc_arg_type; +typedef struct grpc_arg_pointer_vtable { + void *(*copy)(void *p); + void (*destroy)(void *p); + int (*cmp)(void *p, void *q); +} grpc_arg_pointer_vtable; + /** A single argument... each argument has a key and a value A note on naming keys: @@ -88,8 +94,7 @@ typedef struct { int integer; struct { void *p; - void *(*copy)(void *p); - void (*destroy)(void *p); + const grpc_arg_pointer_vtable *vtable; } pointer; } value; } grpc_arg; diff --git a/include/grpc/support/avl.h b/include/grpc/support/avl.h index 28eb5b175e..2fe2d0b9d0 100644 --- a/include/grpc/support/avl.h +++ b/include/grpc/support/avl.h @@ -81,11 +81,12 @@ GPRAPI void gpr_avl_unref(gpr_avl avl); if key exists in avl, the new tree's key entry updated (i.e. a duplicate is not created) */ GPRAPI gpr_avl gpr_avl_add(gpr_avl avl, void *key, void *value); -/** return a new tree with key deleted */ +/** return a new tree with key deleted + implicitly unrefs avl to allow easy chaining. */ GPRAPI gpr_avl gpr_avl_remove(gpr_avl avl, void *key); /** lookup key, and return the associated value. does not mutate avl. returns NULL if key is not found. */ GPRAPI void *gpr_avl_get(gpr_avl avl, void *key); -#endif +#endif /* GRPC_SUPPORT_AVL_H */ diff --git a/include/grpc/support/useful.h b/include/grpc/support/useful.h index 9f08d788c0..a0e76da29e 100644 --- a/include/grpc/support/useful.h +++ b/include/grpc/support/useful.h @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -72,4 +72,6 @@ 0x0f0f0f0f) % \ 255) +#define GPR_ICMP(a, b) ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0)) + #endif /* GRPC_SUPPORT_USEFUL_H */ |