X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Futils%2Fjson.c;h=0efbea01ed3370f5bb6838911fce9714a4f08e13;hb=6ac36d6c40a2dd0ab2800c23d08894856b193c2f;hp=4de3e9f5cdda6dc7007f81edacff0f4fbbcb5990;hpb=aeb24275bce76a6fb32b7f9eb73fa0fa5746bcf2;p=mono.git diff --git a/mono/utils/json.c b/mono/utils/json.c index 4de3e9f5cdd..0efbea01ed3 100644 --- a/mono/utils/json.c +++ b/mono/utils/json.c @@ -1,15 +1,17 @@ -/* - * json.c: JSON writer +/** + * \file + * JSON writer * * Author: * Joao Matos (joao.matos@xamarin.com) * * Copyright 2015 Xamarin Inc (http://www.xamarin.com) + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #include -void json_writer_init (JsonWriter* writer) +void mono_json_writer_init (JsonWriter* writer) { g_assert (writer && "Expected a valid JSON writer instance"); @@ -17,25 +19,25 @@ void json_writer_init (JsonWriter* writer) writer->indent = 0; } -void json_writer_destroy (JsonWriter* writer) +void mono_json_writer_destroy (JsonWriter* writer) { g_assert (writer && "Expected a valid JSON writer instance"); g_string_free (writer->text, /*free_segment=*/TRUE); } -void json_writer_indent_push(JsonWriter* writer) +void mono_json_writer_indent_push(JsonWriter* writer) { g_assert (writer && "Expected a valid JSON writer instance"); writer->indent += JSON_INDENT_VALUE; } -void json_writer_indent_pop(JsonWriter* writer) +void mono_json_writer_indent_pop(JsonWriter* writer) { g_assert (writer && "Expected a valid JSON writer instance"); writer->indent -= JSON_INDENT_VALUE; } -void json_writer_indent(JsonWriter* writer) +void mono_json_writer_indent(JsonWriter* writer) { g_assert (writer && "Expected a valid JSON writer instance"); @@ -44,13 +46,13 @@ void json_writer_indent(JsonWriter* writer) g_string_append_c (writer->text, ' '); } -void json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args) +void mono_json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args) { g_assert (writer && "Expected a valid JSON writer instance"); g_string_append_vprintf (writer->text, format, args); } -void json_writer_printf(JsonWriter* writer, const gchar *format, ...) +void mono_json_writer_printf(JsonWriter* writer, const gchar *format, ...) { g_assert (writer && "Expected a valid JSON writer instance"); @@ -62,34 +64,34 @@ void json_writer_printf(JsonWriter* writer, const gchar *format, ...) va_end (args); } -void json_writer_array_begin(JsonWriter* writer) +void mono_json_writer_array_begin(JsonWriter* writer) { g_assert (writer && "Expected a valid JSON writer instance"); g_string_append_printf (writer->text, "[\n"); writer->indent += JSON_INDENT_VALUE; } -void json_writer_array_end(JsonWriter* writer) +void mono_json_writer_array_end(JsonWriter* writer) { g_assert (writer && "Expected a valid JSON writer instance"); g_string_append_printf (writer->text, "]"); writer->indent -= JSON_INDENT_VALUE; } -void json_writer_object_begin(JsonWriter* writer) +void mono_json_writer_object_begin(JsonWriter* writer) { g_assert (writer && "Expected a valid JSON writer instance"); - json_writer_printf (writer, "{\n"); + mono_json_writer_printf (writer, "{\n"); writer->indent += JSON_INDENT_VALUE; } -void json_writer_object_end(JsonWriter* writer) +void mono_json_writer_object_end(JsonWriter* writer) { g_assert (writer && "Expected a valid JSON writer instance"); - json_writer_printf (writer, "}"); + mono_json_writer_printf (writer, "}"); } -void json_writer_object_key(JsonWriter* writer, const gchar* format, ...) +void mono_json_writer_object_key(JsonWriter* writer, const gchar* format, ...) { g_assert (writer && "Expected a valid JSON writer instance"); @@ -97,7 +99,7 @@ void json_writer_object_key(JsonWriter* writer, const gchar* format, ...) va_start (args, format); g_string_append_printf (writer->text, "\""); - json_writer_vprintf (writer, format, args); + mono_json_writer_vprintf (writer, format, args); g_string_append_printf (writer->text, "\" : "); va_end (args);