aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/unicode.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2012-01-31 15:46:47 +0100
committerHans Bolinder <[email protected]>2012-01-31 15:46:47 +0100
commit0c03cc0b8df68f1531947e0c117e9606ad3daf08 (patch)
tree21276fdb89ee105def771732262c344e4ade78f6 /lib/stdlib/src/unicode.erl
parent8c9975b642c3f3eb76eaa5ea5964226ac1e4600b (diff)
parent037150979ff809df85757bd2b3f676e2e4c6be88 (diff)
downloadotp-0c03cc0b8df68f1531947e0c117e9606ad3daf08.tar.gz
otp-0c03cc0b8df68f1531947e0c117e9606ad3daf08.tar.bz2
otp-0c03cc0b8df68f1531947e0c117e9606ad3daf08.zip
Merge branch 'hb/bif_specs/OTP-9862'
* hb/bif_specs/OTP-9862: Move types and specs from erl_bif_types.erl to modules
Diffstat (limited to 'lib/stdlib/src/unicode.erl')
-rw-r--r--lib/stdlib/src/unicode.erl48
1 files changed, 40 insertions, 8 deletions
diff --git a/lib/stdlib/src/unicode.erl b/lib/stdlib/src/unicode.erl
index e9b90befe6..8b9412fb1b 100644
--- a/lib/stdlib/src/unicode.erl
+++ b/lib/stdlib/src/unicode.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -18,13 +18,6 @@
%%
-module(unicode).
-%% Implemented in the emulator:
-%% characters_to_binary/2 (will trap to characters_to_binary_int/2
-%% if InEncoding is not {latin1 | unicode | utf8})
-%% characters_to_list/2 (will trap to characters_to_list_int/2 if
-%% InEncoding is not {latin1 | unicode | utf8})
-%%
-
-export([characters_to_list/1, characters_to_list_int/2,
characters_to_binary/1, characters_to_binary_int/2,
characters_to_binary/3,
@@ -52,6 +45,45 @@
-type latin1_charlist() :: [latin1_char() | latin1_binary()
| latin1_charlist()].
+%%% BIFs
+%%%
+%%% characters_to_binary/2 (will trap to characters_to_binary_int/2
+%%% if InEncoding is not {latin1 | unicode | utf8})
+%%% characters_to_list/2 (will trap to characters_to_list_int/2 if
+%%% InEncoding is not {latin1 | unicode | utf8})
+
+-export([bin_is_7bit/1, characters_to_binary/2, characters_to_list/2]).
+
+-spec bin_is_7bit(Binary) -> boolean() when
+ Binary :: binary().
+
+bin_is_7bit(_) ->
+ erlang:nif_error(undef).
+
+-spec characters_to_binary(Data, InEncoding) -> Result when
+ Data :: latin1_chardata() | chardata() | external_chardata(),
+ InEncoding :: encoding(),
+ Result :: binary()
+ | {error, binary(), RestData}
+ | {incomplete, binary(), binary()},
+ RestData :: latin1_chardata() | chardata() | external_chardata().
+
+characters_to_binary(_, _) ->
+ erlang:nif_error(undef).
+
+-spec characters_to_list(Data, InEncoding) -> Result when
+ Data :: latin1_chardata() | chardata() | external_chardata(),
+ InEncoding :: encoding(),
+ Result :: list()
+ | {error, list(), RestData}
+ | {incomplete, list(), binary()},
+ RestData :: latin1_chardata() | chardata() | external_chardata().
+
+characters_to_list(_, _) ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs
+
-spec characters_to_list(Data) -> Result when
Data :: latin1_chardata() | chardata() | external_chardata(),
Result :: list()