avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bru...@apache.org
Subject svn commit: r1057697 - in /avro/trunk: CHANGES.txt lang/c/src/avro.h lang/c/src/schema.c
Date Tue, 11 Jan 2011 15:34:44 GMT
Author: brucem
Date: Tue Jan 11 15:34:44 2011
New Revision: 1057697

URL: http://svn.apache.org/viewvc?rev=1057697&view=rev
Log:
AVRO-729. avro_schema_to_json can take const schema.

This method doesn't modify the schema as it writes its JSON encoding, so
the schema parameter can be const.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/c/src/avro.h
    avro/trunk/lang/c/src/schema.c

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1057697&r1=1057696&r2=1057697&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Tue Jan 11 15:34:44 2011
@@ -100,6 +100,9 @@ Avro 1.5.0 (unreleased)
     AVRO-727. C: Add many new accessor and mutator functions. (Douglas Creager
     via brucem)
 
+    AVRO-729. C: avro_schema_to_json can take const schema. (Douglas Creager
+    via brucem)
+
   BUG FIXES
 
     AVRO-675. C: Bytes and fixed setters don't update datum size.

Modified: avro/trunk/lang/c/src/avro.h
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/src/avro.h?rev=1057697&r1=1057696&r2=1057697&view=diff
==============================================================================
--- avro/trunk/lang/c/src/avro.h (original)
+++ avro/trunk/lang/c/src/avro.h Tue Jan 11 15:34:44 2011
@@ -171,7 +171,7 @@ typedef struct avro_schema_error_t_ *avr
 int avro_schema_from_json(const char *jsontext,
 			  const int32_t len,
 			  avro_schema_t * schema, avro_schema_error_t * error);
-int avro_schema_to_json(avro_schema_t schema, avro_writer_t out);
+int avro_schema_to_json(const avro_schema_t schema, avro_writer_t out);
 
 int avro_schema_to_specific(avro_schema_t schema, const char *prefix);
 

Modified: avro/trunk/lang/c/src/schema.c
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/src/schema.c?rev=1057697&r1=1057696&r2=1057697&view=diff
==============================================================================
--- avro/trunk/lang/c/src/schema.c (original)
+++ avro/trunk/lang/c/src/schema.c Tue Jan 11 15:34:44 2011
@@ -1352,7 +1352,7 @@ static int avro_write_str(avro_writer_t 
 	return avro_write(out, (char *)str, strlen(str));
 }
 
-static int write_field(avro_writer_t out, struct avro_record_field_t *field)
+static int write_field(avro_writer_t out, const struct avro_record_field_t *field)
 {
 	int rval;
 	check(rval, avro_write_str(out, "{\"name\":\""));
@@ -1362,7 +1362,7 @@ static int write_field(avro_writer_t out
 	return avro_write_str(out, "}");
 }
 
-static int write_record(avro_writer_t out, struct avro_record_schema_t *record)
+static int write_record(avro_writer_t out, const struct avro_record_schema_t *record)
 {
 	int rval;
 	long i;
@@ -1390,7 +1390,7 @@ static int write_record(avro_writer_t ou
 	return avro_write_str(out, "]}");
 }
 
-static int write_enum(avro_writer_t out, struct avro_enum_schema_t *enump)
+static int write_enum(avro_writer_t out, const struct avro_enum_schema_t *enump)
 {
 	int rval;
 	long i;
@@ -1413,7 +1413,7 @@ static int write_enum(avro_writer_t out,
 	}
 	return avro_write_str(out, "]}");
 }
-static int write_fixed(avro_writer_t out, struct avro_fixed_schema_t *fixed)
+static int write_fixed(avro_writer_t out, const struct avro_fixed_schema_t *fixed)
 {
 	int rval;
 	char size[16];
@@ -1424,21 +1424,21 @@ static int write_fixed(avro_writer_t out
 	check(rval, avro_write_str(out, size));
 	return avro_write_str(out, "}");
 }
-static int write_map(avro_writer_t out, struct avro_map_schema_t *map)
+static int write_map(avro_writer_t out, const struct avro_map_schema_t *map)
 {
 	int rval;
 	check(rval, avro_write_str(out, "{\"type\":\"map\",\"values\":"));
 	check(rval, avro_schema_to_json(map->values, out));
 	return avro_write_str(out, "}");
 }
-static int write_array(avro_writer_t out, struct avro_array_schema_t *array)
+static int write_array(avro_writer_t out, const struct avro_array_schema_t *array)
 {
 	int rval;
 	check(rval, avro_write_str(out, "{\"type\":\"array\",\"items\":"));
 	check(rval, avro_schema_to_json(array->items, out));
 	return avro_write_str(out, "}");
 }
-static int write_union(avro_writer_t out, struct avro_union_schema_t *unionp)
+static int write_union(avro_writer_t out, const struct avro_union_schema_t *unionp)
 {
 	int rval;
 	long i;
@@ -1457,7 +1457,7 @@ static int write_union(avro_writer_t out
 	}
 	return avro_write_str(out, "]");
 }
-static int write_link(avro_writer_t out, struct avro_link_schema_t *link)
+static int write_link(avro_writer_t out, const struct avro_link_schema_t *link)
 {
 	int rval;
 	check(rval, avro_write_str(out, "\""));
@@ -1465,7 +1465,7 @@ static int write_link(avro_writer_t out,
 	return avro_write_str(out, "\"");
 }
 
-int avro_schema_to_json(avro_schema_t schema, avro_writer_t out)
+int avro_schema_to_json(const avro_schema_t schema, avro_writer_t out)
 {
 	int rval;
 



Mime
View raw message