THRIFT-599. erl: Don't use unnecessary processes in the Erlang transports and clients

The only user-visible changes are to the client. Every thrift call now returns {NewClient, Result} instead of just Result.

Patch: David Reiss (assist to Anthony Molinaro)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987018 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/erl/include/thrift_protocol.hrl b/lib/erl/include/thrift_protocol.hrl
index f4e1901..f85f455 100644
--- a/lib/erl/include/thrift_protocol.hrl
+++ b/lib/erl/include/thrift_protocol.hrl
@@ -18,7 +18,7 @@
 %%
 
 -ifndef(THRIFT_PROTOCOL_INCLUDED).
--define(THRIFT_PROTOCOL_INCLUDED, yea).
+-define(THRIFT_PROTOCOL_INCLUDED, true).
 
 -record(protocol_message_begin, {name, type, seqid}).
 -record(protocol_struct_begin, {name}).
@@ -27,5 +27,40 @@
 -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
+                        .
+-type tprot_cont_tag() :: {list, _Type}
+                        | {map, _KType, _VType}
+                        | {set, _Type}
+                        .
+
 
 -endif.