From cf7f3973bb025cdec3914e007e4d0cfe9a362614 Mon Sep 17 00:00:00 2001 From: David Reiss Date: Mon, 30 Aug 2010 22:05:55 +0000 Subject: [PATCH] erlang: Rename _impl headers to _behaviour git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990998 13f79535-47bb-0310-9956-ffa450edef68 --- ...thrift_protocol_impl.hrl => thrift_protocol_behaviour.hrl} | 4 ++-- ...rift_transport_impl.hrl => thrift_transport_behaviour.hrl} | 4 ++-- lib/erl/src/thrift_base64_transport.erl | 2 +- lib/erl/src/thrift_binary_protocol.erl | 2 +- lib/erl/src/thrift_buffered_transport.erl | 2 +- lib/erl/src/thrift_disk_log_transport.erl | 2 +- lib/erl/src/thrift_file_transport.erl | 2 +- lib/erl/src/thrift_framed_transport.erl | 2 +- lib/erl/src/thrift_http_transport.erl | 2 +- lib/erl/src/thrift_memory_buffer.erl | 2 +- lib/erl/src/thrift_protocol.erl | 4 ++-- lib/erl/src/thrift_socket_transport.erl | 2 +- lib/erl/src/thrift_transport_state_test.erl | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) rename lib/erl/include/{thrift_protocol_impl.hrl => thrift_protocol_behaviour.hrl} (93%) rename lib/erl/include/{thrift_transport_impl.hrl => thrift_transport_behaviour.hrl} (92%) diff --git a/lib/erl/include/thrift_protocol_impl.hrl b/lib/erl/include/thrift_protocol_behaviour.hrl similarity index 93% rename from lib/erl/include/thrift_protocol_impl.hrl rename to lib/erl/include/thrift_protocol_behaviour.hrl index de6bb7be..b75bb4a4 100644 --- a/lib/erl/include/thrift_protocol_impl.hrl +++ b/lib/erl/include/thrift_protocol_behaviour.hrl @@ -19,8 +19,8 @@ %% Signature specifications for protocol implementations. --ifndef(THRIFT_PROTOCOL_IMPL_INCLUDED). --define(THRIFT_PROTOCOL_IMPL_INCLUDED, true). +-ifndef(THRIFT_PROTOCOL_BEHAVIOUR_INCLUDED). +-define(THRIFT_PROTOCOL_BEHAVIOUR_INCLUDED, true). -spec flush_transport(state()) -> {state(), ok | {error, _Reason}}. -spec close_transport(state()) -> {state(), ok | {error, _Reason}}. diff --git a/lib/erl/include/thrift_transport_impl.hrl b/lib/erl/include/thrift_transport_behaviour.hrl similarity index 92% rename from lib/erl/include/thrift_transport_impl.hrl rename to lib/erl/include/thrift_transport_behaviour.hrl index a9980daf..dbc05aac 100644 --- a/lib/erl/include/thrift_transport_impl.hrl +++ b/lib/erl/include/thrift_transport_behaviour.hrl @@ -19,8 +19,8 @@ %% Signature specifications for transport implementations. --ifndef(THRIFT_TRANSPORT_IMPL_INCLUDED). --define(THRIFT_TRANSPORT_IMPL_INCLUDED, true). +-ifndef(THRIFT_TRANSPORT_BEHAVIOUR_INCLUDED). +-define(THRIFT_TRANSPORT_BEHAVIOUR_INCLUDED, true). -spec write(state(), iolist() | binary()) -> {state(), ok | {error, _Reason}}. -spec read(state(), non_neg_integer()) -> {state(), {ok, binary()} | {error, _Reason}}. diff --git a/lib/erl/src/thrift_base64_transport.erl b/lib/erl/src/thrift_base64_transport.erl index 3cdb3515..d31f2bac 100644 --- a/lib/erl/src/thrift_base64_transport.erl +++ b/lib/erl/src/thrift_base64_transport.erl @@ -30,7 +30,7 @@ %% State -record(b64_transport, {wrapped}). -type state() :: #b64_transport{}. --include("thrift_transport_impl.hrl"). +-include("thrift_transport_behaviour.hrl"). new(Wrapped) -> State = #b64_transport{wrapped = Wrapped}, diff --git a/lib/erl/src/thrift_binary_protocol.erl b/lib/erl/src/thrift_binary_protocol.erl index 796089c1..9216e474 100644 --- a/lib/erl/src/thrift_binary_protocol.erl +++ b/lib/erl/src/thrift_binary_protocol.erl @@ -38,7 +38,7 @@ strict_write=true }). -type state() :: #binary_protocol{}. --include("thrift_protocol_impl.hrl"). +-include("thrift_protocol_behaviour.hrl"). -define(VERSION_MASK, 16#FFFF0000). -define(VERSION_1, 16#80010000). diff --git a/lib/erl/src/thrift_buffered_transport.erl b/lib/erl/src/thrift_buffered_transport.erl index fda349e4..d4d614eb 100644 --- a/lib/erl/src/thrift_buffered_transport.erl +++ b/lib/erl/src/thrift_buffered_transport.erl @@ -31,7 +31,7 @@ write_buffer % iolist() }). -type state() :: #buffered_transport{}. --include("thrift_transport_impl.hrl"). +-include("thrift_transport_behaviour.hrl"). new(WrappedTransport) -> diff --git a/lib/erl/src/thrift_disk_log_transport.erl b/lib/erl/src/thrift_disk_log_transport.erl index 87d9547a..aceec7f9 100644 --- a/lib/erl/src/thrift_disk_log_transport.erl +++ b/lib/erl/src/thrift_disk_log_transport.erl @@ -36,7 +36,7 @@ sync_every = infinity, sync_tref}). -type state() :: #dl_transport{}. --include("thrift_transport_impl.hrl"). +-include("thrift_transport_behaviour.hrl"). %% Create a transport attached to an already open log. diff --git a/lib/erl/src/thrift_file_transport.erl b/lib/erl/src/thrift_file_transport.erl index 63f2d751..ba3aa898 100644 --- a/lib/erl/src/thrift_file_transport.erl +++ b/lib/erl/src/thrift_file_transport.erl @@ -30,7 +30,7 @@ should_close = true, mode = write}). -type state() :: #t_file_transport{}. --include("thrift_transport_impl.hrl"). +-include("thrift_transport_behaviour.hrl"). %%%% CONSTRUCTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/lib/erl/src/thrift_framed_transport.erl b/lib/erl/src/thrift_framed_transport.erl index dca93118..9b90112c 100644 --- a/lib/erl/src/thrift_framed_transport.erl +++ b/lib/erl/src/thrift_framed_transport.erl @@ -32,7 +32,7 @@ write_buffer % iolist() }). -type state() :: #framed_transport{}. --include("thrift_transport_impl.hrl"). +-include("thrift_transport_behaviour.hrl"). new(WrappedTransport) -> State = #framed_transport{wrapped = WrappedTransport, diff --git a/lib/erl/src/thrift_http_transport.erl b/lib/erl/src/thrift_http_transport.erl index 6345af8e..09113cc2 100644 --- a/lib/erl/src/thrift_http_transport.erl +++ b/lib/erl/src/thrift_http_transport.erl @@ -35,7 +35,7 @@ extra_headers % [{str(), str()}, ...] }). -type state() :: pid(). --include("thrift_transport_impl.hrl"). +-include("thrift_transport_behaviour.hrl"). new(Host, Path) -> new(Host, Path, _Options = []). diff --git a/lib/erl/src/thrift_memory_buffer.erl b/lib/erl/src/thrift_memory_buffer.erl index afad0781..c44449ec 100644 --- a/lib/erl/src/thrift_memory_buffer.erl +++ b/lib/erl/src/thrift_memory_buffer.erl @@ -29,7 +29,7 @@ -record(memory_buffer, {buffer}). -type state() :: #memory_buffer{}. --include("thrift_transport_impl.hrl"). +-include("thrift_transport_behaviour.hrl"). new() -> State = #memory_buffer{buffer = []}, diff --git a/lib/erl/src/thrift_protocol.erl b/lib/erl/src/thrift_protocol.erl index e82858a8..067a5a14 100644 --- a/lib/erl/src/thrift_protocol.erl +++ b/lib/erl/src/thrift_protocol.erl @@ -117,7 +117,7 @@ read(IProto0, {struct, Structure}, Tag) {IProto2, {ok, RTuple2}}. -%% NOTE: Keep this in sync with thrift_protocol_impl:read +%% 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}}; @@ -172,7 +172,7 @@ read(IProto0, {set, Type}) -> read(Protocol, ProtocolType) -> read_specific(Protocol, ProtocolType). -%% NOTE: Keep this in sync with thrift_protocol_impl:read +%% NOTE: Keep this in sync with thrift_protocol_behaviour:read -spec read_specific (#protocol{}, tprot_empty_tag()) -> {#protocol{}, ok | {error, _Reason}}; (#protocol{}, tprot_header_tag()) -> {#protocol{}, tprot_header_val() | {error, _Reason}}; diff --git a/lib/erl/src/thrift_socket_transport.erl b/lib/erl/src/thrift_socket_transport.erl index 4c552ae3..5e1ef026 100644 --- a/lib/erl/src/thrift_socket_transport.erl +++ b/lib/erl/src/thrift_socket_transport.erl @@ -30,7 +30,7 @@ -record(data, {socket, recv_timeout=infinity}). -type state() :: #data{}. --include("thrift_transport_impl.hrl"). +-include("thrift_transport_behaviour.hrl"). new(Socket) -> new(Socket, []). diff --git a/lib/erl/src/thrift_transport_state_test.erl b/lib/erl/src/thrift_transport_state_test.erl index e97b34ce..e83a44d2 100644 --- a/lib/erl/src/thrift_transport_state_test.erl +++ b/lib/erl/src/thrift_transport_state_test.erl @@ -37,7 +37,7 @@ counter :: pid() }). -type state() :: #trans{}. --include("thrift_transport_impl.hrl"). +-include("thrift_transport_behaviour.hrl"). -record(state, {cversion :: integer()}). -- 2.17.1