avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mas...@apache.org
Subject svn commit: r901421 [1/3] - in /hadoop/avro/trunk: ./ lang/c/ lang/c/src/ lang/c/tests/
Date Wed, 20 Jan 2010 22:58:23 GMT
Author: massie
Date: Wed Jan 20 22:58:22 2010
New Revision: 901421

URL: http://svn.apache.org/viewvc?rev=901421&view=rev
Log:
AVRO-360.  Standardize on Linux coding style instead of GNU

Modified:
    hadoop/avro/trunk/CHANGES.txt
    hadoop/avro/trunk/lang/c/Makefile.am
    hadoop/avro/trunk/lang/c/src/avro.h
    hadoop/avro/trunk/lang/c/src/container_of.h
    hadoop/avro/trunk/lang/c/src/datum.c
    hadoop/avro/trunk/lang/c/src/datum.h
    hadoop/avro/trunk/lang/c/src/dump.c
    hadoop/avro/trunk/lang/c/src/dump.h
    hadoop/avro/trunk/lang/c/src/encoding.h
    hadoop/avro/trunk/lang/c/src/encoding_binary.c
    hadoop/avro/trunk/lang/c/src/io.c
    hadoop/avro/trunk/lang/c/src/queue.h
    hadoop/avro/trunk/lang/c/src/schema.c
    hadoop/avro/trunk/lang/c/src/schema.h
    hadoop/avro/trunk/lang/c/src/schema_equal.c
    hadoop/avro/trunk/lang/c/src/schema_printf.c
    hadoop/avro/trunk/lang/c/src/schema_specific.c
    hadoop/avro/trunk/lang/c/src/st.c
    hadoop/avro/trunk/lang/c/src/st.h
    hadoop/avro/trunk/lang/c/tests/test_avro_data.c
    hadoop/avro/trunk/lang/c/tests/test_avro_interop.c
    hadoop/avro/trunk/lang/c/tests/test_avro_schema.c

Modified: hadoop/avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/CHANGES.txt?rev=901421&r1=901420&r2=901421&view=diff
==============================================================================
--- hadoop/avro/trunk/CHANGES.txt (original)
+++ hadoop/avro/trunk/CHANGES.txt Wed Jan 20 22:58:22 2010
@@ -233,6 +233,8 @@
 
     AVRO-359. Add support for encoding/decoding arrays and maps (massie)
 
+    AVRO-360. Standardize on Linux coding style instead of GNU (massie)
+
   OPTIMIZATIONS
 
     AVRO-172. More efficient schema processing (massie)

Modified: hadoop/avro/trunk/lang/c/Makefile.am
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/Makefile.am?rev=901421&r1=901420&r2=901421&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/Makefile.am (original)
+++ hadoop/avro/trunk/lang/c/Makefile.am Wed Jan 20 22:58:22 2010
@@ -1,8 +1,13 @@
 EXTRA_DIST=version.sh m4
 SUBDIRS = docs jansson src tests
 
+# Linux kernel source indent format options
+INDENT_OPTS=-nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 \
+-cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -nprs -npsl -sai \
+-saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8
+
 pretty:
 	@for dir in src tests; do \
-	indent $(top_srcdir)/$$dir/*.[c,h]; \
+	indent $(INDENT_OPTS) $(top_srcdir)/$$dir/*.[c,h]; \
 	mv $(top_srcdir)/$$dir/*~ /tmp; \
 	done

Modified: hadoop/avro/trunk/lang/c/src/avro.h
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/avro.h?rev=901421&r1=901420&r2=901421&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/avro.h (original)
+++ hadoop/avro/trunk/lang/c/src/avro.h Wed Jan 20 22:58:22 2010
@@ -1,67 +1,61 @@
 /*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0 
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License. 
+ */
 #ifndef AVRO_H
 #define AVRO_H
-
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
+#define CLOSE_EXTERN }
+#else
+#define CLOSE_EXTERN
 #endif
 
 #include <stdio.h>
 #include <stdint.h>
 
-  enum avro_type_t
-  {
-    AVRO_STRING,
-    AVRO_BYTES,
-    AVRO_INT,
-    AVRO_LONG,
-    AVRO_FLOAT,
-    AVRO_DOUBLE,
-    AVRO_BOOLEAN,
-    AVRO_NULL,
-    AVRO_RECORD,
-    AVRO_ENUM,
-    AVRO_FIXED,
-    AVRO_MAP,
-    AVRO_ARRAY,
-    AVRO_UNION,
-    AVRO_LINK
-  };
-  typedef enum avro_type_t avro_type_t;
-
-  enum avro_class_t
-  {
-    AVRO_SCHEMA,
-    AVRO_DATUM
-  };
-  typedef enum avro_class_t avro_class_t;
-
-  struct avro_obj_t
-  {
-    avro_type_t type;
-    avro_class_t class_type;
-    unsigned long refcount;
-  };
-
-
+enum avro_type_t {
+	AVRO_STRING,
+	AVRO_BYTES,
+	AVRO_INT,
+	AVRO_LONG,
+	AVRO_FLOAT,
+	AVRO_DOUBLE,
+	AVRO_BOOLEAN,
+	AVRO_NULL,
+	AVRO_RECORD,
+	AVRO_ENUM,
+	AVRO_FIXED,
+	AVRO_MAP,
+	AVRO_ARRAY,
+	AVRO_UNION,
+	AVRO_LINK
+};
+typedef enum avro_type_t avro_type_t;
+
+enum avro_class_t {
+	AVRO_SCHEMA,
+	AVRO_DATUM
+};
+typedef enum avro_class_t avro_class_t;
+
+struct avro_obj_t {
+	avro_type_t type;
+	avro_class_t class_type;
+	unsigned long refcount;
+};
 
 #define avro_classof(obj)     ((obj)->class_type)
 #define is_avro_schema(obj)   (obj && avro_classof(obj) == AVRO_SCHEMA)
@@ -96,124 +90,125 @@
 #define is_avro_complex_type(obj) (!(is_avro_primitive(obj))
 #define is_avro_link(obj)     (obj && avro_typeof(obj) == AVRO_LINK)
 
-  /* schema */
-  typedef struct avro_obj_t *avro_schema_t;
+/*
+ * schema 
+ */
+typedef struct avro_obj_t *avro_schema_t;
+
+avro_schema_t avro_schema_string(void);
+avro_schema_t avro_schema_bytes(void);
+avro_schema_t avro_schema_int(void);
+avro_schema_t avro_schema_long(void);
+avro_schema_t avro_schema_float(void);
+avro_schema_t avro_schema_double(void);
+avro_schema_t avro_schema_boolean(void);
+avro_schema_t avro_schema_null(void);
+
+avro_schema_t avro_schema_record(const char *name);
+avro_schema_t avro_schema_record_field_get(const avro_schema_t
+					   record, const char *field_name);
+int avro_schema_record_field_append(const avro_schema_t record,
+				    const char *field_name,
+				    const avro_schema_t type);
+
+avro_schema_t avro_schema_enum(const char *name);
+int avro_schema_enum_symbol_append(const avro_schema_t
+				   enump, const char *symbol);
+
+avro_schema_t avro_schema_fixed(const char *name, const int64_t len);
+avro_schema_t avro_schema_map(const avro_schema_t values);
+avro_schema_t avro_schema_array(const avro_schema_t items);
+
+avro_schema_t avro_schema_union(void);
+int avro_schema_union_append(const avro_schema_t
+			     union_schema, const avro_schema_t schema);
+
+avro_schema_t avro_schema_link(avro_schema_t schema);
+
+typedef struct avro_schema_error_t *avro_schema_error_t;
+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_specific(avro_schema_t schema, const char *prefix);
+
+const char *avro_schema_name(const avro_schema_t schema);
+avro_schema_t avro_schema_copy(avro_schema_t schema);
+int avro_schema_equal(avro_schema_t a, avro_schema_t b);
 
-  avro_schema_t avro_schema_string (void);
-  avro_schema_t avro_schema_bytes (void);
-  avro_schema_t avro_schema_int (void);
-  avro_schema_t avro_schema_long (void);
-  avro_schema_t avro_schema_float (void);
-  avro_schema_t avro_schema_double (void);
-  avro_schema_t avro_schema_boolean (void);
-  avro_schema_t avro_schema_null (void);
-
-  avro_schema_t avro_schema_record (const char *name);
-  avro_schema_t avro_schema_record_field_get (const avro_schema_t record,
-					      const char *field_name);
-  int avro_schema_record_field_append (const avro_schema_t record,
-				       const char *field_name,
-				       const avro_schema_t type);
-
-  avro_schema_t avro_schema_enum (const char *name);
-  int avro_schema_enum_symbol_append (const avro_schema_t enump,
-				      const char *symbol);
-
-  avro_schema_t avro_schema_fixed (const char *name, const int64_t len);
-  avro_schema_t avro_schema_map (const avro_schema_t values);
-  avro_schema_t avro_schema_array (const avro_schema_t items);
-
-  avro_schema_t avro_schema_union (void);
-  int avro_schema_union_append (const avro_schema_t union_schema,
-				const avro_schema_t schema);
-
-  avro_schema_t avro_schema_link (avro_schema_t schema);
-
-  typedef struct avro_schema_error_t *avro_schema_error_t;
-  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_specific (avro_schema_t schema, const char *prefix);
-
-  const char *avro_schema_name (const avro_schema_t schema);
-  avro_schema_t avro_schema_copy (avro_schema_t schema);
-  int avro_schema_equal (avro_schema_t a, avro_schema_t b);
-
-  void avro_schema_printf (avro_schema_t schema, FILE * fp);
-
-  /* io */
-  typedef struct avro_reader_t *avro_reader_t;
-  typedef struct avro_writer_t *avro_writer_t;
-
-  avro_reader_t avro_reader_file (FILE * fp);
-  avro_writer_t avro_writer_file (FILE * fp);
-  avro_reader_t avro_reader_memory (const char *buf, int64_t len);
-  avro_writer_t avro_writer_memory (const char *buf, int64_t len);
-
-  int avro_read (avro_reader_t reader, void *buf, int64_t len);
-  int avro_skip (avro_reader_t reader, int64_t len);
-  int avro_write (avro_writer_t writer, void *buf, int64_t len);
-  int avro_flush (avro_writer_t writer);
-
-  void avro_reader_free (avro_reader_t reader);
-  void avro_writer_free (avro_writer_t writer);
-
-  /* datum */
-  typedef struct avro_obj_t *avro_datum_t;
-  avro_datum_t avro_string (const char *str);
-  avro_datum_t avro_bytes (const char *buf, int64_t len);
-  avro_datum_t avro_int (int32_t i);
-  avro_datum_t avro_long (int64_t l);
-  avro_datum_t avro_float (float f);
-  avro_datum_t avro_double (double d);
-  avro_datum_t avro_boolean (int8_t i);
-  avro_datum_t avro_null (void);
-
-  avro_datum_t avro_record (const char *name);
-  avro_datum_t avro_record_field_get (const avro_datum_t record,
-				      const char *field_name);
-  int avro_record_field_set (const avro_datum_t record,
-			     const char *field_name,
-			     const avro_datum_t value);
-
-  avro_datum_t avro_enum (const char *name, const char *symbol);
-
-  avro_datum_t avro_fixed (const char *name, const int64_t len,
-			   const char *bytes);
-
-  avro_datum_t avro_map (void);
-  int avro_map_set (const avro_datum_t map, const char *key,
-		    const avro_datum_t value);
-
-  avro_datum_t avro_array (void);
-  int avro_array_append_datum (const avro_datum_t array_datum,
-			       const avro_datum_t datum);
-
-  avro_datum_t avro_union (void);
-  int avro_union_append (const avro_datum_t union_value,
-			 const avro_datum_t value);
-
-  avro_datum_t avro_datum_incref (avro_datum_t value);
-  void avro_datum_decref (avro_datum_t value);
-
-  void avro_datum_print (avro_datum_t value, FILE * fp);
-
-  int avro_datum_equal (avro_datum_t a, avro_datum_t b);
-
-  int avro_schema_match (avro_schema_t writers_schema,
-			 avro_schema_t readers_schema);
-
-  int avro_schema_datum_validate (avro_schema_t expected_schema,
-				  avro_datum_t datum);
-
-  int avro_read_data (avro_reader_t reader, avro_schema_t writer_schema,
-		      avro_schema_t reader_schema, avro_datum_t * datum);
-  int avro_write_data (avro_writer_t writer, avro_schema_t writer_schema,
-		       avro_datum_t datum);
+void avro_schema_printf(avro_schema_t schema, FILE * fp);
 
-#ifdef __cplusplus
-}
-#endif
+/*
+ * io 
+ */
+typedef struct avro_reader_t *avro_reader_t;
+typedef struct avro_writer_t *avro_writer_t;
+
+avro_reader_t avro_reader_file(FILE * fp);
+avro_writer_t avro_writer_file(FILE * fp);
+avro_reader_t avro_reader_memory(const char *buf, int64_t len);
+avro_writer_t avro_writer_memory(const char *buf, int64_t len);
+
+int avro_read(avro_reader_t reader, void *buf, int64_t len);
+int avro_skip(avro_reader_t reader, int64_t len);
+int avro_write(avro_writer_t writer, void *buf, int64_t len);
+int avro_flush(avro_writer_t writer);
+
+void avro_reader_free(avro_reader_t reader);
+void avro_writer_free(avro_writer_t writer);
+
+/*
+ * datum 
+ */
+typedef struct avro_obj_t *avro_datum_t;
+avro_datum_t avro_string(const char *str);
+avro_datum_t avro_bytes(const char *buf, int64_t len);
+avro_datum_t avro_int(int32_t i);
+avro_datum_t avro_long(int64_t l);
+avro_datum_t avro_float(float f);
+avro_datum_t avro_double(double d);
+avro_datum_t avro_boolean(int8_t i);
+avro_datum_t avro_null(void);
+
+avro_datum_t avro_record(const char *name);
+avro_datum_t avro_record_field_get(const avro_datum_t record,
+				   const char *field_name);
+int avro_record_field_set(const avro_datum_t record,
+			  const char *field_name, const avro_datum_t value);
+
+avro_datum_t avro_enum(const char *name, const char *symbol);
+
+avro_datum_t avro_fixed(const char *name, const int64_t len, const char *bytes);
+
+avro_datum_t avro_map(void);
+int avro_map_set(const avro_datum_t map, const char *key,
+		 const avro_datum_t value);
+
+avro_datum_t avro_array(void);
+int avro_array_append_datum(const avro_datum_t array_datum,
+			    const avro_datum_t datum);
+
+avro_datum_t avro_union(void);
+int avro_union_append(const avro_datum_t union_value, const avro_datum_t value);
+
+avro_datum_t avro_datum_incref(avro_datum_t value);
+void avro_datum_decref(avro_datum_t value);
+
+void avro_datum_print(avro_datum_t value, FILE * fp);
+
+int avro_datum_equal(avro_datum_t a, avro_datum_t b);
+
+int avro_schema_match(avro_schema_t writers_schema,
+		      avro_schema_t readers_schema);
+
+int avro_schema_datum_validate(avro_schema_t
+			       expected_schema, avro_datum_t datum);
+
+int avro_read_data(avro_reader_t reader,
+		   avro_schema_t writer_schema,
+		   avro_schema_t reader_schema, avro_datum_t * datum);
+int avro_write_data(avro_writer_t writer,
+		    avro_schema_t writer_schema, avro_datum_t datum);
 
+CLOSE_EXTERN
 #endif

Modified: hadoop/avro/trunk/lang/c/src/container_of.h
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/container_of.h?rev=901421&r1=901420&r2=901421&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/container_of.h (original)
+++ hadoop/avro/trunk/lang/c/src/container_of.h Wed Jan 20 22:58:22 2010
@@ -1,21 +1,19 @@
 /*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0 
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License. 
+ */
 #ifndef CONTAINER_OF_H
 #define CONTAINER_OF_H
 

Modified: hadoop/avro/trunk/lang/c/src/datum.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/datum.c?rev=901421&r1=901420&r2=901421&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/datum.c (original)
+++ hadoop/avro/trunk/lang/c/src/datum.c Wed Jan 20 22:58:22 2010
@@ -1,21 +1,19 @@
 /*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0 
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License. 
+ */
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
@@ -26,1182 +24,1112 @@
 #include "datum.h"
 #include "encoding.h"
 
-static void
-avro_datum_init (avro_datum_t datum, avro_type_t type)
+static void avro_datum_init(avro_datum_t datum, avro_type_t type)
 {
-  datum->type = type;
-  datum->class_type = AVRO_DATUM;
-  datum->refcount = 1;
+	datum->type = type;
+	datum->class_type = AVRO_DATUM;
+	datum->refcount = 1;
 }
 
 static int
-array_equal (struct avro_array_datum_t *a, struct avro_array_datum_t *b)
+array_equal(struct avro_array_datum_t *a, struct avro_array_datum_t *b)
 {
-  struct avro_array_element_t *a_el, *b_el;
-  if (a->num_elements != b->num_elements)
-    {
-      return 0;
-    }
-  for (a_el = STAILQ_FIRST (&a->els),
-       b_el = STAILQ_FIRST (&b->els);
-       !(a_el == NULL && a_el == NULL);
-       a_el = STAILQ_NEXT (a_el, els), b_el = STAILQ_NEXT (b_el, els))
-    {
-      if (a_el == NULL || b_el == NULL)
-	{
-	  return 0;		/* different number of elements */
-	}
-      if (!avro_datum_equal (a_el->datum, b_el->datum))
-	{
-	  return 0;
+	struct avro_array_element_t *a_el, *b_el;
+	if (a->num_elements != b->num_elements) {
+		return 0;
 	}
-    }
-  return 1;
+	for (a_el = STAILQ_FIRST(&a->els),
+	     b_el = STAILQ_FIRST(&b->els);
+	     !(a_el == NULL && a_el == NULL);
+	     a_el = STAILQ_NEXT(a_el, els), b_el = STAILQ_NEXT(b_el, els)) {
+		if (a_el == NULL || b_el == NULL) {
+			return 0;	/* different number of elements */
+		}
+		if (!avro_datum_equal(a_el->datum, b_el->datum)) {
+			return 0;
+		}
+	}
+	return 1;
 }
 
-struct map_equal_args
-{
-  int rval;
-  st_table *st;
+struct map_equal_args {
+	int rval;
+	st_table *st;
 };
 
 static int
-map_equal_foreach (char *key, avro_datum_t datum, struct map_equal_args *args)
+map_equal_foreach(char *key, avro_datum_t datum, struct map_equal_args *args)
 {
-  avro_datum_t datum_other = NULL;
+	avro_datum_t datum_other = NULL;
 
-  st_lookup (args->st, (st_data_t) key, (st_data_t *) & datum_other);
-  if (!datum_other)
-    {
-      args->rval = 0;
-      return ST_STOP;
-    }
-  if (!avro_datum_equal (datum, datum_other))
-    {
-      args->rval = 0;
-      return ST_STOP;
-    }
-  return ST_CONTINUE;
+	st_lookup(args->st, (st_data_t) key, (st_data_t *) & datum_other);
+	if (!datum_other) {
+		args->rval = 0;
+		return ST_STOP;
+	}
+	if (!avro_datum_equal(datum, datum_other)) {
+		args->rval = 0;
+		return ST_STOP;
+	}
+	return ST_CONTINUE;
 }
 
-static int
-map_equal (struct avro_map_datum_t *a, struct avro_map_datum_t *b)
+static int map_equal(struct avro_map_datum_t *a, struct avro_map_datum_t *b)
 {
-  struct map_equal_args args = { 1, avro_datum_to_map (b)->map };
-  if (a->map->num_entries != b->map->num_entries)
-    {
-      return 0;
-    }
-  st_foreach (avro_datum_to_map (a)->map,
-	      map_equal_foreach, (st_data_t) & args);
-  return args.rval;
+	struct map_equal_args args = { 1, avro_datum_to_map(b)->map };
+	if (a->map->num_entries != b->map->num_entries) {
+		return 0;
+	}
+	st_foreach(avro_datum_to_map(a)->map,
+		   map_equal_foreach, (st_data_t) & args);
+	return args.rval;
 }
 
-int
-avro_datum_equal (avro_datum_t a, avro_datum_t b)
+int avro_datum_equal(avro_datum_t a, avro_datum_t b)
 {
-  if (!(is_avro_datum (a) && is_avro_datum (b)))
-    {
-      return 0;
-    }
-  if (avro_typeof (a) != avro_typeof (b))
-    {
-      return 0;
-    }
-  switch (avro_typeof (a))
-    {
-    case AVRO_STRING:
-      return strcmp (avro_datum_to_string (a)->s,
-		     avro_datum_to_string (b)->s) == 0;
-    case AVRO_BYTES:
-      return (avro_datum_to_bytes (a)->size == avro_datum_to_bytes (b)->size)
-	&& memcmp (avro_datum_to_bytes (a)->bytes,
-		   avro_datum_to_bytes (b)->bytes,
-		   avro_datum_to_bytes (a)->size) == 0;
-    case AVRO_INT:
-      return avro_datum_to_int (a)->i == avro_datum_to_int (b)->i;
-    case AVRO_LONG:
-      return avro_datum_to_long (a)->l == avro_datum_to_long (b)->l;
-    case AVRO_FLOAT:
-      return avro_datum_to_float (a)->f == avro_datum_to_float (b)->f;
-    case AVRO_DOUBLE:
-      return avro_datum_to_double (a)->d == avro_datum_to_double (b)->d;
-    case AVRO_BOOLEAN:
-      return avro_datum_to_boolean (a)->i == avro_datum_to_boolean (b)->i;
-    case AVRO_NULL:
-      return 1;
-    case AVRO_ARRAY:
-      return array_equal (avro_datum_to_array (a), avro_datum_to_array (b));
-    case AVRO_MAP:
-      return map_equal (avro_datum_to_map (a), avro_datum_to_map (b));
-    case AVRO_RECORD:
-    case AVRO_ENUM:
-    case AVRO_FIXED:
-    case AVRO_UNION:
-    case AVRO_LINK:
-      /* TODO */
-      return 0;
-    }
-  return 0;
+	if (!(is_avro_datum(a) && is_avro_datum(b))) {
+		return 0;
+	}
+	if (avro_typeof(a) != avro_typeof(b)) {
+		return 0;
+	}
+	switch (avro_typeof(a)) {
+	case AVRO_STRING:
+		return strcmp(avro_datum_to_string(a)->s,
+			      avro_datum_to_string(b)->s) == 0;
+	case AVRO_BYTES:
+		return (avro_datum_to_bytes(a)->size ==
+			avro_datum_to_bytes(b)->size)
+		    && memcmp(avro_datum_to_bytes(a)->bytes,
+			      avro_datum_to_bytes(b)->bytes,
+			      avro_datum_to_bytes(a)->size) == 0;
+	case AVRO_INT:
+		return avro_datum_to_int(a)->i == avro_datum_to_int(b)->i;
+	case AVRO_LONG:
+		return avro_datum_to_long(a)->l == avro_datum_to_long(b)->l;
+	case AVRO_FLOAT:
+		return avro_datum_to_float(a)->f == avro_datum_to_float(b)->f;
+	case AVRO_DOUBLE:
+		return avro_datum_to_double(a)->d == avro_datum_to_double(b)->d;
+	case AVRO_BOOLEAN:
+		return avro_datum_to_boolean(a)->i ==
+		    avro_datum_to_boolean(b)->i;
+	case AVRO_NULL:
+		return 1;
+	case AVRO_ARRAY:
+		return array_equal(avro_datum_to_array(a),
+				   avro_datum_to_array(b));
+	case AVRO_MAP:
+		return map_equal(avro_datum_to_map(a), avro_datum_to_map(b));
+	case AVRO_RECORD:
+	case AVRO_ENUM:
+	case AVRO_FIXED:
+	case AVRO_UNION:
+	case AVRO_LINK:
+		/*
+		 * TODO 
+		 */
+		return 0;
+	}
+	return 0;
 }
 
-avro_datum_t
-avro_string (const char *str)
+avro_datum_t avro_string(const char *str)
 {
-  struct avro_string_datum_t *datum =
-    malloc (sizeof (struct avro_string_datum_t));
-  if (!datum)
-    {
-      return NULL;
-    }
-  datum->s = strdup (str);
+	struct avro_string_datum_t *datum =
+	    malloc(sizeof(struct avro_string_datum_t));
+	if (!datum) {
+		return NULL;
+	}
+	datum->s = strdup(str);
 
-  avro_datum_init (&datum->obj, AVRO_STRING);
-  return &datum->obj;
+	avro_datum_init(&datum->obj, AVRO_STRING);
+	return &datum->obj;
 }
 
-avro_datum_t
-avro_bytes (const char *bytes, int64_t size)
+avro_datum_t avro_bytes(const char *bytes, int64_t size)
 {
-  struct avro_bytes_datum_t *datum =
-    malloc (sizeof (struct avro_bytes_datum_t));
-  if (!datum)
-    {
-      return NULL;
-    }
-  datum->bytes = malloc (size);
-  if (!datum->bytes)
-    {
-      free (datum);
-      return NULL;
-    }
-  memcpy (datum->bytes, bytes, size);
-  datum->size = size;
+	struct avro_bytes_datum_t *datum =
+	    malloc(sizeof(struct avro_bytes_datum_t));
+	if (!datum) {
+		return NULL;
+	}
+	datum->bytes = malloc(size);
+	if (!datum->bytes) {
+		free(datum);
+		return NULL;
+	}
+	memcpy(datum->bytes, bytes, size);
+	datum->size = size;
 
-  avro_datum_init (&datum->obj, AVRO_BYTES);
-  return &datum->obj;
+	avro_datum_init(&datum->obj, AVRO_BYTES);
+	return &datum->obj;
 }
 
-avro_datum_t
-avro_int (int32_t i)
+avro_datum_t avro_int(int32_t i)
 {
-  struct avro_int_datum_t *datum = malloc (sizeof (struct avro_int_datum_t));
-  if (!datum)
-    {
-      return NULL;
-    }
-  datum->i = i;
+	struct avro_int_datum_t *datum =
+	    malloc(sizeof(struct avro_int_datum_t));
+	if (!datum) {
+		return NULL;
+	}
+	datum->i = i;
 
-  avro_datum_init (&datum->obj, AVRO_INT);
-  return &datum->obj;
+	avro_datum_init(&datum->obj, AVRO_INT);
+	return &datum->obj;
 }
 
-avro_datum_t
-avro_long (int64_t l)
+avro_datum_t avro_long(int64_t l)
 {
-  struct avro_long_datum_t *datum =
-    malloc (sizeof (struct avro_long_datum_t));
-  if (!datum)
-    {
-      return NULL;
-    }
-  datum->l = l;
+	struct avro_long_datum_t *datum =
+	    malloc(sizeof(struct avro_long_datum_t));
+	if (!datum) {
+		return NULL;
+	}
+	datum->l = l;
 
-  avro_datum_init (&datum->obj, AVRO_LONG);
-  return &datum->obj;
+	avro_datum_init(&datum->obj, AVRO_LONG);
+	return &datum->obj;
 }
 
-avro_datum_t
-avro_float (float f)
+avro_datum_t avro_float(float f)
 {
-  struct avro_float_datum_t *datum =
-    malloc (sizeof (struct avro_float_datum_t));
-  if (!datum)
-    {
-      return NULL;
-    }
-  datum->f = f;
+	struct avro_float_datum_t *datum =
+	    malloc(sizeof(struct avro_float_datum_t));
+	if (!datum) {
+		return NULL;
+	}
+	datum->f = f;
 
-  avro_datum_init (&datum->obj, AVRO_FLOAT);
-  return &datum->obj;
+	avro_datum_init(&datum->obj, AVRO_FLOAT);
+	return &datum->obj;
 }
 
-avro_datum_t
-avro_double (double d)
+avro_datum_t avro_double(double d)
 {
-  struct avro_double_datum_t *datum =
-    malloc (sizeof (struct avro_double_datum_t));
-  if (!datum)
-    {
-      return NULL;
-    }
-  datum->d = d;
+	struct avro_double_datum_t *datum =
+	    malloc(sizeof(struct avro_double_datum_t));
+	if (!datum) {
+		return NULL;
+	}
+	datum->d = d;
 
-  avro_datum_init (&datum->obj, AVRO_DOUBLE);
-  return &datum->obj;
+	avro_datum_init(&datum->obj, AVRO_DOUBLE);
+	return &datum->obj;
 }
 
-avro_datum_t
-avro_boolean (int8_t i)
+avro_datum_t avro_boolean(int8_t i)
 {
-  struct avro_boolean_datum_t *datum =
-    malloc (sizeof (struct avro_boolean_datum_t));
-  if (!datum)
-    {
-      return NULL;
-    }
-  datum->i = i;
-  avro_datum_init (&datum->obj, AVRO_BOOLEAN);
-  return &datum->obj;
+	struct avro_boolean_datum_t *datum =
+	    malloc(sizeof(struct avro_boolean_datum_t));
+	if (!datum) {
+		return NULL;
+	}
+	datum->i = i;
+	avro_datum_init(&datum->obj, AVRO_BOOLEAN);
+	return &datum->obj;
 }
 
-avro_datum_t
-avro_null (void)
+avro_datum_t avro_null(void)
 {
-  static struct avro_obj_t obj = {
-    .type = AVRO_NULL,
-    .class_type = AVRO_DATUM,
-    .refcount = 1
-  };
-  return &obj;
+	static struct avro_obj_t obj = {
+		.type = AVRO_NULL,
+		.class_type = AVRO_DATUM,
+		.refcount = 1
+	};
+	return &obj;
 }
 
-avro_datum_t
-avro_record (const char *name)
+avro_datum_t avro_record(const char *name)
 {
-  struct avro_record_datum_t *datum =
-    malloc (sizeof (struct avro_record_datum_t));
-  if (!datum)
-    {
-      return NULL;
-    }
-  datum->name = strdup (name);
-  datum->fields = st_init_strtable ();
+	struct avro_record_datum_t *datum =
+	    malloc(sizeof(struct avro_record_datum_t));
+	if (!datum) {
+		return NULL;
+	}
+	datum->name = strdup(name);
+	datum->fields = st_init_strtable();
 
-  avro_datum_init (&datum->obj, AVRO_RECORD);
-  return &datum->obj;
+	avro_datum_init(&datum->obj, AVRO_RECORD);
+	return &datum->obj;
 }
 
 avro_datum_t
-avro_record_field_get (const avro_datum_t datum, const char *field_name)
+avro_record_field_get(const avro_datum_t datum, const char *field_name)
 {
-  struct avro_record_datum_t *field = NULL;
-  if (is_avro_datum (datum) && is_avro_record (datum))
-    {
-      struct avro_record_datum_t *record = avro_datum_to_record (datum);
-      st_lookup (record->fields, (st_data_t) field_name,
-		 (st_data_t *) & field);
-    }
-  return &field->obj;
+	struct avro_record_datum_t *field = NULL;
+	if (is_avro_datum(datum) && is_avro_record(datum)) {
+		struct avro_record_datum_t *record =
+		    avro_datum_to_record(datum);
+		st_lookup(record->fields, (st_data_t) field_name,
+			  (st_data_t *) & field);
+	}
+	return &field->obj;
 }
 
 int
-avro_record_field_set (const avro_datum_t datum,
-		       const char *field_name, const avro_datum_t field_value)
+avro_record_field_set(const avro_datum_t datum,
+		      const char *field_name, const avro_datum_t field_value)
 {
-  if (is_avro_datum (datum) && is_avro_record (datum))
-    {
-      struct avro_record_datum_t *record = avro_datum_to_record (datum);
-      st_insert (record->fields, (st_data_t) field_name,
-		 (st_data_t) field_value);
-      return 0;
-    }
-  return EINVAL;
+	if (is_avro_datum(datum) && is_avro_record(datum)) {
+		struct avro_record_datum_t *record =
+		    avro_datum_to_record(datum);
+		st_insert(record->fields, (st_data_t) field_name,
+			  (st_data_t) field_value);
+		return 0;
+	}
+	return EINVAL;
 }
 
-avro_datum_t
-avro_enum (const char *name, const char *symbol)
+avro_datum_t avro_enum(const char *name, const char *symbol)
 {
-  struct avro_enum_datum_t *datum =
-    malloc (sizeof (struct avro_enum_datum_t));
-  if (!datum)
-    {
-      return NULL;
-    }
-  datum->name = strdup (name);
-  datum->symbol = strdup (symbol);
+	struct avro_enum_datum_t *datum =
+	    malloc(sizeof(struct avro_enum_datum_t));
+	if (!datum) {
+		return NULL;
+	}
+	datum->name = strdup(name);
+	datum->symbol = strdup(symbol);
 
-  avro_datum_init (&datum->obj, AVRO_ENUM);
-  return &datum->obj;
+	avro_datum_init(&datum->obj, AVRO_ENUM);
+	return &datum->obj;
 }
 
-avro_datum_t
-avro_fixed (const char *name, const int64_t size, const char *bytes)
+avro_datum_t avro_fixed(const char *name, const int64_t size, const char *bytes)
 {
-  struct avro_fixed_datum_t *datum =
-    malloc (sizeof (struct avro_fixed_datum_t));
-  if (!datum)
-    {
-      return NULL;
-    }
-  datum->name = strdup (name);
-  datum->size = size;
-  datum->bytes = malloc (size);
-  if (datum->bytes)
-    {
-      free (datum);
-      return NULL;
-    }
-  memcpy (datum->bytes, bytes, size);
-  avro_datum_init (&datum->obj, AVRO_FIXED);
-  return &datum->obj;
+	struct avro_fixed_datum_t *datum =
+	    malloc(sizeof(struct avro_fixed_datum_t));
+	if (!datum) {
+		return NULL;
+	}
+	datum->name = strdup(name);
+	datum->size = size;
+	datum->bytes = malloc(size);
+	if (datum->bytes) {
+		free(datum);
+		return NULL;
+	}
+	memcpy(datum->bytes, bytes, size);
+	avro_datum_init(&datum->obj, AVRO_FIXED);
+	return &datum->obj;
 }
 
-avro_datum_t
-avro_map (void)
+avro_datum_t avro_map(void)
 {
-  struct avro_map_datum_t *datum = malloc (sizeof (struct avro_map_datum_t));
-  if (!datum)
-    {
-      return NULL;
-    }
-  datum->map = st_init_strtable ();
-  avro_datum_init (&datum->obj, AVRO_MAP);
-  return &datum->obj;
+	struct avro_map_datum_t *datum =
+	    malloc(sizeof(struct avro_map_datum_t));
+	if (!datum) {
+		return NULL;
+	}
+	datum->map = st_init_strtable();
+	avro_datum_init(&datum->obj, AVRO_MAP);
+	return &datum->obj;
 }
 
 int
-avro_map_set (const avro_datum_t datum, const char *key,
-	      const avro_datum_t value)
+avro_map_set(const avro_datum_t datum, const char *key,
+	     const avro_datum_t value)
 {
-  struct avro_map_datum_t *map;
-  if (!is_avro_datum (datum) || !is_avro_map (datum) || !key
-      || !is_avro_datum (value))
-    {
-      return EINVAL;
-    }
-  map = avro_datum_to_map (datum);
-  st_insert (map->map, (st_data_t) key, (st_data_t) value);
-  return 0;
+	struct avro_map_datum_t *map;
+	if (!is_avro_datum(datum) || !is_avro_map(datum) || !key
+	    || !is_avro_datum(value)) {
+		return EINVAL;
+	}
+	map = avro_datum_to_map(datum);
+	st_insert(map->map, (st_data_t) key, (st_data_t) value);
+	return 0;
 }
 
-avro_datum_t
-avro_array (void)
+avro_datum_t avro_array(void)
 {
-  struct avro_array_datum_t *datum =
-    malloc (sizeof (struct avro_array_datum_t));
-  if (!datum)
-    {
-      return NULL;
-    }
-  STAILQ_INIT (&datum->els);
-  datum->num_elements = 0;
+	struct avro_array_datum_t *datum =
+	    malloc(sizeof(struct avro_array_datum_t));
+	if (!datum) {
+		return NULL;
+	}
+	STAILQ_INIT(&datum->els);
+	datum->num_elements = 0;
 
-  avro_datum_init (&datum->obj, AVRO_ARRAY);
-  return &datum->obj;
+	avro_datum_init(&datum->obj, AVRO_ARRAY);
+	return &datum->obj;
 }
 
 int
-avro_array_append_datum (const avro_datum_t array_datum,
-			 const avro_datum_t datum)
+avro_array_append_datum(const avro_datum_t array_datum,
+			const avro_datum_t datum)
 {
-  struct avro_array_datum_t *array;
-  struct avro_array_element_t *el;
-  if (!is_avro_datum (array_datum) || !is_avro_array (array_datum)
-      || !is_avro_datum (datum))
-    {
-      return EINVAL;
-    }
-  array = avro_datum_to_array (array_datum);
-  el = malloc (sizeof (struct avro_array_element_t));
-  if (!el)
-    {
-      return ENOMEM;
-    }
-  el->datum = datum;
-  STAILQ_INSERT_TAIL (&array->els, el, els);
-  array->num_elements++;
-  return 0;
+	struct avro_array_datum_t *array;
+	struct avro_array_element_t *el;
+	if (!is_avro_datum(array_datum) || !is_avro_array(array_datum)
+	    || !is_avro_datum(datum)) {
+		return EINVAL;
+	}
+	array = avro_datum_to_array(array_datum);
+	el = malloc(sizeof(struct avro_array_element_t));
+	if (!el) {
+		return ENOMEM;
+	}
+	el->datum = datum;
+	STAILQ_INSERT_TAIL(&array->els, el, els);
+	array->num_elements++;
+	return 0;
 }
 
-
-avro_datum_t
-avro_datum_incref (avro_datum_t value)
+avro_datum_t avro_datum_incref(avro_datum_t value)
 {
-  /* TODO */
-  return value;
+	/*
+	 * TODO 
+	 */
+	return value;
 }
 
-void
-avro_datum_decref (avro_datum_t value)
+void avro_datum_decref(avro_datum_t value)
 {
 
 }
 
-void
-avro_datum_print (avro_datum_t value, FILE * fp)
+void avro_datum_print(avro_datum_t value, FILE * fp)
 {
 
 }
 
 int
-avro_schema_match (avro_schema_t writers_schema, avro_schema_t readers_schema)
+avro_schema_match(avro_schema_t writers_schema, avro_schema_t readers_schema)
 {
-  if (!is_avro_schema (writers_schema) || !is_avro_schema (readers_schema))
-    {
-      return 0;
-    }
-
-  switch (avro_typeof (writers_schema))
-    {
-    case AVRO_UNION:
-      return 1;
-
-    case AVRO_INT:
-      return is_avro_int (readers_schema) || is_avro_long (readers_schema)
-	|| is_avro_float (readers_schema) || is_avro_double (readers_schema);
-
-    case AVRO_LONG:
-      return is_avro_long (readers_schema) || is_avro_float (readers_schema)
-	|| is_avro_double (readers_schema);
-
-    case AVRO_FLOAT:
-      return is_avro_float (readers_schema)
-	|| is_avro_double (readers_schema);
-
-    case AVRO_STRING:
-    case AVRO_BYTES:
-    case AVRO_DOUBLE:
-    case AVRO_BOOLEAN:
-    case AVRO_NULL:
-      return avro_typeof (writers_schema) == avro_typeof (readers_schema);
-
-    case AVRO_RECORD:
-      return is_avro_record (readers_schema)
-	&& strcmp (avro_schema_name (writers_schema),
-		   avro_schema_name (readers_schema)) == 0;
-
-    case AVRO_FIXED:
-      return is_avro_fixed (readers_schema)
-	&& strcmp (avro_schema_name (writers_schema),
-		   avro_schema_name (readers_schema)) == 0
-	&& (avro_schema_to_fixed (writers_schema))->size ==
-	(avro_schema_to_fixed (readers_schema))->size;
-
-    case AVRO_ENUM:
-      return is_avro_enum (readers_schema)
-	&& strcmp (avro_schema_to_enum (writers_schema)->name,
-		   avro_schema_to_enum (readers_schema)->name) == 0;
-
-    case AVRO_MAP:
-      return is_avro_map (readers_schema)
-	&& avro_typeof (avro_schema_to_map (writers_schema)->values)
-	== avro_typeof (avro_schema_to_map (readers_schema)->values);
-
-    case AVRO_ARRAY:
-      return is_avro_array (readers_schema)
-	&& avro_typeof (avro_schema_to_array (writers_schema)->items)
-	== avro_typeof (avro_schema_to_array (readers_schema)->items);
-
-    case AVRO_LINK:
-      /* TODO */
-      break;
-    }
+	if (!is_avro_schema(writers_schema) || !is_avro_schema(readers_schema)) {
+		return 0;
+	}
 
-  return 0;
+	switch (avro_typeof(writers_schema)) {
+	case AVRO_UNION:
+		return 1;
+
+	case AVRO_INT:
+		return is_avro_int(readers_schema)
+		    || is_avro_long(readers_schema)
+		    || is_avro_float(readers_schema)
+		    || is_avro_double(readers_schema);
+
+	case AVRO_LONG:
+		return is_avro_long(readers_schema)
+		    || is_avro_float(readers_schema)
+		    || is_avro_double(readers_schema);
+
+	case AVRO_FLOAT:
+		return is_avro_float(readers_schema)
+		    || is_avro_double(readers_schema);
+
+	case AVRO_STRING:
+	case AVRO_BYTES:
+	case AVRO_DOUBLE:
+	case AVRO_BOOLEAN:
+	case AVRO_NULL:
+		return avro_typeof(writers_schema) ==
+		    avro_typeof(readers_schema);
+
+	case AVRO_RECORD:
+		return is_avro_record(readers_schema)
+		    && strcmp(avro_schema_name(writers_schema),
+			      avro_schema_name(readers_schema)) == 0;
+
+	case AVRO_FIXED:
+		return is_avro_fixed(readers_schema)
+		    && strcmp(avro_schema_name(writers_schema),
+			      avro_schema_name(readers_schema)) == 0
+		    && (avro_schema_to_fixed(writers_schema))->size ==
+		    (avro_schema_to_fixed(readers_schema))->size;
+
+	case AVRO_ENUM:
+		return is_avro_enum(readers_schema)
+		    && strcmp(avro_schema_to_enum(writers_schema)->name,
+			      avro_schema_to_enum(readers_schema)->name) == 0;
+
+	case AVRO_MAP:
+		return is_avro_map(readers_schema)
+		    && avro_typeof(avro_schema_to_map(writers_schema)->values)
+		    == avro_typeof(avro_schema_to_map(readers_schema)->values);
+
+	case AVRO_ARRAY:
+		return is_avro_array(readers_schema)
+		    && avro_typeof(avro_schema_to_array(writers_schema)->items)
+		    == avro_typeof(avro_schema_to_array(readers_schema)->items);
+
+	case AVRO_LINK:
+		/*
+		 * TODO 
+		 */
+		break;
+	}
+
+	return 0;
 }
 
 static int
-read_fixed (avro_reader_t reader, const avro_encoding_t * enc,
-	    avro_schema_t writers_schema, avro_schema_t readers_schema,
-	    avro_datum_t * datum)
+read_fixed(avro_reader_t reader, const avro_encoding_t * enc,
+	   avro_schema_t writers_schema, avro_schema_t readers_schema,
+	   avro_datum_t * datum)
 {
-  return 1;
+	return 1;
 }
 
 static int
-read_enum (avro_reader_t reader, const avro_encoding_t * enc,
-	   avro_schema_t writers_schema, avro_schema_t readers_schema,
-	   avro_datum_t * datum)
+read_enum(avro_reader_t reader, const avro_encoding_t * enc,
+	  avro_schema_t writers_schema, avro_schema_t readers_schema,
+	  avro_datum_t * datum)
 {
-  return 1;
+	return 1;
 }
 
 static int
-read_array (avro_reader_t reader, const avro_encoding_t * enc,
-	    struct avro_array_schema_t *writers_schema,
-	    struct avro_array_schema_t *readers_schema, avro_datum_t * datum)
-{
-  int rval;
-  int64_t i;
-  int64_t block_count;
-  int64_t block_size;
-  avro_datum_t array_datum;
-
-  rval = enc->read_long (reader, &block_count);
-  if (rval)
-    {
-      return rval;
-    }
-
-  array_datum = avro_array ();
-  while (block_count != 0)
-    {
-      if (block_count < 0)
-	{
-	  block_count = block_count * -1;
-	  rval = enc->read_long (reader, &block_size);
-	  if (rval)
-	    {
-	      return rval;
-	    }
-	}
-
-      for (i = 0; i < block_count; i++)
-	{
-	  avro_datum_t datum;
-
-	  rval =
-	    avro_read_data (reader, writers_schema->items,
-			    readers_schema->items, &datum);
-	  if (rval)
-	    {
-	      return rval;
-	    }
-	  rval = avro_array_append_datum (array_datum, datum);
-	  if (rval)
-	    {
-	      avro_datum_decref (array_datum);
-	      return rval;
-	    }
-	}
-
-      rval = enc->read_long (reader, &block_count);
-      if (rval)
-	{
-	  return rval;
-	}
-    }
-  *datum = array_datum;
-  return 0;
+read_array(avro_reader_t reader, const avro_encoding_t * enc,
+	   struct avro_array_schema_t *writers_schema,
+	   struct avro_array_schema_t *readers_schema, avro_datum_t * datum)
+{
+	int rval;
+	int64_t i;
+	int64_t block_count;
+	int64_t block_size;
+	avro_datum_t array_datum;
+
+	rval = enc->read_long(reader, &block_count);
+	if (rval) {
+		return rval;
+	}
+
+	array_datum = avro_array();
+	while (block_count != 0) {
+		if (block_count < 0) {
+			block_count = block_count * -1;
+			rval = enc->read_long(reader, &block_size);
+			if (rval) {
+				return rval;
+			}
+		}
+
+		for (i = 0; i < block_count; i++) {
+			avro_datum_t datum;
+
+			rval =
+			    avro_read_data(reader, writers_schema->items,
+					   readers_schema->items, &datum);
+			if (rval) {
+				return rval;
+			}
+			rval = avro_array_append_datum(array_datum, datum);
+			if (rval) {
+				avro_datum_decref(array_datum);
+				return rval;
+			}
+		}
+
+		rval = enc->read_long(reader, &block_count);
+		if (rval) {
+			return rval;
+		}
+	}
+	*datum = array_datum;
+	return 0;
 }
 
 static int
-read_map (avro_reader_t reader, const avro_encoding_t * enc,
-	  struct avro_map_schema_t *writers_schema,
-	  struct avro_map_schema_t *readers_schema, avro_datum_t * datum)
-{
-  int rval;
-  int64_t i, block_count;
-  avro_datum_t map = avro_map ();
-
-  rval = enc->read_long (reader, &block_count);
-  if (rval)
-    {
-      return rval;
-    }
-  while (block_count != 0)
-    {
-      int64_t block_size;
-      if (block_count < 0)
-	{
-	  block_count = block_count * -1;
-	  rval = enc->read_long (reader, &block_size);
-	  if (rval)
-	    {
-	      return rval;
-	    }
-	}
-      for (i = 0; i < block_count; i++)
-	{
-	  char *key;
-	  avro_datum_t value;
-	  rval = enc->read_string (reader, &key);
-	  if (rval)
-	    {
-	      return rval;
-	    }
-	  rval =
-	    avro_read_data (reader,
-			    avro_schema_to_map (writers_schema)->values,
-			    avro_schema_to_map (readers_schema)->values,
-			    &value);
-	  if (rval)
-	    {
-	      return rval;
-	    }
-	  rval = avro_map_set (map, key, value);
-	  if (rval)
-	    {
-	      return rval;
-	    }
-	}
-      rval = enc->read_long (reader, &block_count);
-      if (rval)
-	{
-	  return rval;
-	}
-    }
-  *datum = map;
-  return 0;
+read_map(avro_reader_t reader, const avro_encoding_t * enc,
+	 struct avro_map_schema_t *writers_schema,
+	 struct avro_map_schema_t *readers_schema, avro_datum_t * datum)
+{
+	int rval;
+	int64_t i, block_count;
+	avro_datum_t map = avro_map();
+
+	rval = enc->read_long(reader, &block_count);
+	if (rval) {
+		return rval;
+	}
+	while (block_count != 0) {
+		int64_t block_size;
+		if (block_count < 0) {
+			block_count = block_count * -1;
+			rval = enc->read_long(reader, &block_size);
+			if (rval) {
+				return rval;
+			}
+		}
+		for (i = 0; i < block_count; i++) {
+			char *key;
+			avro_datum_t value;
+			rval = enc->read_string(reader, &key);
+			if (rval) {
+				return rval;
+			}
+			rval =
+			    avro_read_data(reader,
+					   avro_schema_to_map(writers_schema)->
+					   values,
+					   avro_schema_to_map(readers_schema)->
+					   values, &value);
+			if (rval) {
+				return rval;
+			}
+			rval = avro_map_set(map, key, value);
+			if (rval) {
+				return rval;
+			}
+		}
+		rval = enc->read_long(reader, &block_count);
+		if (rval) {
+			return rval;
+		}
+	}
+	*datum = map;
+	return 0;
 }
 
 static int
-read_union (avro_reader_t reader, const avro_encoding_t * enc,
-	    avro_schema_t writers_schema, avro_schema_t readers_schema,
-	    avro_datum_t * datum)
+read_union(avro_reader_t reader, const avro_encoding_t * enc,
+	   avro_schema_t writers_schema, avro_schema_t readers_schema,
+	   avro_datum_t * datum)
 {
-  return 1;
+	return 1;
 }
 
 static int
-read_record (avro_reader_t reader, const avro_encoding_t * enc,
-	     avro_schema_t writers_schema, avro_schema_t readers_schema,
-	     avro_datum_t * datum)
+read_record(avro_reader_t reader, const avro_encoding_t * enc,
+	    avro_schema_t writers_schema, avro_schema_t readers_schema,
+	    avro_datum_t * datum)
 {
-  return 1;
+	return 1;
 }
 
 int
-avro_read_data (avro_reader_t reader, avro_schema_t writers_schema,
-		avro_schema_t readers_schema, avro_datum_t * datum)
+avro_read_data(avro_reader_t reader, avro_schema_t writers_schema,
+	       avro_schema_t readers_schema, avro_datum_t * datum)
 {
-  int rval = EINVAL;
-  const avro_encoding_t *enc = &avro_binary_encoding;
+	int rval = EINVAL;
+	const avro_encoding_t *enc = &avro_binary_encoding;
+
+	if (!reader || !is_avro_schema(writers_schema) || !datum) {
+		return EINVAL;
+	}
+
+	if (readers_schema == NULL) {
+		readers_schema = writers_schema;
+	} else if (!avro_schema_match(writers_schema, readers_schema)) {
+		return EINVAL;
+	}
+
+	/*
+	 * schema resolution 
+	 */
+	if (!is_avro_union(writers_schema) && is_avro_union(readers_schema)) {
+		struct avro_union_branch_t *branch;
+		struct avro_union_schema_t *union_schema =
+		    avro_schema_to_union(readers_schema);
+
+		for (branch = STAILQ_FIRST(&union_schema->branches);
+		     branch != NULL; branch = STAILQ_NEXT(branch, branches)) {
+			if (avro_schema_match(writers_schema, branch->schema)) {
+				return avro_read_data(reader, writers_schema,
+						      branch->schema, datum);
+			}
+		}
+		return EINVAL;
+	}
+
+	switch (avro_typeof(writers_schema)) {
+	case AVRO_NULL:
+		rval = enc->read_null(reader);
+		*datum = avro_null();
+		break;
+
+	case AVRO_BOOLEAN:
+		{
+			int8_t b;
+			rval = enc->read_boolean(reader, &b);
+			*datum = avro_boolean(b);
+		}
+		break;
+
+	case AVRO_STRING:
+		{
+			char *s;
+			rval = enc->read_string(reader, &s);
+			*datum = avro_string(s);
+		}
+		break;
+
+	case AVRO_INT:
+		{
+			int32_t i;
+			rval = enc->read_int(reader, &i);
+			*datum = avro_int(i);
+		}
+		break;
 
-  if (!reader || !is_avro_schema (writers_schema) || !datum)
-    {
-      return EINVAL;
-    }
-
-  if (readers_schema == NULL)
-    {
-      readers_schema = writers_schema;
-    }
-  else if (!avro_schema_match (writers_schema, readers_schema))
-    {
-      return EINVAL;
-    }
-
-  /* schema resolution */
-  if (!is_avro_union (writers_schema) && is_avro_union (readers_schema))
-    {
-      struct avro_union_branch_t *branch;
-      struct avro_union_schema_t *union_schema =
-	avro_schema_to_union (readers_schema);
-
-      for (branch = STAILQ_FIRST (&union_schema->branches);
-	   branch != NULL; branch = STAILQ_NEXT (branch, branches))
-	{
-	  if (avro_schema_match (writers_schema, branch->schema))
-	    {
-	      return avro_read_data (reader, writers_schema, branch->schema,
-				     datum);
-	    }
-	}
-      return EINVAL;
-    }
-
-  switch (avro_typeof (writers_schema))
-    {
-    case AVRO_NULL:
-      rval = enc->read_null (reader);
-      *datum = avro_null ();
-      break;
-
-    case AVRO_BOOLEAN:
-      {
-	int8_t b;
-	rval = enc->read_boolean (reader, &b);
-	*datum = avro_boolean (b);
-      }
-      break;
-
-    case AVRO_STRING:
-      {
-	char *s;
-	rval = enc->read_string (reader, &s);
-	*datum = avro_string (s);
-      }
-      break;
-
-    case AVRO_INT:
-      {
-	int32_t i;
-	rval = enc->read_int (reader, &i);
-	*datum = avro_int (i);
-      }
-      break;
-
-    case AVRO_LONG:
-      {
-	int64_t l;
-	rval = enc->read_long (reader, &l);
-	*datum = avro_long (l);
-      }
-      break;
-
-    case AVRO_FLOAT:
-      {
-	float f;
-	rval = enc->read_float (reader, &f);
-	*datum = avro_float (f);
-      }
-      break;
-
-    case AVRO_DOUBLE:
-      {
-	double d;
-	rval = enc->read_double (reader, &d);
-	*datum = avro_double (d);
-      }
-      break;
-
-    case AVRO_BYTES:
-      {
-	char *bytes;
-	int64_t len;
-	rval = enc->read_bytes (reader, &bytes, &len);
-	*datum = avro_bytes (bytes, len);
-      }
-      break;
-
-    case AVRO_FIXED:
-      rval = read_fixed (reader, enc, writers_schema, readers_schema, datum);
-      break;
-
-    case AVRO_ENUM:
-      rval = read_enum (reader, enc, writers_schema, readers_schema, datum);
-      break;
-
-    case AVRO_ARRAY:
-      rval =
-	read_array (reader, enc, avro_schema_to_array (writers_schema),
-		    avro_schema_to_array (readers_schema), datum);
-      break;
-
-    case AVRO_MAP:
-      rval =
-	read_map (reader, enc, avro_schema_to_map (writers_schema),
-		  avro_schema_to_map (readers_schema), datum);
-      break;
-
-    case AVRO_UNION:
-      rval = read_union (reader, enc, writers_schema, readers_schema, datum);
-      break;
-
-    case AVRO_RECORD:
-      rval = read_record (reader, enc, writers_schema, readers_schema, datum);
-      break;
-
-    case AVRO_LINK:
-      rval =
-	avro_read_data (reader, (avro_schema_to_link (writers_schema))->to,
-			readers_schema, datum);
-      break;
-    }
+	case AVRO_LONG:
+		{
+			int64_t l;
+			rval = enc->read_long(reader, &l);
+			*datum = avro_long(l);
+		}
+		break;
+
+	case AVRO_FLOAT:
+		{
+			float f;
+			rval = enc->read_float(reader, &f);
+			*datum = avro_float(f);
+		}
+		break;
+
+	case AVRO_DOUBLE:
+		{
+			double d;
+			rval = enc->read_double(reader, &d);
+			*datum = avro_double(d);
+		}
+		break;
+
+	case AVRO_BYTES:
+		{
+			char *bytes;
+			int64_t len;
+			rval = enc->read_bytes(reader, &bytes, &len);
+			*datum = avro_bytes(bytes, len);
+		}
+		break;
+
+	case AVRO_FIXED:
+		rval =
+		    read_fixed(reader, enc, writers_schema, readers_schema,
+			       datum);
+		break;
+
+	case AVRO_ENUM:
+		rval =
+		    read_enum(reader, enc, writers_schema, readers_schema,
+			      datum);
+		break;
+
+	case AVRO_ARRAY:
+		rval =
+		    read_array(reader, enc,
+			       avro_schema_to_array(writers_schema),
+			       avro_schema_to_array(readers_schema), datum);
+		break;
+
+	case AVRO_MAP:
+		rval =
+		    read_map(reader, enc, avro_schema_to_map(writers_schema),
+			     avro_schema_to_map(readers_schema), datum);
+		break;
+
+	case AVRO_UNION:
+		rval =
+		    read_union(reader, enc, writers_schema, readers_schema,
+			       datum);
+		break;
+
+	case AVRO_RECORD:
+		rval =
+		    read_record(reader, enc, writers_schema, readers_schema,
+				datum);
+		break;
+
+	case AVRO_LINK:
+		rval =
+		    avro_read_data(reader,
+				   (avro_schema_to_link(writers_schema))->to,
+				   readers_schema, datum);
+		break;
+	}
 
-  return rval;
+	return rval;
 }
 
-struct validate_st
-{
-  avro_schema_t expected_schema;
-  int rval;
+struct validate_st {
+	avro_schema_t expected_schema;
+	int rval;
 };
 
 static int
-schema_map_validate_foreach (char *key, avro_datum_t datum,
-			     struct validate_st *vst)
+schema_map_validate_foreach(char *key, avro_datum_t datum,
+			    struct validate_st *vst)
 {
-  if (!avro_schema_datum_validate (vst->expected_schema, datum))
-    {
-      vst->rval = 0;
-      return ST_STOP;
-    }
-  return ST_CONTINUE;
+	if (!avro_schema_datum_validate(vst->expected_schema, datum)) {
+		vst->rval = 0;
+		return ST_STOP;
+	}
+	return ST_CONTINUE;
 }
 
 int
-avro_schema_datum_validate (avro_schema_t expected_schema, avro_datum_t datum)
+avro_schema_datum_validate(avro_schema_t expected_schema, avro_datum_t datum)
 {
-  if (!is_avro_schema (expected_schema) || !is_avro_datum (datum))
-    {
-      return EINVAL;
-    }
-
-  switch (avro_typeof (expected_schema))
-    {
-    case AVRO_NULL:
-      return is_avro_null (datum);
-
-    case AVRO_BOOLEAN:
-      return is_avro_boolean (datum);
-
-    case AVRO_STRING:
-      return is_avro_string (datum);
-
-    case AVRO_BYTES:
-      return is_avro_bytes (datum);
-
-    case AVRO_INT:
-      return is_avro_int (datum)
-	|| (is_avro_long (datum)
-	    && (INT_MIN <= avro_datum_to_long (datum)->l
-		&& avro_datum_to_long (datum)->l <= INT_MAX));
-
-    case AVRO_LONG:
-      return is_avro_int (datum) || is_avro_long (datum);
-
-    case AVRO_FLOAT:
-      return is_avro_int (datum) || is_avro_long (datum)
-	|| is_avro_float (datum);
-
-    case AVRO_DOUBLE:
-      return is_avro_int (datum) || is_avro_long (datum)
-	|| is_avro_float (datum) || is_avro_double (datum);
-
-    case AVRO_FIXED:
-      return (is_avro_fixed (datum)
-	      && (avro_schema_to_fixed (expected_schema)->size ==
-		  avro_datum_to_fixed (datum)->size));
-
-    case AVRO_ENUM:
-      {
-	struct avro_enum_schema_t *enump =
-	  avro_schema_to_enum (expected_schema);
-	struct avro_enum_symbol_t *symbol = STAILQ_FIRST (&enump->symbols);
-	while (symbol)
-	  {
-	    if (!strcmp (symbol->symbol, avro_datum_to_enum (datum)->symbol))
-	      {
-		return 1;
-	      }
-	    symbol = STAILQ_NEXT (symbol, symbols);
-	  }
-	return 0;
-      }
-      break;
+	if (!is_avro_schema(expected_schema) || !is_avro_datum(datum)) {
+		return EINVAL;
+	}
 
-    case AVRO_ARRAY:
-      {
-	if (is_avro_array (datum))
-	  {
-	    struct avro_array_datum_t *array = avro_datum_to_array (datum);
-	    struct avro_array_element_t *el = STAILQ_FIRST (&array->els);
-	    while (el)
-	      {
-		if (!avro_schema_datum_validate
-		    ((avro_schema_to_array (expected_schema))->items,
-		     el->datum))
-		  {
-		    return 0;
-		  }
-		el = STAILQ_NEXT (el, els);
-	      }
-	    return 1;
-	  }
-	return 0;
-      }
-      break;
+	switch (avro_typeof(expected_schema)) {
+	case AVRO_NULL:
+		return is_avro_null(datum);
+
+	case AVRO_BOOLEAN:
+		return is_avro_boolean(datum);
+
+	case AVRO_STRING:
+		return is_avro_string(datum);
+
+	case AVRO_BYTES:
+		return is_avro_bytes(datum);
+
+	case AVRO_INT:
+		return is_avro_int(datum)
+		    || (is_avro_long(datum)
+			&& (INT_MIN <= avro_datum_to_long(datum)->l
+			    && avro_datum_to_long(datum)->l <= INT_MAX));
+
+	case AVRO_LONG:
+		return is_avro_int(datum) || is_avro_long(datum);
+
+	case AVRO_FLOAT:
+		return is_avro_int(datum) || is_avro_long(datum)
+		    || is_avro_float(datum);
+
+	case AVRO_DOUBLE:
+		return is_avro_int(datum) || is_avro_long(datum)
+		    || is_avro_float(datum) || is_avro_double(datum);
+
+	case AVRO_FIXED:
+		return (is_avro_fixed(datum)
+			&& (avro_schema_to_fixed(expected_schema)->size ==
+			    avro_datum_to_fixed(datum)->size));
 
-    case AVRO_MAP:
-      if (is_avro_map (datum))
-	{
-	  struct validate_st vst =
-	    { avro_schema_to_map (expected_schema)->values, 1 };
-	  st_foreach (avro_datum_to_map (datum)->map,
-		      schema_map_validate_foreach, (st_data_t) & vst);
-	  return vst.rval;
-	}
-      break;
-
-    case AVRO_UNION:
-      {
-	struct avro_union_schema_t *union_schema =
-	  avro_schema_to_union (expected_schema);
-	struct avro_union_branch_t *branch;
-
-	for (branch = STAILQ_FIRST (&union_schema->branches);
-	     branch != NULL; branch = STAILQ_NEXT (branch, branches))
-	  {
-	    if (avro_schema_datum_validate (branch->schema, datum))
-	      {
-		return 1;
-	      }
-	  }
-	return 0;
-      }
-      break;
+	case AVRO_ENUM:
+		{
+			struct avro_enum_schema_t *enump =
+			    avro_schema_to_enum(expected_schema);
+			struct avro_enum_symbol_t *symbol =
+			    STAILQ_FIRST(&enump->symbols);
+			while (symbol) {
+				if (!strcmp
+				    (symbol->symbol,
+				     avro_datum_to_enum(datum)->symbol)) {
+					return 1;
+				}
+				symbol = STAILQ_NEXT(symbol, symbols);
+			}
+			return 0;
+		}
+		break;
 
-    case AVRO_RECORD:
-      if (is_avro_record (datum))
-	{
-	  struct avro_record_schema_t *record_schema =
-	    avro_schema_to_record (expected_schema);
-	  struct avro_record_field_t *field;
-	  for (field = STAILQ_FIRST (&record_schema->fields);
-	       field != NULL; field = STAILQ_NEXT (field, fields))
-	    {
-	      avro_datum_t field_datum =
-		avro_record_field_get (datum, field->name);
-	      if (!field_datum)
+	case AVRO_ARRAY:
 		{
-		  /* TODO: check for default values */
-		  return 0;
+			if (is_avro_array(datum)) {
+				struct avro_array_datum_t *array =
+				    avro_datum_to_array(datum);
+				struct avro_array_element_t *el =
+				    STAILQ_FIRST(&array->els);
+				while (el) {
+					if (!avro_schema_datum_validate
+					    ((avro_schema_to_array
+					      (expected_schema))->items,
+					     el->datum)) {
+						return 0;
+					}
+					el = STAILQ_NEXT(el, els);
+				}
+				return 1;
+			}
+			return 0;
+		}
+		break;
+
+	case AVRO_MAP:
+		if (is_avro_map(datum)) {
+			struct validate_st vst =
+			    { avro_schema_to_map(expected_schema)->values, 1 };
+			st_foreach(avro_datum_to_map(datum)->map,
+				   schema_map_validate_foreach,
+				   (st_data_t) & vst);
+			return vst.rval;
 		}
-	      if (!avro_schema_datum_validate (field->type, field_datum))
+		break;
+
+	case AVRO_UNION:
 		{
-		  return 0;
+			struct avro_union_schema_t *union_schema =
+			    avro_schema_to_union(expected_schema);
+			struct avro_union_branch_t *branch;
+
+			for (branch = STAILQ_FIRST(&union_schema->branches);
+			     branch != NULL;
+			     branch = STAILQ_NEXT(branch, branches)) {
+				if (avro_schema_datum_validate
+				    (branch->schema, datum)) {
+					return 1;
+				}
+			}
+			return 0;
 		}
-	    }
-	  return 1;
-	}
-      break;
+		break;
 
-    case AVRO_LINK:
-      {
-	return
-	  avro_schema_datum_validate ((avro_schema_to_link
-				       (expected_schema))->to, datum);
-      }
-      break;
-    }
-  return 0;
+	case AVRO_RECORD:
+		if (is_avro_record(datum)) {
+			struct avro_record_schema_t *record_schema =
+			    avro_schema_to_record(expected_schema);
+			struct avro_record_field_t *field;
+			for (field = STAILQ_FIRST(&record_schema->fields);
+			     field != NULL;
+			     field = STAILQ_NEXT(field, fields)) {
+				avro_datum_t field_datum =
+				    avro_record_field_get(datum, field->name);
+				if (!field_datum) {
+					/*
+					 * TODO: check for default values 
+					 */
+					return 0;
+				}
+				if (!avro_schema_datum_validate
+				    (field->type, field_datum)) {
+					return 0;
+				}
+			}
+			return 1;
+		}
+		break;
+
+	case AVRO_LINK:
+		{
+			return
+			    avro_schema_datum_validate((avro_schema_to_link
+							(expected_schema))->to,
+						       datum);
+		}
+		break;
+	}
+	return 0;
 }
 
 static int
-write_record (avro_writer_t writer, const avro_encoding_t * enc,
-	      avro_schema_t writer_schema, avro_datum_t datum)
+write_record(avro_writer_t writer, const avro_encoding_t * enc,
+	     avro_schema_t writer_schema, avro_datum_t datum)
 {
-  /* TODO */
-  return EINVAL;
+	/*
+	 * TODO 
+	 */
+	return EINVAL;
 }
 
 static int
-write_enum (avro_writer_t writer, const avro_encoding_t * enc,
-	    avro_schema_t writer_schema, avro_datum_t datum)
+write_enum(avro_writer_t writer, const avro_encoding_t * enc,
+	   avro_schema_t writer_schema, avro_datum_t datum)
 {
-  /* TODO */
-  return EINVAL;
+	/*
+	 * TODO 
+	 */
+	return EINVAL;
 }
 
 static int
-write_fixed (avro_writer_t writer, const avro_encoding_t * enc,
-	     avro_schema_t writer_schema, avro_datum_t datum)
+write_fixed(avro_writer_t writer, const avro_encoding_t * enc,
+	    avro_schema_t writer_schema, avro_datum_t datum)
 {
-  /* TODO */
-  return EINVAL;
+	/*
+	 * TODO 
+	 */
+	return EINVAL;
 }
 
-struct write_map_args
-{
-  int rval;
-  avro_writer_t writer;
-  const avro_encoding_t *enc;
-  avro_schema_t values_schema;
+struct write_map_args {
+	int rval;
+	avro_writer_t writer;
+	const avro_encoding_t *enc;
+	avro_schema_t values_schema;
 };
 
 static int
-write_map_foreach (char *key, avro_datum_t datum, struct write_map_args *args)
+write_map_foreach(char *key, avro_datum_t datum, struct write_map_args *args)
 {
-  int rval = args->enc->write_string (args->writer, key);
-  if (rval)
-    {
-      args->rval = rval;
-      return ST_STOP;
-    }
-  rval = avro_write_data (args->writer, args->values_schema, datum);
-  if (rval)
-    {
-      args->rval = rval;
-      return ST_STOP;
-    }
-  return ST_CONTINUE;
+	int rval = args->enc->write_string(args->writer, key);
+	if (rval) {
+		args->rval = rval;
+		return ST_STOP;
+	}
+	rval = avro_write_data(args->writer, args->values_schema, datum);
+	if (rval) {
+		args->rval = rval;
+		return ST_STOP;
+	}
+	return ST_CONTINUE;
 }
 
 static int
-write_map (avro_writer_t writer, const avro_encoding_t * enc,
-	   struct avro_map_schema_t *writer_schema,
-	   struct avro_map_datum_t *datum)
-{
-  int rval;
-  struct write_map_args args = { 0, writer, enc, writer_schema->values };
-
-  if (datum->map->num_entries)
-    {
-      rval = enc->write_long (writer, datum->map->num_entries);
-      if (rval)
-	{
-	  return rval;
-	}
-      st_foreach (datum->map, write_map_foreach, (st_data_t) & args);
-    }
-  if (!args.rval)
-    {
-      rval = enc->write_long (writer, 0);
-      if (rval)
-	{
-	  return rval;
-	}
-      return 0;
-    }
-  return args.rval;
+write_map(avro_writer_t writer, const avro_encoding_t * enc,
+	  struct avro_map_schema_t *writer_schema,
+	  struct avro_map_datum_t *datum)
+{
+	int rval;
+	struct write_map_args args = { 0, writer, enc, writer_schema->values };
+
+	if (datum->map->num_entries) {
+		rval = enc->write_long(writer, datum->map->num_entries);
+		if (rval) {
+			return rval;
+		}
+		st_foreach(datum->map, write_map_foreach, (st_data_t) & args);
+	}
+	if (!args.rval) {
+		rval = enc->write_long(writer, 0);
+		if (rval) {
+			return rval;
+		}
+		return 0;
+	}
+	return args.rval;
 }
 
 static int
-write_array (avro_writer_t writer, const avro_encoding_t * enc,
-	     struct avro_array_schema_t *schema,
-	     struct avro_array_datum_t *array)
-{
-  int rval;
-  struct avro_array_element_t *el;
-
-  if (array->num_elements)
-    {
-      rval = enc->write_long (writer, array->num_elements);
-      if (rval)
-	{
-	  return rval;
-	}
-      for (el = STAILQ_FIRST (&array->els);
-	   el != NULL; el = STAILQ_NEXT (el, els))
-	{
-	  rval = avro_write_data (writer, schema->items, el->datum);
-	  if (rval)
-	    {
-	      return rval;
-	    }
+write_array(avro_writer_t writer, const avro_encoding_t * enc,
+	    struct avro_array_schema_t *schema,
+	    struct avro_array_datum_t *array)
+{
+	int rval;
+	struct avro_array_element_t *el;
+
+	if (array->num_elements) {
+		rval = enc->write_long(writer, array->num_elements);
+		if (rval) {
+			return rval;
+		}
+		for (el = STAILQ_FIRST(&array->els);
+		     el != NULL; el = STAILQ_NEXT(el, els)) {
+			rval =
+			    avro_write_data(writer, schema->items, el->datum);
+			if (rval) {
+				return rval;
+			}
+		}
 	}
-    }
-  return enc->write_long (writer, 0);
+	return enc->write_long(writer, 0);
 }
 
 int
-avro_write_data (avro_writer_t writer, avro_schema_t writer_schema,
-		 avro_datum_t datum)
+avro_write_data(avro_writer_t writer, avro_schema_t writer_schema,
+		avro_datum_t datum)
 {
-  const avro_encoding_t *enc = &avro_binary_encoding;
-  int rval = -1;
+	const avro_encoding_t *enc = &avro_binary_encoding;
+	int rval = -1;
+
+	if (!writer || !(is_avro_schema(writer_schema) && is_avro_datum(datum))) {
+		return EINVAL;
+	}
+	if (!avro_schema_datum_validate(writer_schema, datum)) {
+		return EINVAL;
+	}
+	switch (avro_typeof(writer_schema)) {
+	case AVRO_NULL:
+		rval = enc->write_null(writer);
+		break;
+	case AVRO_BOOLEAN:
+		rval =
+		    enc->write_boolean(writer, avro_datum_to_boolean(datum)->i);
+		break;
+	case AVRO_STRING:
+		rval =
+		    enc->write_string(writer, avro_datum_to_string(datum)->s);
+		break;
+	case AVRO_BYTES:
+		rval =
+		    enc->write_bytes(writer, avro_datum_to_bytes(datum)->bytes,
+				     avro_datum_to_bytes(datum)->size);
+		break;
+	case AVRO_INT:
+		{
+			int32_t i;
+			if (is_avro_int(datum)) {
+				i = avro_datum_to_int(datum)->i;
+			} else if (is_avro_long(datum)) {
+				i = (int32_t) avro_datum_to_long(datum)->l;
+			} else {
+				assert(0
+				       &&
+				       "Serious bug in schema validation code");
+			}
+			rval = enc->write_int(writer, i);
+		}
+		break;
+	case AVRO_LONG:
+		rval = enc->write_long(writer, avro_datum_to_long(datum)->l);
+		break;
+	case AVRO_FLOAT:
+		{
+			float f;
+			if (is_avro_int(datum)) {
+				f = (float)(avro_datum_to_int(datum)->i);
+			} else if (is_avro_long(datum)) {
+				f = (float)(avro_datum_to_long(datum)->l);
+			} else if (is_avro_float(datum)) {
+				f = avro_datum_to_float(datum)->f;
+			} else if (is_avro_double(datum)) {
+				f = (float)(avro_datum_to_double(datum)->d);
+			} else {
+				assert(0
+				       &&
+				       "Serious bug in schema validation code");
+			}
+			rval = enc->write_float(writer, f);
+		}
+		break;
+	case AVRO_DOUBLE:
+		{
+			double d;
+			if (is_avro_int(datum)) {
+				d = (double)(avro_datum_to_int(datum)->i);
+			} else if (is_avro_long(datum)) {
+				d = (double)(avro_datum_to_long(datum)->l);
+			} else if (is_avro_float(datum)) {
+				d = (double)(avro_datum_to_float(datum)->f);
+			} else if (is_avro_double(datum)) {
+				d = avro_datum_to_double(datum)->d;
+			} else {
+				assert(0 && "Bug in schema validation code");
+			}
+			rval = enc->write_double(writer, d);
+		}
+		break;
 
-  if (!writer || !(is_avro_schema (writer_schema) && is_avro_datum (datum)))
-    {
-      return EINVAL;
-    }
-  if (!avro_schema_datum_validate (writer_schema, datum))
-    {
-      return EINVAL;
-    }
-  switch (avro_typeof (writer_schema))
-    {
-    case AVRO_NULL:
-      rval = enc->write_null (writer);
-      break;
-    case AVRO_BOOLEAN:
-      rval = enc->write_boolean (writer, avro_datum_to_boolean (datum)->i);
-      break;
-    case AVRO_STRING:
-      rval = enc->write_string (writer, avro_datum_to_string (datum)->s);
-      break;
-    case AVRO_BYTES:
-      rval = enc->write_bytes (writer, avro_datum_to_bytes (datum)->bytes,
-			       avro_datum_to_bytes (datum)->size);
-      break;
-    case AVRO_INT:
-      {
-	int32_t i;
-	if (is_avro_int (datum))
-	  {
-	    i = avro_datum_to_int (datum)->i;
-	  }
-	else if (is_avro_long (datum))
-	  {
-	    i = (int32_t) avro_datum_to_long (datum)->l;
-	  }
-	else
-	  {
-	    assert (0 && "Serious bug in schema validation code");
-	  }
-	rval = enc->write_int (writer, i);
-      }
-      break;
-    case AVRO_LONG:
-      rval = enc->write_long (writer, avro_datum_to_long (datum)->l);
-      break;
-    case AVRO_FLOAT:
-      {
-	float f;
-	if (is_avro_int (datum))
-	  {
-	    f = (float) (avro_datum_to_int (datum)->i);
-	  }
-	else if (is_avro_long (datum))
-	  {
-	    f = (float) (avro_datum_to_long (datum)->l);
-	  }
-	else if (is_avro_float (datum))
-	  {
-	    f = avro_datum_to_float (datum)->f;
-	  }
-	else if (is_avro_double (datum))
-	  {
-	    f = (float) (avro_datum_to_double (datum)->d);
-	  }
-	else
-	  {
-	    assert (0 && "Serious bug in schema validation code");
-	  }
-	rval = enc->write_float (writer, f);
-      }
-      break;
-    case AVRO_DOUBLE:
-      {
-	double d;
-	if (is_avro_int (datum))
-	  {
-	    d = (double) (avro_datum_to_int (datum)->i);
-	  }
-	else if (is_avro_long (datum))
-	  {
-	    d = (double) (avro_datum_to_long (datum)->l);
-	  }
-	else if (is_avro_float (datum))
-	  {
-	    d = (double) (avro_datum_to_float (datum)->f);
-	  }
-	else if (is_avro_double (datum))
-	  {
-	    d = avro_datum_to_double (datum)->d;
-	  }
-	else
-	  {
-	    assert (0 && "Bug in schema validation code");
-	  }
-	rval = enc->write_double (writer, d);
-      }
-      break;
-
-    case AVRO_RECORD:
-      rval = write_record (writer, enc, writer_schema, datum);
-      break;
-    case AVRO_ENUM:
-      rval = write_enum (writer, enc, writer_schema, datum);
-      break;
-    case AVRO_FIXED:
-      rval = write_fixed (writer, enc, writer_schema, datum);
-      break;
-    case AVRO_MAP:
-      rval =
-	write_map (writer, enc, avro_schema_to_map (writer_schema),
-		   avro_datum_to_map (datum));
-      break;
-    case AVRO_ARRAY:
-      rval =
-	write_array (writer, enc, avro_schema_to_array (writer_schema),
-		     avro_datum_to_array (datum));
-      break;
-
-    case AVRO_UNION:
-      {
-	assert (0 && "Bug in schema validation code");
-      }
-      break;
-
-    case AVRO_LINK:
-      rval =
-	avro_write_data (writer, (avro_schema_to_link (writer_schema))->to,
-			 datum);
-      break;
-    }
-  return rval;
+	case AVRO_RECORD:
+		rval = write_record(writer, enc, writer_schema, datum);
+		break;
+	case AVRO_ENUM:
+		rval = write_enum(writer, enc, writer_schema, datum);
+		break;
+	case AVRO_FIXED:
+		rval = write_fixed(writer, enc, writer_schema, datum);
+		break;
+	case AVRO_MAP:
+		rval =
+		    write_map(writer, enc, avro_schema_to_map(writer_schema),
+			      avro_datum_to_map(datum));
+		break;
+	case AVRO_ARRAY:
+		rval =
+		    write_array(writer, enc,
+				avro_schema_to_array(writer_schema),
+				avro_datum_to_array(datum));
+		break;
+
+	case AVRO_UNION:
+		{
+			assert(0 && "Bug in schema validation code");
+		}
+		break;
+
+	case AVRO_LINK:
+		rval =
+		    avro_write_data(writer,
+				    (avro_schema_to_link(writer_schema))->to,
+				    datum);
+		break;
+	}
+	return rval;
 }

Modified: hadoop/avro/trunk/lang/c/src/datum.h
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/datum.h?rev=901421&r1=901420&r2=901421&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/datum.h (original)
+++ hadoop/avro/trunk/lang/c/src/datum.h Wed Jan 20 22:58:22 2010
@@ -1,21 +1,19 @@
 /*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0 
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License. 
+ */
 
 #ifndef AVRO_DATUM_H
 #define AVRO_DATUM_H
@@ -24,88 +22,75 @@
 #include "st.h"
 #include "queue.h"
 
-struct avro_string_datum_t
-{
-  struct avro_obj_t obj;
-  char *s;
+struct avro_string_datum_t {
+	struct avro_obj_t obj;
+	char *s;
 };
 
-struct avro_bytes_datum_t
-{
-  struct avro_obj_t obj;
-  char *bytes;
-  int64_t size;
+struct avro_bytes_datum_t {
+	struct avro_obj_t obj;
+	char *bytes;
+	int64_t size;
 };
 
-struct avro_int_datum_t
-{
-  struct avro_obj_t obj;
-  int32_t i;
+struct avro_int_datum_t {
+	struct avro_obj_t obj;
+	int32_t i;
 };
 
-struct avro_long_datum_t
-{
-  struct avro_obj_t obj;
-  int64_t l;
+struct avro_long_datum_t {
+	struct avro_obj_t obj;
+	int64_t l;
 };
 
-struct avro_float_datum_t
-{
-  struct avro_obj_t obj;
-  float f;
+struct avro_float_datum_t {
+	struct avro_obj_t obj;
+	float f;
 };
 
-struct avro_double_datum_t
-{
-  struct avro_obj_t obj;
-  double d;
+struct avro_double_datum_t {
+	struct avro_obj_t obj;
+	double d;
 };
 
-struct avro_boolean_datum_t
-{
-  struct avro_obj_t obj;
-  int8_t i;
+struct avro_boolean_datum_t {
+	struct avro_obj_t obj;
+	int8_t i;
 };
 
-struct avro_fixed_datum_t
-{
-  struct avro_obj_t obj;
-  char *name;
-  char *bytes;
-  int64_t size;
+struct avro_fixed_datum_t {
+	struct avro_obj_t obj;
+	char *name;
+	char *bytes;
+	int64_t size;
 };
 
-struct avro_map_datum_t
-{
-  struct avro_obj_t obj;
-  st_table *map;
+struct avro_map_datum_t {
+	struct avro_obj_t obj;
+	st_table *map;
 };
 
-struct avro_record_datum_t
-{
-  struct avro_obj_t obj;
-  const char *name;
-  st_table *fields;
+struct avro_record_datum_t {
+	struct avro_obj_t obj;
+	const char *name;
+	st_table *fields;
 };
 
-struct avro_enum_datum_t
-{
-  struct avro_obj_t obj;
-  const char *name;
-  const char *symbol;
+struct avro_enum_datum_t {
+	struct avro_obj_t obj;
+	const char *name;
+	const char *symbol;
 };
 
-struct avro_array_element_t
-{
-  avro_datum_t datum;
-    STAILQ_ENTRY (avro_array_element_t) els;
+struct avro_array_element_t {
+	avro_datum_t datum;
+	 STAILQ_ENTRY(avro_array_element_t) els;
 };
 
-struct avro_array_datum_t
-{
-  struct avro_obj_t obj;
-  int64_t num_elements;
-    STAILQ_HEAD (els, avro_array_element_t) els;
+struct avro_array_datum_t {
+	struct avro_obj_t obj;
+	int64_t num_elements;
+	 STAILQ_HEAD(els, avro_array_element_t) els;
 };
 
 #define avro_datum_to_string(datum_)    (container_of(datum_, struct avro_string_datum_t, obj))

Modified: hadoop/avro/trunk/lang/c/src/dump.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/dump.c?rev=901421&r1=901420&r2=901421&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/dump.c (original)
+++ hadoop/avro/trunk/lang/c/src/dump.c Wed Jan 20 22:58:22 2010
@@ -1,70 +1,56 @@
 /*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0 
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License. 
+ */
 
 #include "dump.h"
 #include <ctype.h>
 #include <string.h>
 #include <stdint.h>
 
-static void
-dump_line (FILE * out, const caddr_t addr, const long len)
+static void dump_line(FILE * out, const caddr_t addr, const long len)
 {
-  int i;
-  fprintf (out, "|");
-  for (i = 0; i < 16; i++)
-    {
-      if (i < len)
-	{
-	  fprintf (out, " %02X", ((uint8_t *) addr)[i]);
-	}
-      else
-	{
-	  fprintf (out, " ..");
+	int i;
+	fprintf(out, "|");
+	for (i = 0; i < 16; i++) {
+		if (i < len) {
+			fprintf(out, " %02X", ((uint8_t *) addr)[i]);
+		} else {
+			fprintf(out, " ..");
+		}
+		if (!((i + 1) % 8)) {
+			fprintf(out, " |");
+		}
 	}
-      if (!((i + 1) % 8))
-	{
-	  fprintf (out, " |");
+	fprintf(out, "\t");
+	for (i = 0; i < 16; i++) {
+		char c = 0x7f & ((uint8_t *) addr)[i];
+		if (i < len && isprint(c)) {
+			fprintf(out, "%c", c);
+		} else {
+			fprintf(out, ".");
+		}
 	}
-    }
-  fprintf (out, "\t");
-  for (i = 0; i < 16; i++)
-    {
-      char c = 0x7f & ((uint8_t *) addr)[i];
-      if (i < len && isprint (c))
-	{
-	  fprintf (out, "%c", c);
-	}
-      else
-	{
-	  fprintf (out, ".");
-	}
-    }
 }
 
-void
-dump (FILE * out, const caddr_t addr, const long len)
+void dump(FILE * out, const caddr_t addr, const long len)
 {
-  int i;
-  for (i = 0; i < len; i += 16)
-    {
-      dump_line (out, addr + i, (len - i) < 16 ? (len - i) : 16);
-      fprintf (out, "\n");
-    }
-  fflush (out);
+	int i;
+	for (i = 0; i < len; i += 16) {
+		dump_line(out, addr + i, (len - i) < 16 ? (len - i) : 16);
+		fprintf(out, "\n");
+	}
+	fflush(out);
 }

Modified: hadoop/avro/trunk/lang/c/src/dump.h
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/dump.h?rev=901421&r1=901420&r2=901421&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/dump.h (original)
+++ hadoop/avro/trunk/lang/c/src/dump.h Wed Jan 20 22:58:22 2010
@@ -1,21 +1,19 @@
 /*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0 
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License. 
+ */
 
 #ifndef DUMP_H
 #define DUMP_H
@@ -23,6 +21,6 @@
 #include <stdio.h>
 #include <sys/types.h>
 
-void dump (FILE * out, const caddr_t addr, const long len);
+void dump(FILE * out, const caddr_t addr, const long len);
 
 #endif

Modified: hadoop/avro/trunk/lang/c/src/encoding.h
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/encoding.h?rev=901421&r1=901420&r2=901421&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/encoding.h (original)
+++ hadoop/avro/trunk/lang/c/src/encoding.h Wed Jan 20 22:58:22 2010
@@ -1,62 +1,77 @@
 /*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0 
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License. 
+ */
 #ifndef AVRO_ENCODING_H
 #define AVRO_ENCODING_H
 #include "avro.h"
 
-/* TODO: this will need more functions when JSON encoding is added */
-struct avro_encoding_t
-{
-  const char *description;
-  /* string */
-  int (*read_string) (avro_reader_t reader, char **s);
-  int (*skip_string) (avro_reader_t reader);
-  int (*write_string) (avro_writer_t writer, const char *s);
-  /* bytes */
-  int (*read_bytes) (avro_reader_t reader, char **bytes, int64_t * len);
-  int (*skip_bytes) (avro_reader_t reader);
-  int (*write_bytes) (avro_writer_t writer, const char *bytes,
-		      const int64_t len);
-  /* int */
-  int (*read_int) (avro_reader_t reader, int32_t * i);
-  int (*skip_int) (avro_reader_t reader);
-  int (*write_int) (avro_writer_t writer, const int32_t i);
-  /* long */
-  int (*read_long) (avro_reader_t reader, int64_t * l);
-  int (*skip_long) (avro_reader_t reader);
-  int (*write_long) (avro_writer_t writer, const int64_t l);
-  /* float */
-  int (*read_float) (avro_reader_t reader, float *f);
-  int (*skip_float) (avro_reader_t reader);
-  int (*write_float) (avro_writer_t writer, const float f);
-  /* double */
-  int (*read_double) (avro_reader_t reader, double *d);
-  int (*skip_double) (avro_reader_t reader);
-  int (*write_double) (avro_writer_t writer, const double d);
-  /* boolean */
-  int (*read_boolean) (avro_reader_t reader, int8_t * b);
-  int (*skip_boolean) (avro_reader_t reader);
-  int (*write_boolean) (avro_writer_t writer, const int8_t b);
-  /* null */
-  int (*read_null) (avro_reader_t reader);
-  int (*skip_null) (avro_reader_t reader);
-  int (*write_null) (avro_writer_t writer);
+/*
+ * TODO: this will need more functions when JSON encoding is added 
+ */
+struct avro_encoding_t {
+	const char *description;
+	/*
+	 * string 
+	 */
+	int (*read_string) (avro_reader_t reader, char **s);
+	int (*skip_string) (avro_reader_t reader);
+	int (*write_string) (avro_writer_t writer, const char *s);
+	/*
+	 * bytes 
+	 */
+	int (*read_bytes) (avro_reader_t reader, char **bytes, int64_t * len);
+	int (*skip_bytes) (avro_reader_t reader);
+	int (*write_bytes) (avro_writer_t writer,
+			    const char *bytes, const int64_t len);
+	/*
+	 * int 
+	 */
+	int (*read_int) (avro_reader_t reader, int32_t * i);
+	int (*skip_int) (avro_reader_t reader);
+	int (*write_int) (avro_writer_t writer, const int32_t i);
+	/*
+	 * long 
+	 */
+	int (*read_long) (avro_reader_t reader, int64_t * l);
+	int (*skip_long) (avro_reader_t reader);
+	int (*write_long) (avro_writer_t writer, const int64_t l);
+	/*
+	 * float 
+	 */
+	int (*read_float) (avro_reader_t reader, float *f);
+	int (*skip_float) (avro_reader_t reader);
+	int (*write_float) (avro_writer_t writer, const float f);
+	/*
+	 * double 
+	 */
+	int (*read_double) (avro_reader_t reader, double *d);
+	int (*skip_double) (avro_reader_t reader);
+	int (*write_double) (avro_writer_t writer, const double d);
+	/*
+	 * boolean 
+	 */
+	int (*read_boolean) (avro_reader_t reader, int8_t * b);
+	int (*skip_boolean) (avro_reader_t reader);
+	int (*write_boolean) (avro_writer_t writer, const int8_t b);
+	/*
+	 * null 
+	 */
+	int (*read_null) (avro_reader_t reader);
+	int (*skip_null) (avro_reader_t reader);
+	int (*write_null) (avro_writer_t writer);
 };
 typedef struct avro_encoding_t avro_encoding_t;
 
@@ -67,6 +82,8 @@
 #define AVRO_SKIP(reader, len) \
 { int rval = avro_skip( reader, len); if (rval) return rval; }
 
-extern const avro_encoding_t avro_binary_encoding;	/* in encoding_binary */
+extern const avro_encoding_t avro_binary_encoding;	/* in
+							 * encoding_binary 
+							 */
 
 #endif



Mime
View raw message