diff options
author | Björn Gustavsson <[email protected]> | 2014-02-20 14:29:57 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2014-02-21 12:20:39 +0100 |
commit | e5c71b7f176393cdb3f6b9d17a5969e9bd89c88b (patch) | |
tree | 0ae4680c17b76f776fdcaf33233a264503083a54 | |
parent | 687d9c05f94e807537ee397157b68653d1ddf231 (diff) | |
download | otp-e5c71b7f176393cdb3f6b9d17a5969e9bd89c88b.tar.gz otp-e5c71b7f176393cdb3f6b9d17a5969e9bd89c88b.tar.bz2 otp-e5c71b7f176393cdb3f6b9d17a5969e9bd89c88b.zip |
Deprecate asn1 functions
Those asn1 functions are no longer needed because they all have
better alternatives.
-rw-r--r-- | bootstrap/lib/stdlib/ebin/otp_internal.beam | bin | 10140 -> 10436 bytes | |||
-rw-r--r-- | lib/asn1/src/asn1ct.erl | 4 | ||||
-rw-r--r-- | lib/asn1/src/asn1ct_value.erl | 1 | ||||
-rw-r--r-- | lib/asn1/src/asn1rt.erl | 3 | ||||
-rw-r--r-- | lib/eldap/src/eldap.erl | 4 | ||||
-rw-r--r-- | lib/megaco/src/binary/megaco_binary_encoder_lib.erl | 8 | ||||
-rw-r--r-- | lib/stdlib/src/otp_internal.erl | 18 |
7 files changed, 30 insertions, 8 deletions
diff --git a/bootstrap/lib/stdlib/ebin/otp_internal.beam b/bootstrap/lib/stdlib/ebin/otp_internal.beam Binary files differindex de1c007a77..1146ef9ab8 100644 --- a/bootstrap/lib/stdlib/ebin/otp_internal.beam +++ b/bootstrap/lib/stdlib/ebin/otp_internal.beam diff --git a/lib/asn1/src/asn1ct.erl b/lib/asn1/src/asn1ct.erl index 30f493a2df..9ec43197bf 100644 --- a/lib/asn1/src/asn1ct.erl +++ b/lib/asn1/src/asn1ct.erl @@ -19,6 +19,10 @@ %% %% -module(asn1ct). +-deprecated([decode/3,encode/3]). +-compile([{nowarn_deprecated_function,{asn1rt,decode,3}}, + {nowarn_deprecated_function,{asn1rt,encode,2}}, + {nowarn_deprecated_function,{asn1rt,encode,3}}]). %% Compile Time functions for ASN.1 (e.g ASN.1 compiler). diff --git a/lib/asn1/src/asn1ct_value.erl b/lib/asn1/src/asn1ct_value.erl index be8b967cf0..221cd991a7 100644 --- a/lib/asn1/src/asn1ct_value.erl +++ b/lib/asn1/src/asn1ct_value.erl @@ -18,6 +18,7 @@ %% %% -module(asn1ct_value). +-compile([{nowarn_deprecated_function,{asn1rt,utf8_list_to_binary,1}}]). %% Generate Erlang values for ASN.1 types. %% The value is randomized within it's constraints diff --git a/lib/asn1/src/asn1rt.erl b/lib/asn1/src/asn1rt.erl index d18f81346a..ad8b879c38 100644 --- a/lib/asn1/src/asn1rt.erl +++ b/lib/asn1/src/asn1rt.erl @@ -18,14 +18,13 @@ %% %% -module(asn1rt). +-deprecated(module). %% Runtime functions for ASN.1 (i.e encode, decode) -export([encode/2,encode/3,decode/3,load_driver/0,unload_driver/0,info/1]). -export([utf8_binary_to_list/1,utf8_list_to_binary/1]). - --deprecated([load_driver/0,unload_driver/0]). encode(Module,{Type,Term}) -> encode(Module,Type,Term). diff --git a/lib/eldap/src/eldap.erl b/lib/eldap/src/eldap.erl index af5bf94c97..a86fd39adb 100644 --- a/lib/eldap/src/eldap.erl +++ b/lib/eldap/src/eldap.erl @@ -743,7 +743,7 @@ request(S, Data, ID, Request) -> send_request(S, Data, ID, Request) -> Message = #'LDAPMessage'{messageID = ID, protocolOp = Request}, - {ok,Bytes} = asn1rt:encode('ELDAPv3', 'LDAPMessage', Message), + {ok,Bytes} = 'ELDAPv3':encode('LDAPMessage', Message), case do_send(S, Data, Bytes) of {error,Reason} -> throw({gen_tcp_error,Reason}); Else -> Else @@ -762,7 +762,7 @@ do_recv(S, #eldap{using_tls=true, timeout=Timeout}, Len) -> recv_response(S, Data) -> case do_recv(S, Data, 0) of {ok, Packet} -> - case asn1rt:decode('ELDAPv3', 'LDAPMessage', Packet) of + case 'ELDAPv3':decode('LDAPMessage', Packet) of {ok,Resp} -> {ok,Resp}; Error -> throw(Error) end; diff --git a/lib/megaco/src/binary/megaco_binary_encoder_lib.erl b/lib/megaco/src/binary/megaco_binary_encoder_lib.erl index 8a4f4e7509..7d82262a59 100644 --- a/lib/megaco/src/binary/megaco_binary_encoder_lib.erl +++ b/lib/megaco/src/binary/megaco_binary_encoder_lib.erl @@ -66,7 +66,7 @@ version_of(_EC, Binary, 3, [AsnModV1, AsnModV2, AsnModV3]) version_of([], _Binary, Err) -> {error, {decode_failed, lists:reverse(Err)}}; version_of([AsnMod|AsnMods], Binary, Errs) when is_atom(AsnMod) -> - case (catch asn1rt:decode(AsnMod, 'MegacoMessage', Binary)) of + case (catch AsnMod:decode('MegacoMessage', Binary)) of {ok, M} -> V = (M#'MegacoMessage'.mess)#'Message'.version, {ok, V}; @@ -82,14 +82,14 @@ version_of([AsnMod|AsnMods], Binary, Errs) when is_atom(AsnMod) -> encode_message([native], MegaMsg, AsnMod, _TransMod, binary) when is_record(MegaMsg, 'MegacoMessage') -> - asn1rt:encode(AsnMod, 'MegacoMessage', MegaMsg); + AsnMod:encode('MegacoMessage', MegaMsg); encode_message(EC, MegaMsg, AsnMod, TransMod, binary) when is_list(EC) andalso is_record(MegaMsg, 'MegacoMessage') -> case (catch TransMod:tr_message(MegaMsg, encode, EC)) of {'EXIT', Reason} -> {error, Reason}; MegaMsg2 -> - asn1rt:encode(AsnMod, 'MegacoMessage', MegaMsg2) + AsnMod:encode('MegacoMessage', MegaMsg2) end; encode_message(EC, MegaMsg, AsnMod, TransMod, io_list) -> case encode_message(EC, MegaMsg, AsnMod, TransMod, binary) of @@ -276,7 +276,7 @@ decode_message_dynamic(_EC, _BadBin, _Mods, _Type) -> decode_message(EC, Bin, AsnMod, TransMod, _) -> - case asn1rt:decode(AsnMod, 'MegacoMessage', Bin) of + case AsnMod:decode('MegacoMessage', Bin) of {ok, MegaMsg} -> case EC of [native] -> diff --git a/lib/stdlib/src/otp_internal.erl b/lib/stdlib/src/otp_internal.erl index cebc9c91bd..380bc3eccc 100644 --- a/lib/stdlib/src/otp_internal.erl +++ b/lib/stdlib/src/otp_internal.erl @@ -577,6 +577,24 @@ obsolete_1(wxCursor, new, 3) -> obsolete_1(wxCursor, new, 4) -> {deprecated,"deprecated function not available in wxWidgets-2.9 and later"}; +%% Added in OTP 17. +obsolete_1(asn1ct, decode,3) -> + {deprecated,"deprecated; use Mod:decode/2 instead"}; +obsolete_1(asn1ct, encode, 3) -> + {deprecated,"deprecated; use Mod:encode/2 instead"}; +obsolete_1(asn1rt, decode,3) -> + {deprecated,"deprecated; use Mod:decode/2 instead"}; +obsolete_1(asn1rt, encode, 2) -> + {deprecated,"deprecated; use Mod:encode/2 instead"}; +obsolete_1(asn1rt, encode, 3) -> + {deprecated,"deprecated; use Mod:encode/2 instead"}; +obsolete_1(asn1rt, info, 1) -> + {deprecated,"deprecated; use Mod:info/0 instead"}; +obsolete_1(asn1rt, utf8_binary_to_list, 1) -> + {deprecated,{unicode,characters_to_list,1}}; +obsolete_1(asn1rt, utf8_list_to_binary, 1) -> + {deprecated,{unicode,characters_to_binary,1}}; + obsolete_1(_, _, _) -> no. |