aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/ext/grpc/rb_channel_credentials.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ruby/ext/grpc/rb_channel_credentials.c')
-rw-r--r--src/ruby/ext/grpc/rb_channel_credentials.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/ruby/ext/grpc/rb_channel_credentials.c b/src/ruby/ext/grpc/rb_channel_credentials.c
index 83601ca694..b23a32caf1 100644
--- a/src/ruby/ext/grpc/rb_channel_credentials.c
+++ b/src/ruby/ext/grpc/rb_channel_credentials.c
@@ -35,7 +35,7 @@
grpc_channel_credentials. */
static VALUE grpc_rb_cChannelCredentials = Qnil;
-static char *pem_root_certs = NULL;
+static char* pem_root_certs = NULL;
/* grpc_rb_channel_credentials wraps a grpc_channel_credentials. It provides a
* mark object that is used to hold references to any objects used to create
@@ -45,16 +45,16 @@ typedef struct grpc_rb_channel_credentials {
VALUE mark;
/* The actual credentials */
- grpc_channel_credentials *wrapped;
+ grpc_channel_credentials* wrapped;
} grpc_rb_channel_credentials;
/* Destroys the credentials instances. */
-static void grpc_rb_channel_credentials_free(void *p) {
- grpc_rb_channel_credentials *wrapper = NULL;
+static void grpc_rb_channel_credentials_free(void* p) {
+ grpc_rb_channel_credentials* wrapper = NULL;
if (p == NULL) {
return;
};
- wrapper = (grpc_rb_channel_credentials *)p;
+ wrapper = (grpc_rb_channel_credentials*)p;
grpc_channel_credentials_release(wrapper->wrapped);
wrapper->wrapped = NULL;
@@ -62,12 +62,12 @@ static void grpc_rb_channel_credentials_free(void *p) {
}
/* Protects the mark object from GC */
-static void grpc_rb_channel_credentials_mark(void *p) {
- grpc_rb_channel_credentials *wrapper = NULL;
+static void grpc_rb_channel_credentials_mark(void* p) {
+ grpc_rb_channel_credentials* wrapper = NULL;
if (p == NULL) {
return;
}
- wrapper = (grpc_rb_channel_credentials *)p;
+ wrapper = (grpc_rb_channel_credentials*)p;
if (wrapper->mark != Qnil) {
rb_gc_mark(wrapper->mark);
@@ -90,7 +90,7 @@ static rb_data_type_t grpc_rb_channel_credentials_data_type = {
/* Allocates ChannelCredential instances.
Provides safe initial defaults for the instance fields. */
static VALUE grpc_rb_channel_credentials_alloc(VALUE cls) {
- grpc_rb_channel_credentials *wrapper = ALLOC(grpc_rb_channel_credentials);
+ grpc_rb_channel_credentials* wrapper = ALLOC(grpc_rb_channel_credentials);
wrapper->wrapped = NULL;
wrapper->mark = Qnil;
return TypedData_Wrap_Struct(cls, &grpc_rb_channel_credentials_data_type,
@@ -100,10 +100,10 @@ static VALUE grpc_rb_channel_credentials_alloc(VALUE cls) {
/* Creates a wrapping object for a given channel credentials. This should only
* be called with grpc_channel_credentials objects that are not already
* associated with any Ruby object. */
-VALUE grpc_rb_wrap_channel_credentials(grpc_channel_credentials *c,
+VALUE grpc_rb_wrap_channel_credentials(grpc_channel_credentials* c,
VALUE mark) {
VALUE rb_wrapper;
- grpc_rb_channel_credentials *wrapper;
+ grpc_rb_channel_credentials* wrapper;
if (c == NULL) {
return Qnil;
}
@@ -136,15 +136,15 @@ static ID id_pem_cert_chain;
pem_private_key: (optional) PEM encoding of the client's private key
pem_cert_chain: (optional) PEM encoding of the client's cert chain
Initializes Credential instances. */
-static VALUE grpc_rb_channel_credentials_init(int argc, VALUE *argv,
+static VALUE grpc_rb_channel_credentials_init(int argc, VALUE* argv,
VALUE self) {
VALUE pem_root_certs = Qnil;
VALUE pem_private_key = Qnil;
VALUE pem_cert_chain = Qnil;
- grpc_rb_channel_credentials *wrapper = NULL;
- grpc_channel_credentials *creds = NULL;
+ grpc_rb_channel_credentials* wrapper = NULL;
+ grpc_channel_credentials* creds = NULL;
grpc_ssl_pem_key_cert_pair key_cert_pair;
- const char *pem_root_certs_cstr = NULL;
+ const char* pem_root_certs_cstr = NULL;
MEMZERO(&key_cert_pair, grpc_ssl_pem_key_cert_pair, 1);
grpc_ruby_once_init();
@@ -180,11 +180,11 @@ static VALUE grpc_rb_channel_credentials_init(int argc, VALUE *argv,
return self;
}
-static VALUE grpc_rb_channel_credentials_compose(int argc, VALUE *argv,
+static VALUE grpc_rb_channel_credentials_compose(int argc, VALUE* argv,
VALUE self) {
- grpc_channel_credentials *creds;
- grpc_call_credentials *other;
- grpc_channel_credentials *prev = NULL;
+ grpc_channel_credentials* creds;
+ grpc_call_credentials* other;
+ grpc_channel_credentials* prev = NULL;
VALUE mark;
if (argc == 0) {
return self;
@@ -210,7 +210,7 @@ static VALUE grpc_rb_channel_credentials_compose(int argc, VALUE *argv,
}
static grpc_ssl_roots_override_result get_ssl_roots_override(
- char **pem_root_certs_ptr) {
+ char** pem_root_certs_ptr) {
*pem_root_certs_ptr = pem_root_certs;
if (pem_root_certs == NULL) {
return GRPC_SSL_ROOTS_OVERRIDE_FAIL;
@@ -220,7 +220,7 @@ static grpc_ssl_roots_override_result get_ssl_roots_override(
}
static VALUE grpc_rb_set_default_roots_pem(VALUE self, VALUE roots) {
- char *roots_ptr = StringValueCStr(roots);
+ char* roots_ptr = StringValueCStr(roots);
size_t length = strlen(roots_ptr);
(void)self;
pem_root_certs = gpr_malloc((length + 1) * sizeof(char));
@@ -255,8 +255,8 @@ void Init_grpc_channel_credentials() {
}
/* Gets the wrapped grpc_channel_credentials from the ruby wrapper */
-grpc_channel_credentials *grpc_rb_get_wrapped_channel_credentials(VALUE v) {
- grpc_rb_channel_credentials *wrapper = NULL;
+grpc_channel_credentials* grpc_rb_get_wrapped_channel_credentials(VALUE v) {
+ grpc_rb_channel_credentials* wrapper = NULL;
TypedData_Get_Struct(v, grpc_rb_channel_credentials,
&grpc_rb_channel_credentials_data_type, wrapper);
return wrapper->wrapped;