You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2010/08/31 00:05:25 UTC

svn commit: r990976 - in /incubator/thrift/trunk/lib/erl: include/thrift_protocol.hrl include/thrift_protocol_impl.hrl src/thrift_protocol.erl

Author: dreiss
Date: Mon Aug 30 22:05:25 2010
New Revision: 990976

URL: http://svn.apache.org/viewvc?rev=990976&view=rev
Log:
erlang: Add a more detailed spec for thrift_protocol:read

Modified:
    incubator/thrift/trunk/lib/erl/include/thrift_protocol.hrl
    incubator/thrift/trunk/lib/erl/include/thrift_protocol_impl.hrl
    incubator/thrift/trunk/lib/erl/src/thrift_protocol.erl

Modified: incubator/thrift/trunk/lib/erl/include/thrift_protocol.hrl
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/erl/include/thrift_protocol.hrl?rev=990976&r1=990975&r2=990976&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/erl/include/thrift_protocol.hrl (original)
+++ incubator/thrift/trunk/lib/erl/include/thrift_protocol.hrl Mon Aug 30 22:05:25 2010
@@ -57,6 +57,10 @@
                         | double
                         | string
                         .
+-type tprot_cont_tag() :: {list, _Type}
+                        | {map, _KType, _VType}
+                        | {set, _Type}
+                        .
 
 
 -endif.

Modified: incubator/thrift/trunk/lib/erl/include/thrift_protocol_impl.hrl
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/erl/include/thrift_protocol_impl.hrl?rev=990976&r1=990975&r2=990976&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/erl/include/thrift_protocol_impl.hrl (original)
+++ incubator/thrift/trunk/lib/erl/include/thrift_protocol_impl.hrl Mon Aug 30 22:05:25 2010
@@ -27,6 +27,7 @@
 
 -spec write(state(), term()) -> ok | {error, _Reason}.
 
+%% NOTE: Keep this in sync with thrift_protocol:read.
 -spec read
         (state(), tprot_empty_tag()) ->   ok                | {error, _Reason};
         (state(), tprot_header_tag()) -> tprot_header_val() | {error, _Reason};

Modified: incubator/thrift/trunk/lib/erl/src/thrift_protocol.erl
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/erl/src/thrift_protocol.erl?rev=990976&r1=990975&r2=990976&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/erl/src/thrift_protocol.erl (original)
+++ incubator/thrift/trunk/lib/erl/src/thrift_protocol.erl Mon Aug 30 22:05:25 2010
@@ -115,7 +115,14 @@ read(IProto, {struct, Structure}, Tag)
     RTuple2 = read_struct_loop(IProto, SDict, RTuple1),
     {ok, RTuple2}.
 
--spec read(#protocol{}, term()) -> term().
+
+%% NOTE: Keep this in sync with thrift_protocol_impl:read
+-spec read
+        (#protocol{}, {struct, _Info}) ->    {ok, tuple()}      | {error, _Reason};
+        (#protocol{}, tprot_cont_tag()) ->   {ok, term()}       | {error, _Reason};
+        (#protocol{}, tprot_empty_tag()) ->   ok                | {error, _Reason};
+        (#protocol{}, tprot_header_tag()) -> tprot_header_val() | {error, _Reason};
+        (#protocol{}, tprot_data_tag()) ->   {ok, term()}       | {error, _Reason}.
 
 read(IProto, {struct, {Module, StructureName}}) when is_atom(Module),
                                                      is_atom(StructureName) ->