diff options
author | Micael Karlberg <[email protected]> | 2011-03-17 12:24:59 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-03-17 12:24:59 +0100 |
commit | ffb2d69e00ef283eeb266f3082067429b6ce1127 (patch) | |
tree | 134573a992cfcc23dad544eae9c5650f97d0e208 /lib/kernel/src/erl_ddll.erl | |
parent | bf6a8c53023a284b9f2de8d13538db1ab3ff8dee (diff) | |
parent | f861b4fdb3fd39e35f2951c53a73b30a98c7f973 (diff) | |
download | otp-ffb2d69e00ef283eeb266f3082067429b6ce1127.tar.gz otp-ffb2d69e00ef283eeb266f3082067429b6ce1127.tar.bz2 otp-ffb2d69e00ef283eeb266f3082067429b6ce1127.zip |
Merge branch 'dev' into bmk/inets/httpd/prevent_xss_in_error_pages/OTP-9124
Diffstat (limited to 'lib/kernel/src/erl_ddll.erl')
-rw-r--r-- | lib/kernel/src/erl_ddll.erl | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/lib/kernel/src/erl_ddll.erl b/lib/kernel/src/erl_ddll.erl index 88f91de24f..ce64589a29 100644 --- a/lib/kernel/src/erl_ddll.erl +++ b/lib/kernel/src/erl_ddll.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1997-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 1997-2011. 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 %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %% Dynamic Driver Loader and Linker @@ -29,6 +29,11 @@ %%---------------------------------------------------------------------------- +-type path() :: string() | atom(). +-type driver() :: string() | atom(). + +%%---------------------------------------------------------------------------- + -spec start() -> {'error', {'already_started', 'undefined'}}. start() -> @@ -39,13 +44,13 @@ start() -> stop() -> ok. --spec load_driver(Path :: string() | atom(), Driver :: string() | atom()) -> +-spec load_driver(Path :: path(), Driver :: driver()) -> 'ok' | {'error', any()}. load_driver(Path, Driver) -> do_load_driver(Path, Driver, [{driver_options,[kill_ports]}]). --spec load(Path :: string() | atom(), Driver :: string() | atom()) -> +-spec load(Path :: path(), Driver :: driver()) -> 'ok' | {'error', any()}. load(Path, Driver) -> @@ -95,23 +100,23 @@ do_unload_driver(Driver,Flags) -> end end. --spec unload_driver(Driver :: string() | atom()) -> 'ok' | {'error', any()}. +-spec unload_driver(Driver :: driver()) -> 'ok' | {'error', any()}. unload_driver(Driver) -> do_unload_driver(Driver,[{monitor,pending_driver},kill_ports]). --spec unload(Driver :: string() | atom()) -> 'ok' | {'error', any()}. +-spec unload(Driver :: driver()) -> 'ok' | {'error', any()}. unload(Driver) -> do_unload_driver(Driver,[]). --spec reload(Path :: string() | atom(), Driver :: string() | atom()) -> +-spec reload(Path :: path(), Driver :: driver()) -> 'ok' | {'error', any()}. reload(Path,Driver) -> do_load_driver(Path, Driver, [{reload,pending_driver}]). --spec reload_driver(Path :: string() | atom(), Driver :: string() | atom()) -> +-spec reload_driver(Path :: path(), Driver :: driver()) -> 'ok' | {'error', any()}. reload_driver(Path,Driver) -> @@ -122,15 +127,15 @@ reload_driver(Path,Driver) -> format_error(Code) -> case Code of - % This is the only error code returned only from erlang code... - % 'permanent' has a translation in the emulator, even though the erlang code uses it to... + %% This is the only error code returned only from erlang code... + %% 'permanent' has a translation in the emulator, even though the erlang code uses it to... load_cancelled -> "Loading was cancelled from other process"; _ -> erl_ddll:format_error_int(Code) end. --spec info(Driver :: string() | atom()) -> [{atom(), any()}]. +-spec info(Driver :: driver()) -> [{atom(), any()}, ...]. info(Driver) -> [{processes, erl_ddll:info(Driver,processes)}, |