diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2016-01-13 06:54:27 -0800 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2016-01-13 06:54:27 -0800 |
commit | edc2fffb34cdaaa5274432a197205fc8d3c206be (patch) | |
tree | a546b3ff30e6aec7a84683e7d07d819da4f72913 /include | |
parent | 0ade2d415ff5dbc9fca7b942809ef7179db08ef7 (diff) |
Channel args comparisons
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc/grpc.h | 9 | ||||
-rw-r--r-- | include/grpc/support/useful.h | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index be4c4d2b17..1cf5b5513b 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -77,6 +77,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: @@ -97,8 +103,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/useful.h b/include/grpc/support/useful.h index 9f08d788c0..003e096cf9 100644 --- a/include/grpc/support/useful.h +++ b/include/grpc/support/useful.h @@ -72,4 +72,6 @@ 0x0f0f0f0f) % \ 255) +#define GPR_ICMP(a, b) ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0)) + #endif /* GRPC_SUPPORT_USEFUL_H */ |