aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/file.erl
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2010-02-14 17:08:05 +0200
committerBjörn Gustavsson <[email protected]>2010-03-07 13:26:35 +0100
commit8fef4ffec7245102407ccf73afb5c5c4a42a4ee3 (patch)
treeb82ef911624292f28bbf9cf480dd9ae98e099dfd /lib/kernel/src/file.erl
parentda70b2b0eca09f572e3275240ba60f1da6b679c4 (diff)
downloadotp-8fef4ffec7245102407ccf73afb5c5c4a42a4ee3.tar.gz
otp-8fef4ffec7245102407ccf73afb5c5c4a42a4ee3.tar.bz2
otp-8fef4ffec7245102407ccf73afb5c5c4a42a4ee3.zip
file.hrl: Move out type declarations
Having various type declarations in the file.hrl file was once upon a time necessary since the system could not really handle remote types. Now it can and these declarations should not be there but appear in file.erl instead. This means that files that need to use these types can refer to them using a remote type reference, and not having to include file.hrl - at least not for this reason.
Diffstat (limited to 'lib/kernel/src/file.erl')
-rw-r--r--lib/kernel/src/file.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl
index a42771dfb6..46ffa9d708 100644
--- a/lib/kernel/src/file.erl
+++ b/lib/kernel/src/file.erl
@@ -74,15 +74,22 @@
%% data types
-type filename() :: string().
-type file_info() :: #file_info{}.
--type io_device() :: pid() | #file_descriptor{}.
+-type fd() :: #file_descriptor{}.
+-type io_device() :: pid() | fd().
-type location() :: integer() | {'bof', integer()} | {'cur', integer()}
| {'eof', integer()} | 'bof' | 'cur' | 'eof'.
-type mode() :: 'read' | 'write' | 'append' | 'raw' | 'binary' |
{'delayed_write', non_neg_integer(), non_neg_integer()} |
'delayed_write' | {'read_ahead', pos_integer()} |
'read_ahead' | 'compressed'.
+-type name() :: string() | atom() | [name()].
+-type posix() :: atom().
-type bindings() :: any().
+-type date() :: {pos_integer(), pos_integer(), pos_integer()}.
+-type time() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()}.
+-type date_time() :: {date(), time()}.
+
%%%-----------------------------------------------------------------
%%% General functions