diff options
Diffstat (limited to 'src/core/surface/event_string.c')
-rw-r--r-- | src/core/surface/event_string.c | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/src/core/surface/event_string.c b/src/core/surface/event_string.c index ac5cb657cd..33cd4a43aa 100644 --- a/src/core/surface/event_string.c +++ b/src/core/surface/event_string.c @@ -39,55 +39,43 @@ #include <grpc/byte_buffer.h> #include <grpc/support/string_util.h> -static void -addhdr (gpr_strvec * buf, grpc_event * ev) -{ +static void addhdr(gpr_strvec *buf, grpc_event *ev) { char *tmp; - gpr_asprintf (&tmp, "tag:%p", ev->tag); - gpr_strvec_add (buf, tmp); + gpr_asprintf(&tmp, "tag:%p", ev->tag); + gpr_strvec_add(buf, tmp); } -static const char * -errstr (int success) -{ - return success ? "OK" : "ERROR"; -} +static const char *errstr(int success) { return success ? "OK" : "ERROR"; } -static void -adderr (gpr_strvec * buf, int success) -{ +static void adderr(gpr_strvec *buf, int success) { char *tmp; - gpr_asprintf (&tmp, " %s", errstr (success)); - gpr_strvec_add (buf, tmp); + gpr_asprintf(&tmp, " %s", errstr(success)); + gpr_strvec_add(buf, tmp); } -char * -grpc_event_string (grpc_event * ev) -{ +char *grpc_event_string(grpc_event *ev) { char *out; gpr_strvec buf; - if (ev == NULL) - return gpr_strdup ("null"); + if (ev == NULL) return gpr_strdup("null"); - gpr_strvec_init (&buf); + gpr_strvec_init(&buf); - switch (ev->type) - { + switch (ev->type) { case GRPC_QUEUE_TIMEOUT: - gpr_strvec_add (&buf, gpr_strdup ("QUEUE_TIMEOUT")); + gpr_strvec_add(&buf, gpr_strdup("QUEUE_TIMEOUT")); break; case GRPC_QUEUE_SHUTDOWN: - gpr_strvec_add (&buf, gpr_strdup ("QUEUE_SHUTDOWN")); + gpr_strvec_add(&buf, gpr_strdup("QUEUE_SHUTDOWN")); break; case GRPC_OP_COMPLETE: - gpr_strvec_add (&buf, gpr_strdup ("OP_COMPLETE: ")); - addhdr (&buf, ev); - adderr (&buf, ev->success); + gpr_strvec_add(&buf, gpr_strdup("OP_COMPLETE: ")); + addhdr(&buf, ev); + adderr(&buf, ev->success); break; - } + } - out = gpr_strvec_flatten (&buf, NULL); - gpr_strvec_destroy (&buf); + out = gpr_strvec_flatten(&buf, NULL); + gpr_strvec_destroy(&buf); return out; } |