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:06:03 UTC

svn commit: r991003 - in /incubator/thrift/trunk/lib/erl: include/thrift_protocol_behaviour.hrl src/thrift_client.erl src/thrift_protocol.erl

Author: dreiss
Date: Mon Aug 30 22:06:03 2010
New Revision: 991003

URL: http://svn.apache.org/viewvc?rev=991003&view=rev
Log:
erlang: Un-revert r988722

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

Modified: incubator/thrift/trunk/lib/erl/include/thrift_protocol_behaviour.hrl
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/erl/include/thrift_protocol_behaviour.hrl?rev=991003&r1=991002&r2=991003&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/erl/include/thrift_protocol_behaviour.hrl (original)
+++ incubator/thrift/trunk/lib/erl/include/thrift_protocol_behaviour.hrl Mon Aug 30 22:06:03 2010
@@ -25,13 +25,13 @@
 -spec flush_transport(state()) -> {state(), ok | {error, _Reason}}.
 -spec close_transport(state()) -> {state(), ok | {error, _Reason}}.
 
--spec write(state(), term()) -> {state(), ok | {error, _Reason}}.
+-spec write(state(), any()) -> {state(), ok | {error, _Reason}}.
 
 %% NOTE: Keep this in sync with thrift_protocol:read and read_specific.
 -spec read
         (state(), tprot_empty_tag()) ->  {state(),  ok                | {error, _Reason}};
         (state(), tprot_header_tag()) -> {state(), tprot_header_val() | {error, _Reason}};
-        (state(), tprot_data_tag()) ->   {state(), {ok, term()}       | {error, _Reason}}.
+        (state(), tprot_data_tag()) ->   {state(), {ok, any()}        | {error, _Reason}}.
 
 
 -endif.

Modified: incubator/thrift/trunk/lib/erl/src/thrift_client.erl
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/erl/src/thrift_client.erl?rev=991003&r1=991002&r2=991003&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/erl/src/thrift_client.erl (original)
+++ incubator/thrift/trunk/lib/erl/src/thrift_client.erl Mon Aug 30 22:06:03 2010
@@ -34,7 +34,7 @@ new(Protocol, Service)
                   service = Service,
                   seqid = 0}}.
 
--spec call(#tclient{}, atom(), list()) -> {#tclient{}, {ok, term()} | {error, term()}}.
+-spec call(#tclient{}, atom(), list()) -> {#tclient{}, {ok, any()} | {error, any()}}.
 call(Client = #tclient{}, Function, Args)
   when is_atom(Function), is_list(Args) ->
     case send_function_call(Client, Function, Args) of
@@ -61,7 +61,7 @@ close(#tclient{protocol=Protocol}) ->
 %%--------------------------------------------------------------------
 %%% Internal functions
 %%--------------------------------------------------------------------
--spec send_function_call(#tclient{}, atom(), list()) -> {#tclient{}, ok | {error, term()}}.
+-spec send_function_call(#tclient{}, atom(), list()) -> {#tclient{}, ok | {error, any()}}.
 send_function_call(Client = #tclient{protocol = Proto0,
                                      service  = Service,
                                      seqid    = SeqId},
@@ -84,7 +84,7 @@ send_function_call(Client = #tclient{pro
             {Client#tclient{protocol = Proto4}, ok}
     end.
 
--spec receive_function_result(#tclient{}, atom()) -> {#tclient{}, {ok, term()} | {error, term()}}.
+-spec receive_function_result(#tclient{}, atom()) -> {#tclient{}, {ok, any()} | {error, any()}}.
 receive_function_result(Client = #tclient{service = Service}, Function) ->
     ResultType = Service:function_info(Function, reply_type),
     read_result(Client, Function, ResultType).

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=991003&r1=991002&r2=991003&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:06:03 2010
@@ -120,10 +120,10 @@ read(IProto0, {struct, Structure}, Tag)
 %% NOTE: Keep this in sync with thrift_protocol_behaviour:read
 -spec read
         (#protocol{}, {struct, _Info}) ->    {#protocol{}, {ok, tuple()}      | {error, _Reason}};
-        (#protocol{}, tprot_cont_tag()) ->   {#protocol{}, {ok, term()}       | {error, _Reason}};
+        (#protocol{}, tprot_cont_tag()) ->   {#protocol{}, {ok, any()}        | {error, _Reason}};
         (#protocol{}, tprot_empty_tag()) ->  {#protocol{},  ok                | {error, _Reason}};
         (#protocol{}, tprot_header_tag()) -> {#protocol{}, tprot_header_val() | {error, _Reason}};
-        (#protocol{}, tprot_data_tag()) ->   {#protocol{}, {ok, term()}       | {error, _Reason}}.
+        (#protocol{}, tprot_data_tag()) ->   {#protocol{}, {ok, any()}        | {error, _Reason}}.
 
 read(IProto, {struct, {Module, StructureName}}) when is_atom(Module),
                                                      is_atom(StructureName) ->
@@ -180,7 +180,7 @@ read(Protocol, ProtocolType) ->
 -spec read_specific
         (#protocol{}, tprot_empty_tag()) ->  {#protocol{},  ok                | {error, _Reason}};
         (#protocol{}, tprot_header_tag()) -> {#protocol{}, tprot_header_val() | {error, _Reason}};
-        (#protocol{}, tprot_data_tag()) ->   {#protocol{}, {ok, term()}       | {error, _Reason}}.
+        (#protocol{}, tprot_data_tag()) ->   {#protocol{}, {ok, any()}        | {error, _Reason}}.
 read_specific(Proto = #protocol{module = Module,
                                 data = ModuleData}, ProtocolType) ->
     {NewData, Result} = Module:read(ModuleData, ProtocolType),
@@ -219,7 +219,7 @@ skip_field(FType, IProto0, SDict, RTuple
     {IProto2, ok} = read(IProto1, field_end),
     read_struct_loop(IProto2, SDict, RTuple).
 
--spec skip(#protocol{}, term()) -> {#protocol{}, ok}.
+-spec skip(#protocol{}, any()) -> {#protocol{}, ok}.
 
 skip(Proto0, struct) ->
     {Proto1, ok} = read(Proto0, struct_begin),
@@ -308,11 +308,11 @@ skip_list_loop(Proto0, Map = #protocol_l
 %%       | list()   -- for list
 %%       | dictionary()   -- for map
 %%       | set()    -- for set
-%%       | term()   -- for base types
+%%       | any()    -- for base types
 %%
 %% Description:
 %%--------------------------------------------------------------------
--spec write(#protocol{}, term()) -> {#protocol{}, ok | {error, _Reason}}.
+-spec write(#protocol{}, any()) -> {#protocol{}, ok | {error, _Reason}}.
 
 write(Proto0, {{struct, StructDef}, Data})
   when is_list(StructDef), is_tuple(Data), length(StructDef) == size(Data) - 1 ->