erlang: Add some more detailed specs for protocol implementations

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990974 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/erl/include/thrift_protocol.hrl b/lib/erl/include/thrift_protocol.hrl
index fa95acf..201bade 100644
--- a/lib/erl/include/thrift_protocol.hrl
+++ b/lib/erl/include/thrift_protocol.hrl
@@ -27,5 +27,36 @@
 -record(protocol_list_begin, {etype, size}).
 -record(protocol_set_begin, {etype, size}).
 
+-type tprot_header_val() :: #protocol_message_begin{}
+                          | #protocol_struct_begin{}
+                          | #protocol_field_begin{}
+                          | #protocol_map_begin{}
+                          | #protocol_list_begin{}
+                          | #protocol_set_begin{}
+                          .
+-type tprot_empty_tag() :: message_end
+                         | struct_begin
+                         | struct_end
+                         | field_end
+                         | map_end
+                         | list_end
+                         | set_end
+                         .
+-type tprot_header_tag() :: message_begin
+                          | field_begin
+                          | map_begin
+                          | list_begin
+                          | set_begin
+                          .
+-type tprot_data_tag() :: ui32
+                        | bool
+                        | byte
+                        | i16
+                        | i32
+                        | i64
+                        | double
+                        | string
+                        .
+
 
 -endif.
diff --git a/lib/erl/include/thrift_protocol_impl.hrl b/lib/erl/include/thrift_protocol_impl.hrl
index 7d8abae..e816d79 100644
--- a/lib/erl/include/thrift_protocol_impl.hrl
+++ b/lib/erl/include/thrift_protocol_impl.hrl
@@ -24,8 +24,14 @@
 
 -spec flush_transport(state()) -> ok.
 -spec close_transport(state()) -> ok.
+
 -spec write(state(), term()) -> ok | {error, _Reason}.
--spec read(state(), term()) -> term().
+
+-spec read
+        (state(), non_neg_integer()) ->  {ok, binary()}     | {error, _Reason};
+        (state(), tprot_empty_tag()) ->   ok                | {error, _Reason};
+        (state(), tprot_header_tag()) -> tprot_header_val() | {error, _Reason};
+        (state(), tprot_data_tag()) ->   {ok, term()}       | {error, _Reason}.
 
 
 -endif.