aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/json/json_writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/json/json_writer.cc')
-rw-r--r--src/core/lib/json/json_writer.cc40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/core/lib/json/json_writer.cc b/src/core/lib/json/json_writer.cc
index eab1bff7a6..0b9c7c30ea 100644
--- a/src/core/lib/json/json_writer.cc
+++ b/src/core/lib/json/json_writer.cc
@@ -22,22 +22,22 @@
#include "src/core/lib/json/json_writer.h"
-static void json_writer_output_char(grpc_json_writer *writer, char c) {
+static void json_writer_output_char(grpc_json_writer* writer, char c) {
writer->vtable->output_char(writer->userdata, c);
}
-static void json_writer_output_string(grpc_json_writer *writer,
- const char *str) {
+static void json_writer_output_string(grpc_json_writer* writer,
+ const char* str) {
writer->vtable->output_string(writer->userdata, str);
}
-static void json_writer_output_string_with_len(grpc_json_writer *writer,
- const char *str, size_t len) {
+static void json_writer_output_string_with_len(grpc_json_writer* writer,
+ const char* str, size_t len) {
writer->vtable->output_string_with_len(writer->userdata, str, len);
}
-void grpc_json_writer_init(grpc_json_writer *writer, int indent,
- grpc_json_writer_vtable *vtable, void *userdata) {
+void grpc_json_writer_init(grpc_json_writer* writer, int indent,
+ grpc_json_writer_vtable* vtable, void* userdata) {
memset(writer, 0, sizeof(*writer));
writer->container_empty = 1;
writer->indent = indent;
@@ -45,7 +45,7 @@ void grpc_json_writer_init(grpc_json_writer *writer, int indent,
writer->userdata = userdata;
}
-static void json_writer_output_indent(grpc_json_writer *writer) {
+static void json_writer_output_indent(grpc_json_writer* writer) {
static const char spacesstr[] =
" "
" "
@@ -73,7 +73,7 @@ static void json_writer_output_indent(grpc_json_writer *writer) {
writer, spacesstr + sizeof(spacesstr) - 1 - spaces, spaces);
}
-static void json_writer_value_end(grpc_json_writer *writer) {
+static void json_writer_value_end(grpc_json_writer* writer) {
if (writer->container_empty) {
writer->container_empty = 0;
if ((writer->indent == 0) || (writer->depth == 0)) return;
@@ -85,7 +85,7 @@ static void json_writer_value_end(grpc_json_writer *writer) {
}
}
-static void json_writer_escape_utf16(grpc_json_writer *writer, uint16_t utf16) {
+static void json_writer_escape_utf16(grpc_json_writer* writer, uint16_t utf16) {
static const char hex[] = "0123456789abcdef";
json_writer_output_string_with_len(writer, "\\u", 2);
@@ -95,8 +95,8 @@ static void json_writer_escape_utf16(grpc_json_writer *writer, uint16_t utf16) {
json_writer_output_char(writer, hex[(utf16)&0x0f]);
}
-static void json_writer_escape_string(grpc_json_writer *writer,
- const char *string) {
+static void json_writer_escape_string(grpc_json_writer* writer,
+ const char* string) {
json_writer_output_char(writer, '"');
for (;;) {
@@ -190,7 +190,7 @@ static void json_writer_escape_string(grpc_json_writer *writer,
json_writer_output_char(writer, '"');
}
-void grpc_json_writer_container_begins(grpc_json_writer *writer,
+void grpc_json_writer_container_begins(grpc_json_writer* writer,
grpc_json_type type) {
if (!writer->got_key) json_writer_value_end(writer);
json_writer_output_indent(writer);
@@ -200,7 +200,7 @@ void grpc_json_writer_container_begins(grpc_json_writer *writer,
writer->depth++;
}
-void grpc_json_writer_container_ends(grpc_json_writer *writer,
+void grpc_json_writer_container_ends(grpc_json_writer* writer,
grpc_json_type type) {
if (writer->indent && !writer->container_empty)
json_writer_output_char(writer, '\n');
@@ -211,7 +211,7 @@ void grpc_json_writer_container_ends(grpc_json_writer *writer,
writer->got_key = 0;
}
-void grpc_json_writer_object_key(grpc_json_writer *writer, const char *string) {
+void grpc_json_writer_object_key(grpc_json_writer* writer, const char* string) {
json_writer_value_end(writer);
json_writer_output_indent(writer);
json_writer_escape_string(writer, string);
@@ -219,23 +219,23 @@ void grpc_json_writer_object_key(grpc_json_writer *writer, const char *string) {
writer->got_key = 1;
}
-void grpc_json_writer_value_raw(grpc_json_writer *writer, const char *string) {
+void grpc_json_writer_value_raw(grpc_json_writer* writer, const char* string) {
if (!writer->got_key) json_writer_value_end(writer);
json_writer_output_indent(writer);
json_writer_output_string(writer, string);
writer->got_key = 0;
}
-void grpc_json_writer_value_raw_with_len(grpc_json_writer *writer,
- const char *string, size_t len) {
+void grpc_json_writer_value_raw_with_len(grpc_json_writer* writer,
+ const char* string, size_t len) {
if (!writer->got_key) json_writer_value_end(writer);
json_writer_output_indent(writer);
json_writer_output_string_with_len(writer, string, len);
writer->got_key = 0;
}
-void grpc_json_writer_value_string(grpc_json_writer *writer,
- const char *string) {
+void grpc_json_writer_value_string(grpc_json_writer* writer,
+ const char* string) {
if (!writer->got_key) json_writer_value_end(writer);
json_writer_output_indent(writer);
json_writer_escape_string(writer, string);