From f4e729703f8fa173a050d4f4e503b7f17c7f209d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 20 May 2011 15:59:05 +0200 Subject: Update preloaded modules --- erts/preloaded/ebin/erl_prim_loader.beam | Bin 50384 -> 50392 bytes erts/preloaded/ebin/erlang.beam | Bin 24144 -> 24148 bytes erts/preloaded/ebin/init.beam | Bin 44876 -> 44880 bytes erts/preloaded/ebin/otp_ring0.beam | Bin 1432 -> 1436 bytes erts/preloaded/ebin/prim_file.beam | Bin 31528 -> 31528 bytes erts/preloaded/ebin/prim_inet.beam | Bin 64888 -> 64892 bytes erts/preloaded/ebin/prim_zip.beam | Bin 22432 -> 22444 bytes erts/preloaded/ebin/zlib.beam | Bin 10616 -> 10620 bytes 8 files changed, 0 insertions(+), 0 deletions(-) (limited to 'erts') diff --git a/erts/preloaded/ebin/erl_prim_loader.beam b/erts/preloaded/ebin/erl_prim_loader.beam index bff3f7f9de..dccb92a5af 100644 Binary files a/erts/preloaded/ebin/erl_prim_loader.beam and b/erts/preloaded/ebin/erl_prim_loader.beam differ diff --git a/erts/preloaded/ebin/erlang.beam b/erts/preloaded/ebin/erlang.beam index 5d2f187435..b537546071 100644 Binary files a/erts/preloaded/ebin/erlang.beam and b/erts/preloaded/ebin/erlang.beam differ diff --git a/erts/preloaded/ebin/init.beam b/erts/preloaded/ebin/init.beam index 7e492057da..901def5eba 100644 Binary files a/erts/preloaded/ebin/init.beam and b/erts/preloaded/ebin/init.beam differ diff --git a/erts/preloaded/ebin/otp_ring0.beam b/erts/preloaded/ebin/otp_ring0.beam index c443866671..62ebbb9ffe 100644 Binary files a/erts/preloaded/ebin/otp_ring0.beam and b/erts/preloaded/ebin/otp_ring0.beam differ diff --git a/erts/preloaded/ebin/prim_file.beam b/erts/preloaded/ebin/prim_file.beam index bfb1e48365..66fcb9e6a9 100644 Binary files a/erts/preloaded/ebin/prim_file.beam and b/erts/preloaded/ebin/prim_file.beam differ diff --git a/erts/preloaded/ebin/prim_inet.beam b/erts/preloaded/ebin/prim_inet.beam index 30bbfb0943..9894050cba 100644 Binary files a/erts/preloaded/ebin/prim_inet.beam and b/erts/preloaded/ebin/prim_inet.beam differ diff --git a/erts/preloaded/ebin/prim_zip.beam b/erts/preloaded/ebin/prim_zip.beam index 6681466767..9ee70d59ec 100644 Binary files a/erts/preloaded/ebin/prim_zip.beam and b/erts/preloaded/ebin/prim_zip.beam differ diff --git a/erts/preloaded/ebin/zlib.beam b/erts/preloaded/ebin/zlib.beam index 593bb8dbed..542e266f88 100644 Binary files a/erts/preloaded/ebin/zlib.beam and b/erts/preloaded/ebin/zlib.beam differ -- cgit v1.2.3 From ad5a1519e74d79218c0dd2ef79a39d75bd0155bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Fri, 20 May 2011 16:11:43 +0200 Subject: Update copyright years --- erts/aclocal.m4 | 2 +- erts/doc/src/driver.xml | 2 +- erts/doc/src/epmd.xml | 2 +- erts/doc/src/erl_driver.xml | 2 +- erts/doc/src/init.xml | 2 +- erts/doc/src/run_erl.xml | 2 +- erts/emulator/Makefile.in | 2 +- erts/emulator/beam/atom.names | 2 +- erts/emulator/beam/erl_async.c | 2 +- erts/emulator/beam/erl_bits.c | 2 +- erts/emulator/beam/erl_driver.h | 2 +- erts/emulator/beam/erl_port_task.c | 2 +- erts/emulator/beam/erl_printf_term.h | 2 +- erts/emulator/beam/erl_unicode.c | 2 +- erts/emulator/beam/ops.tab | 2 +- erts/emulator/beam/safe_hash.c | 2 +- erts/emulator/hipe/hipe_bif64.c | 2 +- erts/emulator/hipe/hipe_bif64.h | 2 +- erts/emulator/hipe/hipe_bif64.tab | 2 +- erts/emulator/sys/common/erl_check_io.c | 2 +- erts/emulator/sys/common/erl_mseg.h | 2 +- erts/emulator/test/nif_SUITE_data/nif_SUITE.c | 2 +- erts/epmd/src/epmd.c | 2 +- erts/etc/common/erlexec.c | 2 +- erts/etc/common/inet_gethost.c | 2 +- erts/etc/unix/to_erl.c | 2 +- erts/etc/win32/erlsrv/erlsrv_service.c | 2 +- erts/example/next_perm.cc | 2 +- erts/include/internal/erl_printf_format.h | 2 +- erts/include/internal/libatomic_ops/ethr_atomic.h | 2 +- erts/include/internal/sparc32/atomic.h | 2 +- erts/include/internal/tile/atomic.h | 2 +- erts/lib_src/common/erl_misc_utils.c | 2 +- erts/preloaded/src/prim_file.erl | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) (limited to 'erts') diff --git a/erts/aclocal.m4 b/erts/aclocal.m4 index f7e5c31910..b64380e817 100644 --- a/erts/aclocal.m4 +++ b/erts/aclocal.m4 @@ -1,7 +1,7 @@ dnl dnl %CopyrightBegin% dnl -dnl Copyright Ericsson AB 1998-2010. All Rights Reserved. +dnl Copyright Ericsson AB 1998-2011. All Rights Reserved. dnl dnl The contents of this file are subject to the Erlang Public License, dnl Version 1.1, (the "License"); you may not use this file except in diff --git a/erts/doc/src/driver.xml b/erts/doc/src/driver.xml index 2b1ed398ee..9f246c4a6c 100644 --- a/erts/doc/src/driver.xml +++ b/erts/doc/src/driver.xml @@ -4,7 +4,7 @@
- 20012010 + 20012011 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/epmd.xml b/erts/doc/src/epmd.xml index 8c3c1e5237..411e627c85 100644 --- a/erts/doc/src/epmd.xml +++ b/erts/doc/src/epmd.xml @@ -4,7 +4,7 @@
- 19962010 + 19962011 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index 066a2a4b92..2fb03954b6 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -4,7 +4,7 @@
- 20012010 + 20012011 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/init.xml b/erts/doc/src/init.xml index 0e828389f6..b0d0cda4fa 100644 --- a/erts/doc/src/init.xml +++ b/erts/doc/src/init.xml @@ -4,7 +4,7 @@
- 19962009 + 19962011 Ericsson AB. All Rights Reserved. diff --git a/erts/doc/src/run_erl.xml b/erts/doc/src/run_erl.xml index da08859c7b..c9784299b3 100644 --- a/erts/doc/src/run_erl.xml +++ b/erts/doc/src/run_erl.xml @@ -4,7 +4,7 @@
- 19992009 + 19992011 Ericsson AB. All Rights Reserved. diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in index c9076a9d64..d9362a2a8f 100644 --- a/erts/emulator/Makefile.in +++ b/erts/emulator/Makefile.in @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1996-2010. All Rights Reserved. +# Copyright Ericsson AB 1996-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 diff --git a/erts/emulator/beam/atom.names b/erts/emulator/beam/atom.names index de76cb9680..68d64fb7b0 100644 --- a/erts/emulator/beam/atom.names +++ b/erts/emulator/beam/atom.names @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1996-2010. All Rights Reserved. +# Copyright Ericsson AB 1996-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 diff --git a/erts/emulator/beam/erl_async.c b/erts/emulator/beam/erl_async.c index a920bd2c8c..91b64411d4 100644 --- a/erts/emulator/beam/erl_async.c +++ b/erts/emulator/beam/erl_async.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2000-2010. All Rights Reserved. + * Copyright Ericsson AB 2000-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 diff --git a/erts/emulator/beam/erl_bits.c b/erts/emulator/beam/erl_bits.c index 0174e5fc43..e56084b9cb 100644 --- a/erts/emulator/beam/erl_bits.c +++ b/erts/emulator/beam/erl_bits.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1999-2010. All Rights Reserved. + * Copyright Ericsson AB 1999-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 diff --git a/erts/emulator/beam/erl_driver.h b/erts/emulator/beam/erl_driver.h index 069b71ab0d..401967a8de 100644 --- a/erts/emulator/beam/erl_driver.h +++ b/erts/emulator/beam/erl_driver.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1999-2010. All Rights Reserved. + * Copyright Ericsson AB 1999-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 diff --git a/erts/emulator/beam/erl_port_task.c b/erts/emulator/beam/erl_port_task.c index 326021643f..e6b55c45e4 100644 --- a/erts/emulator/beam/erl_port_task.c +++ b/erts/emulator/beam/erl_port_task.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2006-2010. All Rights Reserved. + * Copyright Ericsson AB 2006-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 diff --git a/erts/emulator/beam/erl_printf_term.h b/erts/emulator/beam/erl_printf_term.h index 4ba22f12de..a48a3de34c 100644 --- a/erts/emulator/beam/erl_printf_term.h +++ b/erts/emulator/beam/erl_printf_term.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2005-2009. All Rights Reserved. + * Copyright Ericsson AB 2005-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 diff --git a/erts/emulator/beam/erl_unicode.c b/erts/emulator/beam/erl_unicode.c index dacf228e92..158eb361a4 100644 --- a/erts/emulator/beam/erl_unicode.c +++ b/erts/emulator/beam/erl_unicode.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2008-2010. All Rights Reserved. + * Copyright Ericsson AB 2008-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 diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 6caa1e0b2d..8a5763b4bb 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1997-2010. 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 diff --git a/erts/emulator/beam/safe_hash.c b/erts/emulator/beam/safe_hash.c index 3e9243c77d..4c54e19cdb 100644 --- a/erts/emulator/beam/safe_hash.c +++ b/erts/emulator/beam/safe_hash.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2008-2009. All Rights Reserved. + * Copyright Ericsson AB 2008-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 diff --git a/erts/emulator/hipe/hipe_bif64.c b/erts/emulator/hipe/hipe_bif64.c index 73784fc1e8..baaf5af2cd 100644 --- a/erts/emulator/hipe/hipe_bif64.c +++ b/erts/emulator/hipe/hipe_bif64.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2010. All Rights Reserved. + * Copyright Ericsson AB 2001-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 diff --git a/erts/emulator/hipe/hipe_bif64.h b/erts/emulator/hipe/hipe_bif64.h index 9fd6b79605..6d494886ec 100644 --- a/erts/emulator/hipe/hipe_bif64.h +++ b/erts/emulator/hipe/hipe_bif64.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2001-2009. All Rights Reserved. + * Copyright Ericsson AB 2001-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 diff --git a/erts/emulator/hipe/hipe_bif64.tab b/erts/emulator/hipe/hipe_bif64.tab index 6e663cfd35..228318af39 100644 --- a/erts/emulator/hipe/hipe_bif64.tab +++ b/erts/emulator/hipe/hipe_bif64.tab @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 2004-2009. All Rights Reserved. +# Copyright Ericsson AB 2004-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 diff --git a/erts/emulator/sys/common/erl_check_io.c b/erts/emulator/sys/common/erl_check_io.c index 71b374527e..cd4de21d65 100644 --- a/erts/emulator/sys/common/erl_check_io.c +++ b/erts/emulator/sys/common/erl_check_io.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2006-2009. All Rights Reserved. + * Copyright Ericsson AB 2006-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 diff --git a/erts/emulator/sys/common/erl_mseg.h b/erts/emulator/sys/common/erl_mseg.h index fbb66ee33b..8f116030a8 100644 --- a/erts/emulator/sys/common/erl_mseg.h +++ b/erts/emulator/sys/common/erl_mseg.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2002-2010. All Rights Reserved. + * Copyright Ericsson AB 2002-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 diff --git a/erts/emulator/test/nif_SUITE_data/nif_SUITE.c b/erts/emulator/test/nif_SUITE_data/nif_SUITE.c index dc047394b5..0bb93daa33 100644 --- a/erts/emulator/test/nif_SUITE_data/nif_SUITE.c +++ b/erts/emulator/test/nif_SUITE_data/nif_SUITE.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2009-2010. All Rights Reserved. + * Copyright Ericsson AB 2009-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 diff --git a/erts/epmd/src/epmd.c b/erts/epmd/src/epmd.c index a1f202251c..08576d923f 100644 --- a/erts/epmd/src/epmd.c +++ b/erts/epmd/src/epmd.c @@ -2,7 +2,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * Copyright Ericsson AB 1998-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 diff --git a/erts/etc/common/erlexec.c b/erts/etc/common/erlexec.c index 90d3be9448..7e04724f5a 100644 --- a/erts/etc/common/erlexec.c +++ b/erts/etc/common/erlexec.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2010. All Rights Reserved. + * Copyright Ericsson AB 1996-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 diff --git a/erts/etc/common/inet_gethost.c b/erts/etc/common/inet_gethost.c index 18ccf974aa..77bfd5e2bc 100644 --- a/erts/etc/common/inet_gethost.c +++ b/erts/etc/common/inet_gethost.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2010. All Rights Reserved. + * Copyright Ericsson AB 1998-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 diff --git a/erts/etc/unix/to_erl.c b/erts/etc/unix/to_erl.c index b7c3c956c6..11fa3ff4cc 100644 --- a/erts/etc/unix/to_erl.c +++ b/erts/etc/unix/to_erl.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1996-2009. All Rights Reserved. + * Copyright Ericsson AB 1996-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 diff --git a/erts/etc/win32/erlsrv/erlsrv_service.c b/erts/etc/win32/erlsrv/erlsrv_service.c index 8891379643..242e2905a9 100644 --- a/erts/etc/win32/erlsrv/erlsrv_service.c +++ b/erts/etc/win32/erlsrv/erlsrv_service.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 1998-2009. All Rights Reserved. + * Copyright Ericsson AB 1998-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 diff --git a/erts/example/next_perm.cc b/erts/example/next_perm.cc index 1427cd3979..d7c8f1ad97 100644 --- a/erts/example/next_perm.cc +++ b/erts/example/next_perm.cc @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2006-2009. All Rights Reserved. + * Copyright Ericsson AB 2006-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 diff --git a/erts/include/internal/erl_printf_format.h b/erts/include/internal/erl_printf_format.h index 400cc7dafd..064c4a5c09 100644 --- a/erts/include/internal/erl_printf_format.h +++ b/erts/include/internal/erl_printf_format.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2005-2009. All Rights Reserved. + * Copyright Ericsson AB 2005-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 diff --git a/erts/include/internal/libatomic_ops/ethr_atomic.h b/erts/include/internal/libatomic_ops/ethr_atomic.h index 2fc82c99a8..93bc06036f 100644 --- a/erts/include/internal/libatomic_ops/ethr_atomic.h +++ b/erts/include/internal/libatomic_ops/ethr_atomic.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2010. All Rights Reserved. + * Copyright Ericsson AB 2010-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 diff --git a/erts/include/internal/sparc32/atomic.h b/erts/include/internal/sparc32/atomic.h index 16182f8b01..c297522ab1 100644 --- a/erts/include/internal/sparc32/atomic.h +++ b/erts/include/internal/sparc32/atomic.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2005-2010. All Rights Reserved. + * Copyright Ericsson AB 2005-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 diff --git a/erts/include/internal/tile/atomic.h b/erts/include/internal/tile/atomic.h index 0c7b597a6b..5697afda25 100644 --- a/erts/include/internal/tile/atomic.h +++ b/erts/include/internal/tile/atomic.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2008-2010. All Rights Reserved. + * Copyright Ericsson AB 2008-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 diff --git a/erts/lib_src/common/erl_misc_utils.c b/erts/lib_src/common/erl_misc_utils.c index ec729407bb..5dbf98c7d1 100644 --- a/erts/lib_src/common/erl_misc_utils.c +++ b/erts/lib_src/common/erl_misc_utils.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2006-2010. All Rights Reserved. + * Copyright Ericsson AB 2006-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 diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl index 13e8e8fb5b..8e0790e74a 100644 --- a/erts/preloaded/src/prim_file.erl +++ b/erts/preloaded/src/prim_file.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2010. All Rights Reserved. +%% Copyright Ericsson AB 2000-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 -- cgit v1.2.3 From 4a5a75811e2cd590b5c94f71864a5245fd511ccf Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Tue, 24 May 2011 13:16:24 +0200 Subject: Prepare release --- erts/doc/src/notes.xml | 351 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 351 insertions(+) (limited to 'erts') diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml index 7383ea381d..3733fb2db9 100644 --- a/erts/doc/src/notes.xml +++ b/erts/doc/src/notes.xml @@ -30,6 +30,357 @@

This document describes the changes made to the ERTS application.

+
Erts 5.8.4 + +
Fixed Bugs and Malfunctions + + +

Fix binary and iolist overflow problems. Typically + problems arose in length calculation where the result + would exceed (1 bsl 32 - 1).

+

+ Own Id: OTP-9118

+
+ +

+ Using the old erlang shell (i.e. erl instead on werl) on + windows and doing several init:restart's would eventually + hang the VM. That is no longer the case.

+

+ Own Id: OTP-9139

+
+ +

+ Removed recursive C code when printing Erlang terms to + buffers, avoiding stack overflows that could cause VM to + crash.

+

+ Own Id: OTP-9140

+
+ +

+ The send_timeout option in gen_tcp did not work properly + in active mode or with {active,once} options. This is now + corrected.

+

+ Own Id: OTP-9145

+
+ +

+ Fixed various typos across the documentation (Thanks to + Tuncer Ayaz)

+

+ Own Id: OTP-9154

+
+ +

Remove duplicate stack entries which could occur after + calling certain BIFs.

+

+ Own Id: OTP-9163

+
+ +

+ A race when starting two nodes simultaneously using + run_erl has been removed.

+

+ Own Id: OTP-9164

+
+ +

+ Add documentation on .erlang processing back again + (Thanks to Gabor Liptak)

+

+ Own Id: OTP-9189

+
+ +

+ Remove gratuitous paren in driver_entry(Thanks to Tuncer + Ayaz)

+

+ Own Id: OTP-9192

+
+ +

+ Fix some wrong pointer dereferences (Thanks to Cristian + Greco)

+

+ Own Id: OTP-9194

+
+ +

+ erts: Remove unused variables (Thanks to Tuncer Ayaz)

+

+ Own Id: OTP-9205

+
+ +

+ The documentation for init:get_args/0 has been + removed. init:get_args/0 itself was deprecated in + R9C and removed in R12B. (Thanks to Eric Pailleau.)

+

+ Own Id: OTP-9209

+
+ +

+ Allow user to specify the IP address epmd binds to

+

+ The IP address(es) epmd binds to can now be specified by + the user, either via epmd's new "-address" option or (if + that's not used) by setting the environment variable + ERL_EPMD_ADDRESS. Multiple addresses may be specified + using a comma-separated list. If the loopback address is + not in this list, it will be added implicitly, so that + the daemon can be queried by an interactive epmd + process.(Thanks to Holger Weiß)

+

+ Own Id: OTP-9213

+
+ +

+ epmd: include host address in local access check

+

+ In FreeBSD jails, the source and destination address of + connections to localhost are changed to be the IP address + of the jail. Consider connections from the host's IP + address to itself (e.g., the source and destination + address match) to be local for the access control checks. + (Thanks to Michal Santos and Tom at diogunix.com)

+

+ Own Id: OTP-9214

+
+ +

+ Fix list returned by net_kernel:epmd_module

+

+ Function epmd_module of net_kernel returns a list instead + of an atom, when the epmd_module-flag is used. (Thanks to + Markus Knofe)

+

+ Own Id: OTP-9215

+
+ +

+ Fix epmd's dbg_perror() output

+

+ The dbg_perror() function now hands the current errno + value over to dbg_gen_printf(). This fixes the problem + that errno had been reset to zero by the time it was used + (to print the corresponding error message) in the + dbg_gen_printf() function. (Thanks to Holger Weiß)

+

+ Own Id: OTP-9223

+
+ +

+ heart: remove garbage appended to heart command

+

+ heart:get_cmd/0 is documented to return an empty string + if the command is cleared. get_cmd/0 returns 2 extra + bytes: 1 byte for the trailing null, 1 byte from the op + (the op is an unsigned char and 2 bytes are allocated for + it in the returned buffer). (Thanks to Michael Santos)

+

+ Own Id: OTP-9224

+
+ +

+ file: fix hang reading compressed files

+

+ The gzio driver goes into an infinite loop when reading + past the end of a compressed file. Reported-By: Alex + Morarash (Thanks to Michael Santos)

+

+ Own Id: OTP-9245

+
+ +

Eliminate alias warnings from gcc 4.5.2

+

+ Own Id: OTP-9250

+
+ +

+ Unsigned integer may overflow in error message (Thanks to + Michael Santos)

+

+ Own Id: OTP-9251

+
+ +

+ Driver names should be strings, not atoms

+

+ Own Id: OTP-9253

+
+ +

+ driver_entry: Remove gratuitous paren and fix typo + (Thanks to Tuncer Ayaz)

+

+ Own Id: OTP-9254

+
+ +

+ Fix format specifiers in erl_exit messages

+

+ Fix an error message by using an unsigned integer + specifier as seen in a tweet by @metabrew: #erlang VM + crashed with "no next heap size found: -2090496108, + offset 0", suddenly allocated all available RAM

+

+ Also correct mis-typed string formats in bif.c.(Thanks to + Michael Santos)

+

+ Own Id: OTP-9262

+
+ +

+ net_drv: remove unused tcp request id inet_drv: remove + gratuitous assignment (Thanks to Tuncer Ayaz)

+

+ Own Id: OTP-9263

+
+ +

+ Teach run_erl RUN_ERL_DISABLE_FLOWCNTRL for disabling + flow control

+

+ Flow control can cause unwanted behaviour of the beam + process, if accidentally hit Ctrl-S (instead of Ctrl-D to + detach) the entire beam may be blocked.

+

+ Fix this problem by making it possible to turn off flow + control by setting the environment variable + RUN_ERL_DISABLE_FLOWCNTRL. (Thanks to Jonas Faklkevik)

+

+ Own Id: OTP-9270

+
+ +

The following bugs due to missing memory barriers have + been fixed:

ETS tables using the + write_concurrency option could potentially get + into an internally inconsistent state.

+

ETS tables using the ordered_set option + could potentially get into an internally inconsistent + state.

A number of memory barriers + have been added when building with the + libatomic_ops API (i.e. when passing + --with-libatomic_ops=PATH to configure) and + the tilera atomics API (i.e. when building for the tilera + chip). Note that these bugs were due to erroneous usage + of the APIs, and not in the implementations of the APIs. + When using these APIs the following bugs where + present:

The BIF + erlang:ports/0 could return an erroneous result. +

A thread blocking other threads + during code loading, or setup of tracing could + potentially read invalid data.

+ Fixation of ETS tables could potentially get into an + internally inconsistent state.

+
+

+ Own Id: OTP-9281

+
+ +

+ Fix halfword bug for ETS ordered_set when doing + select/match with partly bound key.

+

+ Own Id: OTP-9292

+
+ +

+ Fix bug in code:is_module_native that caused crash + for deleted modules.

+

+ Own Id: OTP-9298

+
+ +

+ Calling driver_async_cancel() could cause a + scheduler thread to enter an eternal loop doing no useful + work. (Thanks to Anders Ramsell)

+

+ Own Id: OTP-9302

+
+
+
+ + +
Improvements and New Features + + +

+ New enif_is_exception function to allow NIFs to + determine whether an ERL_NIF_TERM represents an + exception. (Thanks to Steve Vinoski)

+

+ Own Id: OTP-9150

+
+ +

+ A process being garbage collected by another process + could be scheduled on another scheduler. This prevented + this scheduler from doing any useful work until the + garbage collection was done. This either occurred due to + a explicit call to the garbage_collect/1 BIF, or + due to a garbage collection part of code loading. A + process being garbage collected like this will now not be + scheduled until the garbage collection has completed.

+

+ Own Id: OTP-9211

+
+ +

+ Remove unnecessary validation copy in + prim_file:drv_command/3 (Thanks to Tony Rogvall)

+

+ Own Id: OTP-9276

+
+ +

+ Symbolic link handling on windows have been slightly + updated to map error conditions more consequently and + correctly read directory links created outside of the + Erlang environment.

+

+ Own Id: OTP-9279

+
+ +

+ Due to standard library DLL mismatches between versions + of OpenSSL and Erlang/OTP, OpenSSL is now linked + statically to the crypto driver on Windows. This fixes + problems starting crypto when running Erlang as a service + on all Windows versions.

+

+ Own Id: OTP-9280

+
+ +

Halfword emulator memory handling improvements:

+

Much more of internal memory structures + have been made able to use "high" memory and are no + longer restricted to the 4Gb limit that still applies for + all process heap data.

Fixed faulty + values from erlang:memory() caused by 32-bit + counter overflow.

New counter + low in erlang:memory() that sums up all + memory restricted by 4Gb limit.

+

+ Own Id: OTP-9291 Aux Id: seq11841

+
+ +

+ The value set in the undocumented and unsupported + ERL_version_FLAGS (e.g. ERL_R14B03_FLAGS) environment + variable can now be overridden by the command line + (similar to ERL_AFLAGS).

+

+ Own Id: OTP-9297

+
+
+
+ +
+
Erts 5.8.3.2
Known Bugs and Problems -- cgit v1.2.3 From f6a77186a608fb08e2ffc65d06c4166b7127e4a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Mon, 30 May 2011 11:53:35 +0200 Subject: Update version numbers --- erts/vsn.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts') diff --git a/erts/vsn.mk b/erts/vsn.mk index 193a914a70..18799d2fba 100644 --- a/erts/vsn.mk +++ b/erts/vsn.mk @@ -17,8 +17,8 @@ # %CopyrightEnd% # -VSN = 5.8.4 -SYSTEM_VSN = R14B03 +VSN = 5.8.5 +SYSTEM_VSN = R14B04 # Port number 4365 in 4.2 # Port number 4366 in 4.3 -- cgit v1.2.3 From 1750b6723b23ddf88694794e6e5eac2cad42e5e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Wei=C3=9F?= Date: Wed, 1 Jun 2011 00:43:16 +0200 Subject: Fix typos in the epmd documentation --- erts/doc/src/epmd.xml | 4 ++-- erts/doc/src/erl.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'erts') diff --git a/erts/doc/src/epmd.xml b/erts/doc/src/epmd.xml index 411e627c85..3e7005410f 100644 --- a/erts/doc/src/epmd.xml +++ b/erts/doc/src/epmd.xml @@ -120,7 +120,7 @@

Let this instance of epmd listen only on the comma-separated list of IP addresses and on the loopback address - (which is implicitely added to the list if it has not been + (which is implicitly added to the list if it has not been specified). This can also be set using the environment variable, see the section Environment @@ -243,7 +243,7 @@

This environment variable may be set to a comma-separated list of IP addresses, in which case the epmd daemon will listen only on the specified address(es) and on the - loopback address (which is implicitely added to the list if it + loopback address (which is implicitly added to the list if it has not been specified). The default behaviour is to listen on all available IP addresses.

diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml index 514ee5ffaf..02082e57c6 100644 --- a/erts/doc/src/erl.xml +++ b/erts/doc/src/erl.xml @@ -1010,7 +1010,7 @@ list of IP addresses, in which case the epmd daemon will listen only on the specified address(es) and on the - loopback address (which is implicitely added to the list if it + loopback address (which is implicitly added to the list if it has not been specified).

-- cgit v1.2.3 From ec62c1c046dd17ae49f9182995a11202924fc750 Mon Sep 17 00:00:00 2001 From: Stavros Aronis Date: Fri, 27 May 2011 14:28:38 +0300 Subject: Replace atom in DRV macro in prim_file with string An experimental version of Dialyzer discovered that the atom that replaced the DRV macro in prim_file ends up in calls to erlang:open_port({spawn, Driver}, Portopts) as the Driver argument. The documentation states that this call requires a string there. This change is also consistent with the one introduced in commit 0f03b1e9d2bef3bc830c31a369261af4c5234727 by Kostis Sagonas. --- erts/preloaded/src/prim_file.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts') diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl index 8e0790e74a..ac7570582e 100644 --- a/erts/preloaded/src/prim_file.erl +++ b/erts/preloaded/src/prim_file.erl @@ -63,7 +63,7 @@ -include("file.hrl"). --define(DRV, efile). +-define(DRV, "efile"). -define(FD_DRV, "efile"). -define(LARGEFILESIZE, (1 bsl 63)). @@ -549,7 +549,7 @@ write_file(_, _) -> %% Returns {ok, Port}, the Port should be used as first argument in all %% the following functions. Returns {error, Reason} upon failure. start() -> - try erlang:open_port({spawn, atom_to_list(?DRV)}, [binary]) of + try erlang:open_port({spawn, ?DRV}, [binary]) of Port -> {ok, Port} catch -- cgit v1.2.3 From a8056b31944c228f16a27034f07ffad59190984e Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Wed, 8 Jun 2011 15:27:30 +0200 Subject: Update preloaded module --- erts/preloaded/ebin/prim_file.beam | Bin 31528 -> 31640 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'erts') diff --git a/erts/preloaded/ebin/prim_file.beam b/erts/preloaded/ebin/prim_file.beam index 66fcb9e6a9..00a1cf065a 100644 Binary files a/erts/preloaded/ebin/prim_file.beam and b/erts/preloaded/ebin/prim_file.beam differ -- cgit v1.2.3 From e751eb8d6e8fd5945d4a14ebbc10b9cd858521e1 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Wed, 8 Jun 2011 11:34:06 +0200 Subject: Make release_handler work with windows services This commit adds test cases from release_handler_SUITE on windows, including some corrections in erlsrv and release_handler. --- erts/etc/win32/Install.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'erts') diff --git a/erts/etc/win32/Install.c b/erts/etc/win32/Install.c index 6e60512f6d..d680b67dd6 100644 --- a/erts/etc/win32/Install.c +++ b/erts/etc/win32/Install.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2003-2010. All Rights Reserved. + * Copyright Ericsson AB 2003-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 @@ -213,6 +213,9 @@ int main(int argc, char **argv) fprintf(stderr,"Cannot continue installation, bailing out.\n"); exit(1); } + + /* OBS!!! If the format of the init file is changed, do not forget + to update release_handler:write_ini_file(...) */ ini_file = create_init_file(); ini_section = create_init_section("erlang"); add_init_section(ini_file,ini_section); -- cgit v1.2.3 From 4bd8ab6298961d564c34172c0a4d74cd08a08249 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 8 Jun 2011 09:23:14 +0200 Subject: Add more specs and types An incorrect spec, rpc:yield/1, has been fixed. --- erts/doc/specs/.gitignore | 1 + erts/doc/src/Makefile | 38 ++- erts/doc/src/erl_prim_loader.xml | 88 ++--- erts/doc/src/erlang.xml | 532 ++++++++++++------------------- erts/doc/src/init.xml | 67 ++-- erts/doc/src/specs.xml | 7 + erts/doc/src/zlib.xml | 311 ++++++------------ erts/preloaded/ebin/erl_prim_loader.beam | Bin 50392 -> 50528 bytes erts/preloaded/ebin/erlang.beam | Bin 24148 -> 27148 bytes erts/preloaded/ebin/init.beam | Bin 44880 -> 45296 bytes erts/preloaded/ebin/zlib.beam | Bin 10620 -> 12148 bytes erts/preloaded/src/erl_prim_loader.erl | 49 ++- erts/preloaded/src/erlang.erl | 142 ++++++++- erts/preloaded/src/init.erl | 31 +- erts/preloaded/src/zlib.erl | 144 +++++++-- 15 files changed, 675 insertions(+), 735 deletions(-) create mode 100644 erts/doc/specs/.gitignore create mode 100644 erts/doc/src/specs.xml (limited to 'erts') diff --git a/erts/doc/specs/.gitignore b/erts/doc/specs/.gitignore new file mode 100644 index 0000000000..322eebcb06 --- /dev/null +++ b/erts/doc/specs/.gitignore @@ -0,0 +1 @@ +specs_*.xml diff --git a/erts/doc/src/Makefile b/erts/doc/src/Makefile index 6578923fe1..cfa5527474 100644 --- a/erts/doc/src/Makefile +++ b/erts/doc/src/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1997-2010. 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 @@ -16,6 +16,9 @@ # # %CopyrightEnd% # + +SPECS_ESRC = ../../preloaded/src/ + include $(ERL_TOP)/make/target.mk include $(ERL_TOP)/make/$(TARGET)/otp.mk @@ -43,6 +46,12 @@ XML_REF1_FILES = epmd.xml \ run_erl.xml \ start.xml +XML_REF3_EFILES = \ + erl_prim_loader.xml \ + erlang.xml \ + init.xml \ + zlib.xml + XML_REF3_FILES = \ driver_entry.xml \ erl_nif.xml \ @@ -98,18 +107,26 @@ HTML_REF_MAN_FILE = $(HTMLDIR)/index.html TOP_PDF_FILE = $(PDFDIR)/$(APPLICATION)-$(VSN).pdf +SPECS_FILES = $(XML_REF3_EFILES:%.xml=$(SPECDIR)/specs_%.xml) + +TOP_SPECS_FILE = specs.xml + # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- XML_FLAGS += +KERNEL_SRC=$(ERL_TOP)/lib/kernel/src +KERNEL_INCLUDE=$(ERL_TOP)/lib/kernel/include +SPECS_FLAGS = -I$(KERNEL_SRC) -I$(KERNEL_INCLUDE) + # ---------------------------------------------------- # Targets # ---------------------------------------------------- $(HTMLDIR)/%.gif: %.gif $(INSTALL_DATA) $< $@ -docs: pdf html man $(INFO_FILE) +docs: man pdf html $(INFO_FILE) $(TOP_PDF_FILE): $(XML_FILES) @@ -132,8 +149,25 @@ clean: rm -f $(MAN1DIR)/* rm -f $(MAN3DIR)/* rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo) + rm -f $(SPECDIR)/* rm -f errs core *~ +$(SPECDIR)/specs_driver_entry.xml: + escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \ + -o$(dir $@) -module driver_entry +$(SPECDIR)/specs_erl_nif.xml: + escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \ + -o$(dir $@) -module erl_nif +$(SPECDIR)/specs_erl_set_memory_block.xml: + escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \ + -o$(dir $@) -module erl_set_memory_block +$(SPECDIR)/specs_erl_driver.xml: + escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \ + -o$(dir $@) -module erl_driver +$(SPECDIR)/specs_erts_alloc.xml: + escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \ + -o$(dir $@) -module erts_alloc + # ---------------------------------------------------- # Release Target # ---------------------------------------------------- diff --git a/erts/doc/src/erl_prim_loader.xml b/erts/doc/src/erl_prim_loader.xml index ccaa9b725f..fa3daaeecc 100644 --- a/erts/doc/src/erl_prim_loader.xml +++ b/erts/doc/src/erl_prim_loader.xml @@ -4,7 +4,7 @@
- 19962009 + 19962011 Ericsson AB. All Rights Reserved. @@ -55,33 +55,31 @@ -loader_debug are also experimental

+ + + + + + - start(Id, Loader, Hosts) -> {ok, Pid} | {error, What} + Start the Erlang low level loader - - Id = term() - Loader = atom() | string() - Hosts = [Host] - Host = atom() - Pid = pid() - What = term() -

Starts the Erlang low level loader. This function is called by the init process (and module). The init - process reads the command line flags -id Id, - -loader Loader, and -hosts Hosts. These are + process reads the command line flags -id Id, + -loader Loader, and -hosts Hosts. These are the arguments supplied to the start/3 function.

If -loader is not given, the default loader is efile which tells the system to read from the file system.

-

If -loader is inet, the -id Id, - -hosts Hosts, and -setcookie Cookie flags must - also be supplied. Hosts identifies hosts which this +

If -loader is inet, the -id Id, + -hosts Hosts, and -setcookie Cookie flags must + also be supplied. Hosts identifies hosts which this node can contact in order to load modules. One Erlang runtime system with a erl_boot_server process must be - started on each of hosts given in Hosts in order to + started on each of hosts given in Hosts in order to answer the requests. See erl_boot_server(3).

If -loader is something else, the given port program @@ -90,35 +88,26 @@ - get_file(Filename) -> {ok, Bin, FullName} | error + Get a file - - Filename = string() - Bin = binary() - FullName = string() -

This function fetches a file using the low level loader. - Filename is either an absolute file name or just the name + Filename is either an absolute file name or just the name of the file, for example "lists.beam". If an internal path is set to the loader, this path is used to find the file. If a user supplied loader is used, the path can be stripped off if it is obsolete, and the loader does not use a path. - FullName is the complete name of the fetched file. - Bin is the contents of the file as a binary.

+ FullName is the complete name of the fetched file. + Bin is the contents of the file as a binary.

-

The Filename can also be a file in an archive. For example - /otp/root/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin/mnesia_backup.beam +

The Filename can also be a file in an archive. For example + /otp/root/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin/mnesia_backup.beam. See code(3) about archive files.

- get_path() -> {ok, Path} + Get the path set in the loader - - Path = [Dir] - Dir = string() -

This function gets the path set in the loader. The path is set by the init process according to information found @@ -126,35 +115,26 @@ - list_dir(Dir) -> {ok, Filenames} | error + List files in a directory - - Dir = name() - Filenames = [Filename] - Filename = string() -

Lists all the files in a directory. Returns - {ok, Filenames} if successful. Otherwise, it returns - error. Filenames is a list of + {ok, Filenames} if successful. Otherwise, it returns + error. Filenames is a list of the names of all the files in the directory. The names are not sorted.

-

The Dir can also be a directory in an archive. For example - /otp/root/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin +

The Dir can also be a directory in an archive. For example + /otp/root/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin. See code(3) about archive files.

- read_file_info(Filename) -> {ok, FileInfo} | error + Get information about a file - - Filename = name() - FileInfo = #file_info{} -

Retrieves information about a file. Returns - {ok, FileInfo} if successful, otherwise - error. FileInfo is a record + {ok, FileInfo} if successful, otherwise + error. FileInfo is a record file_info, defined in the Kernel include file file.hrl. Include the following directive in the module from which the function is called:

@@ -162,18 +142,14 @@ -include_lib("kernel/include/file.hrl").

See file(3) for more info about the record file_info.

-

The Filename can also be a file in an archive. For example - /otp/root/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin/mnesia_backup.beam +

The Filename can also be a file in an archive. For example + /otp/root/lib/mnesia-4.4.7.ez/mnesia-4.4.7/ebin/mnesia_backup.beam. See code(3) about archive files.

- set_path(Path) -> ok + Set the path of the loader - - Path = [Dir] - Dir = string() -

This function sets the path of the loader if init interprets a path command in the start script.

diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index f98e15cb52..7cfab0785d 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -48,22 +48,24 @@ "Allowed in guard tests".

-
- DATA TYPES - - -ext_binary() - a binary data object, - structured according to the Erlang external term format - -iodata() = iolist() | binary() + + + ext_binary() + +

A binary data object, structured according to + the Erlang external term format.

+
+
+ + +

See now/0.

+
+
+
-iolist() = [char() | binary() | iolist()] - a binary is allowed as the tail of the list
-
- abs(Number) -> int() | float() + abs(Number) -> integer() | float() Arithmetical absolute value Number = number() @@ -80,7 +82,7 @@ iolist() = [char() | binary() | iolist()]
- erlang:adler32(Data) -> int() + erlang:adler32(Data) -> integer() Compute adler32 checksum Data = iodata() @@ -90,10 +92,10 @@ iolist() = [char() | binary() | iolist()] - erlang:adler32(OldAdler, Data) -> int() + erlang:adler32(OldAdler, Data) -> integer() Compute adler32 checksum - OldAdler = int() + OldAdler = integer() Data = iodata() @@ -112,11 +114,11 @@ iolist() = [char() | binary() | iolist()] - erlang:adler32_combine(FirstAdler, SecondAdler, SecondSize) -> int() + erlang:adler32_combine(FirstAdler, SecondAdler, SecondSize) -> integer() Combine two adler32 checksums - FirstAdler = SecondAdler = int() - SecondSize = int() + FirstAdler = SecondAdler = integer() + SecondSize = integer()

Combines two previously computed adler32 checksums. @@ -155,20 +157,16 @@ iolist() = [char() | binary() | iolist()] - apply(Fun, Args) -> term() | empty() + Apply a function to an argument list - - Fun = fun() - Args = [term()] - -

Call a fun, passing the elements in Args as +

Call a fun, passing the elements in Args as arguments.

Note: If the number of elements in the arguments are known at compile-time, the call is better written as - Fun(Arg1, Arg2, ... ArgN).

+ Fun(Arg1, Arg2, ... ArgN).

-

Earlier, Fun could also be given as +

Earlier, Fun could also be given as {Module, Function}, equivalent to apply(Module, Function, Args). This usage is deprecated and will stop working in a future release of @@ -177,15 +175,11 @@ iolist() = [char() | binary() | iolist()] - apply(Module, Function, Args) -> term() | empty() + Apply a function to an argument list - - Module = Function = atom() - Args = [term()] -

Returns the result of applying Function in - Module to Args. The applied function must + Module to Args. The applied function must be exported from Module. The arity of the function is the length of Args.

@@ -198,7 +192,7 @@ iolist() = [char() | binary() | iolist()]
 "Erlang"

Note: If the number of arguments are known at compile-time, the call is better written as - Module:Function(Arg1, Arg2, ..., ArgN).

+ Module:Function(Arg1, Arg2, ..., ArgN).

Failure: error_handler:undefined_function/3 is called if the applied function is not exported. The error handler can be redefined (see @@ -258,8 +252,8 @@ iolist() = [char() | binary() | iolist()] Subject = binary() PosLen = {Start,Length} - Start = int() - Length = int() + Start = integer() >= 0 + Length = integer() >= 0

Extracts the part of the binary described by PosLen.

@@ -291,8 +285,8 @@ iolist() = [char() | binary() | iolist()] Extracts a part of a binary Subject = binary() - Start = int() - Length = int() + Start = integer() >= 0 + Length = integer() >= 0

The same as binary_part(Subject, {Pos, Len}).

@@ -390,7 +384,7 @@ iolist() = [char() | binary() | iolist()] binary_to_term(Binary) -> term() Decode an Erlang external term format binary - Binary = ext_binary() + Binary = ext_binary()

Returns an Erlang term which is the result of decoding @@ -411,7 +405,7 @@ iolist() = [char() | binary() | iolist()] Decode an Erlang external term format binary Opts = [safe] - Binary = ext_binary() + Binary = ext_binary()

As binary_to_term/1, but takes options that affect decoding @@ -442,7 +436,7 @@ iolist() = [char() | binary() | iolist()] - bit_size(Bitstring) -> int() + bit_size(Bitstring) -> integer() >= 0 Return the size of a bitstring Bitstring = bitstring() @@ -461,7 +455,7 @@ iolist() = [char() | binary() | iolist()] erlang:bump_reductions(Reductions) -> void() Increment the reduction counter - Reductions = int() + Reductions = integer() >= 0

This implementation-dependent function increments @@ -478,7 +472,7 @@ iolist() = [char() | binary() | iolist()] - byte_size(Bitstring) -> int() + byte_size(Bitstring) -> integer() >= 0 Return the size of a bitstring (or binary) Bitstring = bitstring() @@ -500,7 +494,7 @@ iolist() = [char() | binary() | iolist()] Cancel a timer TimerRef = reference() - Time = int() + Time = integer() >= 0

Cancels a timer, where TimerRef was returned by @@ -524,7 +518,7 @@ iolist() = [char() | binary() | iolist()] - check_process_code(Pid, Module) -> bool() + check_process_code(Pid, Module) -> boolean() Check if a process is executing old code for a module Pid = pid() @@ -544,7 +538,7 @@ false - concat_binary(ListOfBinaries) + Concatenate a list of binaries (deprecated)

Do not use; use @@ -553,7 +547,7 @@ false - erlang:crc32(Data) -> int() + erlang:crc32(Data) -> integer() >= 0 Compute crc32 (IEEE 802.3) checksum Data = iodata() @@ -563,10 +557,10 @@ false - erlang:crc32(OldCrc, Data) -> int() + erlang:crc32(OldCrc, Data) -> integer() >= 0 Compute crc32 (IEEE 802.3) checksum - OldCrc = int() + OldCrc = integer() >= 0 Data = iodata() @@ -585,11 +579,11 @@ false - erlang:crc32_combine(FirstCrc, SecondCrc, SecondSize) -> int() + erlang:crc32_combine(FirstCrc, SecondCrc, SecondSize) -> integer() >= 0 Combine two crc32 (IEEE 802.3) checksums - FirstCrc = SecondCrc = int() - SecondSize = int() + FirstCrc = SecondCrc = integer() >= 0 + SecondSize = integer() >= 0

Combines two previously computed crc32 checksums. @@ -609,10 +603,10 @@ false - date() -> {Year, Month, Day} + date() -> Date Current date - Year = Month = Day = int() + Date = calendar:date()

Returns the current date as {Year, Month, Day}.

@@ -631,20 +625,20 @@ false Options = [Opt] Packet = binary() | HttpPacket Rest = binary() - Length = int() | undefined + Length = integer() > 0 | undefined Reason = term()  Type, Opt -- see below HttpPacket = HttpRequest | HttpResponse | HttpHeader | http_eoh | HttpError HttpRequest = {http_request, HttpMethod, HttpUri, HttpVersion} HttpResponse = {http_response, HttpVersion, integer(), HttpString} - HttpHeader = {http_header, int(), HttpField, Reserved=term(), Value=HttpString} + HttpHeader = {http_header, integer(), HttpField, Reserved=term(), Value=HttpString} HttpError = {http_error, HttpString} HttpMethod = HttpMethodAtom | HttpString HttpMethodAtom = 'OPTIONS' | 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' - HttpUri = '*' | {absoluteURI, http|https, Host=HttpString, Port=int()|undefined, Path=HttpString} | + HttpUri = '*' | {absoluteURI, http|https, Host=HttpString, Port=integer()|undefined, Path=HttpString} | {scheme, Scheme=HttpString, HttpString} | {abs_path, HttpString} | HttpString - HttpVersion = {Major=int(), Minor=int()} + HttpVersion = {Major=integer(), Minor=integer()} HttpString = string() | binary() HttpField = HttpFieldAtom | HttpString HttpFieldAtom = 'Cache-Control' | 'Connection' | 'Date' | 'Pragma' | 'Transfer-Encoding' | 'Upgrade' | 'Via' | 'Accept' | 'Accept-Charset' | 'Accept-Encoding' | 'Accept-Language' | 'Authorization' | 'From' | 'Host' | 'If-Modified-Since' | 'If-Match' | 'If-None-Match' | 'If-Range' | 'If-Unmodified-Since' | 'Max-Forwards' | 'Proxy-Authorization' | 'Range' | 'Referer' | 'User-Agent' | 'Age' | 'Location' | 'Proxy-Authenticate' | 'Public' | 'Retry-After' | 'Server' | 'Vary' | 'Warning' | 'Www-Authenticate' | 'Allow' | 'Content-Base' | 'Content-Encoding' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-Md5' | 'Content-Range' | 'Content-Type' | 'Etag' | 'Expires' | 'Last-Modified' | 'Accept-Ranges' | 'Set-Cookie' | 'Set-Cookie2' | 'X-Forwarded-For' | 'Cookie' | 'Keep-Alive' | 'Proxy-Connection' @@ -719,14 +713,14 @@ false

The following options are available:

- {packet_size, int()} + {packet_size, integer()}

Sets the max allowed size of the packet body. If the packet header indicates that the length of the packet is longer than the max allowed length, the packet is considered invalid. Default is 0 which means no size limit.

- {line_length, int()} + {line_length, integer()}

Applies only to line oriented protocols (line, http). Lines longer than this will be truncated.

@@ -800,7 +794,7 @@ false
- demonitor(MonitorRef, OptionList) -> true|false + demonitor(MonitorRef, OptionList) -> boolean() Stop monitoring MonitorRef = reference() @@ -867,14 +861,11 @@ false - disconnect_node(Node) -> bool() | ignored + Force the disconnection of a node - - Node = atom() -

Forces the disconnection of a node. This will appear to - the node Node as if the local node has crashed. This + the node Node as if the local node has crashed. This BIF is mainly used in the Erlang network authentication protocols. Returns true if disconnection succeeds, otherwise false. If the local node is not alive, @@ -1069,15 +1060,11 @@ b - erlang:fun_info(Fun) -> [{Item, Info}] + Information about a fun - - Fun = fun() - Item, Info -- see below -

Returns a list containing information about the fun - Fun. Each element of the list is a tuple. The order of + Fun. Each element of the list is a tuple. The order of the tuples is not defined, and more tuples may be added in a future release.

@@ -1176,7 +1163,7 @@ b

Returns information about Fun as specified by Item, in the form {Item,Info}.

For any fun, Item can be any of the atoms - module, name, arity, or env.

+ module, name, arity, env, or type.

For a local fun, Item can also be any of the atoms index, new_index, new_uniq, uniq, and pid. For an external fun, the value @@ -1197,11 +1184,11 @@ b - erlang:function_exported(Module, Function, Arity) -> bool() + erlang:function_exported(Module, Function, Arity) -> boolean() Check if a function is exported and loaded Module = Function = atom() - Arity = int() + Arity = arity()

Returns true if the module Module is loaded @@ -1229,7 +1216,7 @@ b - garbage_collect(Pid) -> bool() + garbage_collect(Pid) -> boolean() Force an immediate garbage collection of a process Pid = pid() @@ -1276,11 +1263,8 @@ b - erlang:get_cookie() -> Cookie | nocookie + Get the magic cookie of the local node - - Cookie = atom() -

Returns the magic cookie of the local node, if the node is alive; otherwise the atom nocookie.

@@ -1311,7 +1295,7 @@ b Get the call stack back-trace of the last exception Module = Function = atom() - Arity = int() + Arity = arity() Args = [term()] @@ -1379,7 +1363,7 @@ os_prompt% halt(Status) Halt the Erlang runtime system - Status = int()>=0 | string() + Status = integer() >= 0 | string()

Status must be a non-negative integer, or a string. @@ -1472,7 +1456,7 @@ os_prompt% integer_to_list(Integer) -> string() Text representation of an integer - Integer = int() + Integer = integer()

Returns a string which corresponds to the text @@ -1483,15 +1467,11 @@ os_prompt% - integer_to_list(Integer, Base) -> string() + Text representation of an integer - - Integer = int() - Base = 2..36 -

Returns a string which corresponds to the text - representation of Integer in base Base.

+ representation of Integer in base Base.

 > integer_to_list(1023, 16).
 "3FF"
@@ -1518,7 +1498,7 @@ os_prompt%
- iolist_size(Item) -> int() + iolist_size(Item) -> integer() >= 0 Size of an iolist Item = iolist() | binary() @@ -1533,7 +1513,7 @@ os_prompt% - is_alive() -> bool() + is_alive() -> boolean() Check whether the local node is alive

Returns true if the local node is alive; that is, if @@ -1542,7 +1522,7 @@ os_prompt% - is_atom(Term) -> bool() + is_atom(Term) -> boolean() Check whether a term is an atom Term = term() @@ -1554,7 +1534,7 @@ os_prompt% - is_binary(Term) -> bool() + is_binary(Term) -> boolean() Check whether a term is a binary Term = term() @@ -1569,7 +1549,7 @@ os_prompt% - is_bitstring(Term) -> bool() + is_bitstring(Term) -> boolean() Check whether a term is a bitstring Term = term() @@ -1582,7 +1562,7 @@ os_prompt% - is_boolean(Term) -> bool() + is_boolean(Term) -> boolean() Check whether a term is a boolean Term = term() @@ -1595,11 +1575,11 @@ os_prompt% - erlang:is_builtin(Module, Function, Arity) -> bool() + erlang:is_builtin(Module, Function, Arity) -> boolean() Check if a function is a BIF implemented in C Module = Function = atom() - Arity = int() + Arity = arity()

Returns true if Module:Function/Arity is @@ -1608,7 +1588,7 @@ os_prompt% - is_float(Term) -> bool() + is_float(Term) -> boolean() Check whether a term is a float Term = term() @@ -1620,7 +1600,7 @@ os_prompt% - is_function(Term) -> bool() + is_function(Term) -> boolean() Check whether a term is a fun Term = term() @@ -1632,11 +1612,11 @@ os_prompt% - is_function(Term, Arity) -> bool() + is_function(Term, Arity) -> boolean() Check whether a term is a fun with a given arity Term = term() - Arity = int() + Arity = arity()

Returns true if Term is a fun that can be @@ -1653,7 +1633,7 @@ os_prompt% - is_integer(Term) -> bool() + is_integer(Term) -> boolean() Check whether a term is an integer Term = term() @@ -1665,7 +1645,7 @@ os_prompt% - is_list(Term) -> bool() + is_list(Term) -> boolean() Check whether a term is a list Term = term() @@ -1677,7 +1657,7 @@ os_prompt% - is_number(Term) -> bool() + is_number(Term) -> boolean() Check whether a term is a number Term = term() @@ -1689,7 +1669,7 @@ os_prompt% - is_pid(Term) -> bool() + is_pid(Term) -> boolean() Check whether a term is a pid Term = term() @@ -1701,7 +1681,7 @@ os_prompt% - is_port(Term) -> bool() + is_port(Term) -> boolean() Check whether a term is a port Term = term() @@ -1713,7 +1693,7 @@ os_prompt% - is_process_alive(Pid) -> bool() + is_process_alive(Pid) -> boolean() Check whether a process is alive Pid = pid() @@ -1728,7 +1708,7 @@ os_prompt% - is_record(Term, RecordTag) -> bool() + is_record(Term, RecordTag) -> boolean() Check whether a term appears to be a record Term = term() @@ -1751,12 +1731,12 @@ os_prompt% - is_record(Term, RecordTag, Size) -> bool() + is_record(Term, RecordTag, Size) -> boolean() Check whether a term appears to be a record Term = term() RecordTag = atom() - Size = int() + Size = integer()

RecordTag must be an atom. Returns true if @@ -1771,7 +1751,7 @@ os_prompt% - is_reference(Term) -> bool() + is_reference(Term) -> boolean() Check whether a term is a reference Term = term() @@ -1783,7 +1763,7 @@ os_prompt% - is_tuple(Term) -> bool() + is_tuple(Term) -> boolean() Check whether a term is a tuple Term = term() @@ -1795,7 +1775,7 @@ os_prompt% - length(List) -> int() + length(List) -> integer() >= 0 Length of a list List = [term()] @@ -1916,7 +1896,7 @@ os_prompt% - list_to_integer(String) -> int() + list_to_integer(String) -> integer() Convert from text representation to an integer String = string() @@ -1932,19 +1912,15 @@ os_prompt% - list_to_integer(String, Base) -> int() + Convert from text representation to an integer - - String = string() - Base = 2..36 -

Returns an integer whose text representation in base - Base is String.

+ Base is String.

 > list_to_integer("3FF", 16).
 1023
-

Failure: badarg if String contains a bad +

Failure: badarg if String contains a bad representation of an integer.

@@ -2095,12 +2071,10 @@ os_prompt% - erlang:localtime() -> {Date, Time} + erlang:localtime() -> DateTime Current local date and time - Date = {Year, Month, Day} - Time = {Hour, Minute, Second} -  Year = Month = Day = Hour = Minute = Second = int() + DateTime = calendar:datetime()

Returns the current local date and time @@ -2113,17 +2087,12 @@ os_prompt% - erlang:localtime_to_universaltime({Date1, Time1}) -> {Date2, Time2} + Convert from local to Universal Time Coordinated (UTC) date and time - - Date1 = Date2 = {Year, Month, Day} - Time1 = Time2 = {Hour, Minute, Second} -  Year = Month = Day = Hour = Minute = Second = int() -

Converts local date and time to Universal Time Coordinated (UTC), if this is supported by the underlying OS. Otherwise, - no conversion is done and {Date1, Time1} is returned.

+ no conversion is done and {Date1, Time1} is returned.

 > erlang:localtime_to_universaltime({{1996,11,6},{14,45,17}}).
 {{1996,11,6},{13,45,17}}
@@ -2135,9 +2104,8 @@ os_prompt% erlang:localtime_to_universaltime({Date1, Time1}, IsDst) -> {Date2, Time2} Convert from local to Universal Time Coordinated (UTC) date and time - Date1 = Date2 = {Year, Month, Day} - Time1 = Time2 = {Hour, Minute, Second} -  Year = Month = Day = Hour = Minute = Second = int() + Date1 = Date2 = calendar:date() + Time1 = Time2 = calendar:time() IsDst = true | false | undefined @@ -2177,7 +2145,7 @@ os_prompt% erlang:make_tuple(Arity, InitialValue) -> tuple() Create a new tuple of a given arity - Arity = int() + Arity = arity() InitialValue = term() @@ -2192,7 +2160,7 @@ os_prompt% erlang:make_tuple(Arity, Default, InitList) -> tuple() Create a new tuple with given arity and contents - Arity = int() + Arity = arity() Default = term() InitList = [{Position,term()}] Position = integer() @@ -2211,14 +2179,11 @@ os_prompt%
- max(Term1, Term2) -> Maximum + Return the largest of two term - - Term1 = Term2 = Maximum = term() - -

Return the largest of Term1 and Term2; - if the terms compares equal, Term1 will be returned.

+

Return the largest of Term1 and Term2; + if the terms compare equal, Term1 will be returned.

@@ -2468,18 +2433,15 @@ os_prompt% - min(Term1, Term2) -> Minimum + Return the smallest of two term - - Term1 = Term2 = Minimum = term() - -

Return the smallest of Term1 and Term2; - if the terms compare equal, Term1 will be returned.

+

Return the smallest of Term1 and Term2; + if the terms compare equal, Term1 will be returned.

- module_loaded(Module) -> bool() + module_loaded(Module) -> boolean() Check if a module is loaded Module = atom() @@ -2602,7 +2564,7 @@ os_prompt% Monitor the status of a node Node = node() - Flag = bool() + Flag = boolean()

Monitors the status of the node Node. If Flag @@ -2628,7 +2590,7 @@ os_prompt% Monitor the status of a node Node = node() - Flag = bool() + Flag = boolean() Options = [Option] Option = allow_passive_connect @@ -2711,11 +2673,8 @@ os_prompt% - nodes() -> Nodes + All visible nodes in the system - - Nodes = [node()] -

Returns a list of all visible nodes in the system, excluding the local node. Same as nodes(visible).

@@ -2765,11 +2724,12 @@ os_prompt%
- now() -> {MegaSecs, Secs, MicroSecs} - Elapsed time since 00:00 GMT + now() -> timestamp() - MegaSecs = Secs = MicroSecs = int() + timestamp() = {MegaSecs, Secs, MicroSecs} + MegaSecs = Secs = MicroSecs = integer() >= 0 + Elapsed time since 00:00 GMT

Returns the tuple {MegaSecs, Secs, MicroSecs} which is the elapsed time since 00:00 GMT, January 1, 1970 (zero hour) @@ -2792,12 +2752,12 @@ os_prompt% PortName = {spawn, Command} | {spawn_driver, Command} | {spawn_executable, FileName} | {fd, In, Out}  Command = string()  FileName = [ FileNameChar ] | binary() -  FileNameChar = int() (1..255 or any Unicode codepoint, see description) -  In = Out = int() +  FileNameChar = integer() (1..255 or any Unicode codepoint, see description) +  In = Out = integer() PortSettings = [Opt]  Opt = {packet, N} | stream | {line, L} | {cd, Dir} | {env, Env} | {args, [ ArgString ]} | {arg0, ArgString} | exit_status | use_stdio | nouse_stdio | stderr_to_stdout | in | out | binary | eof   N = 1 | 2 | 4 -   L = int() +   L = integer()   Dir = string()   ArgString = [ FileNameChar ] | binary()   Env = [{Name, Val}] @@ -3283,7 +3243,7 @@ os_prompt% - port_command(Port, Data, OptionList) -> true|false + port_command(Port, Data, OptionList) -> boolean() Send data to a port Port = port() | atom() @@ -3399,7 +3359,7 @@ os_prompt% Perform a synchronous control operation on a port Port = port() | atom() - Operation = int() + Operation = integer() Data = Res = iodata() @@ -3423,7 +3383,7 @@ os_prompt% Synchronous call to a port with term data Port = port() | atom() - Operation = int() + Operation = integer() Data = term() @@ -4109,7 +4069,7 @@ os_prompt% Reason = term() Stacktrace = [{Module, Function, Arity | Args} | {Fun, Args}]  Module = Function = atom() -  Arity = int() +  Arity = arity()  Args = [term()]  Fun = [fun()] @@ -4146,7 +4106,7 @@ os_prompt% - erlang:read_timer(TimerRef) -> int() | false + erlang:read_timer(TimerRef) -> integer() >= 0 | false Number of milliseconds remaining for a timer TimerRef = reference() @@ -4262,7 +4222,7 @@ true - round(Number) -> int() + round(Number) -> integer() Return an integer by rounding a number Number = number() @@ -4346,7 +4306,7 @@ true erlang:send_after(Time, Dest, Msg) -> TimerRef Start a timer - Time = int() + Time = integer() >= 0  0 <= Time <= 4294967295 Dest = pid() | RegName  LocalPid = pid() (of a process, alive or dead, on the local node) @@ -4375,17 +4335,12 @@ true - erlang:send_nosuspend(Dest, Msg) -> bool() + Try to send a message without ever blocking - - Dest = pid() | port() | RegName | {RegName, Node} -  RegName = atom() -  Node = node() - Msg = term() - +

The same as - erlang:send(Dest, Msg, [nosuspend]), but returns true if + erlang:send(Dest, Msg, [nosuspend]), but returns true if the message was sent and false if the message was not sent because the sender would have had to be suspended.

This function is intended for send operations towards an @@ -4393,7 +4348,7 @@ true (Erlang) process. If the connection to the remote node (usually not a real Erlang node, but a node written in C or Java) is overloaded, this function will not send the message but return false instead.

-

The same happens, if Dest refers to a local port that +

The same happens, if Dest refers to a local port that is busy. For all other destinations (allowed for the ordinary send operator '!') this function sends the message and returns true.

@@ -4426,18 +4381,12 @@ true
- erlang:send_nosuspend(Dest, Msg, Options) -> bool() + Try to send a message without ever blocking - - Dest = pid() | port() | RegName | {RegName, Node} -  RegName = atom() -  Node = node() - Msg = term() - Option = noconnect - +

The same as - erlang:send(Dest, Msg, [nosuspend | Options]), + erlang:send(Dest, Msg, [nosuspend | Options]), but with boolean return value.

This function behaves like erlang:send_nosuspend/2), @@ -4462,17 +4411,13 @@ true - erlang:set_cookie(Node, Cookie) -> true + Set the magic cookie of a node - - Node = node() - Cookie = atom() - -

Sets the magic cookie of Node to the atom - Cookie. If Node is the local node, the function +

Sets the magic cookie of Node to the atom + Cookie. If Node is the local node, the function also sets the cookie of all other unknown nodes to - Cookie (see + Cookie (see Distributed Erlang in the Erlang Reference Manual).

Failure: function_clause if the local node is not alive.

@@ -4497,7 +4442,7 @@ true
- size(Item) -> int() + size(Item) -> integer() >= 0 Size of a tuple or binary Item = tuple() | binary() @@ -4512,28 +4457,21 @@ true - spawn(Fun) -> pid() + Create a new process with a fun as entry point - - Fun = fun() -

Returns the pid of a new process started by the application - of Fun to the empty list []. Otherwise works + of Fun to the empty list []. Otherwise works like spawn/3.

- spawn(Node, Fun) -> pid() + Create a new process with a fun as entry point on a given node - - Node = node() - Fun = fun() -

Returns the pid of a new process started by the application - of Fun to the empty list [] on Node. If - Node does not exist, a useless pid is returned. + of Fun to the empty list [] on Node. If + Node does not exist, a useless pid is returned. Otherwise works like spawn/3.

@@ -4564,47 +4502,35 @@ true
- spawn(Node, Module, Function, Args) -> pid() + Create a new process with a function as entry point on a given node - - Node = node() - Module = Function = atom() - Args = [term()] -

Returns the pid of a new process started by the application - of Module:Function to Args on Node. If - Node does not exists, a useless pid is returned. + of Module:Function to Args on Node. If + Node does not exists, a useless pid is returned. Otherwise works like spawn/3.

- spawn_link(Fun) -> pid() + Create and link to a new process with a fun as entry point - - Fun = fun() -

Returns the pid of a new process started by the application - of Fun to the empty list []. A link is created between + of Fun to the empty list []. A link is created between the calling process and the new process, atomically. Otherwise works like spawn/3.

- spawn_link(Node, Fun) -> pid() + Create and link to a new process with a fun as entry point on a specified node - - Node = node() - Fun = fun() -

Returns the pid of a new process started by the application - of Fun to the empty list [] on Node. A link is + of Fun to the empty list [] on Node. A link is created between the calling process and the new process, - atomically. If Node does not exist, a useless pid is + atomically. If Node does not exist, a useless pid is returned (and due to the link, an exit signal with exit reason noconnection will be received). Otherwise works like spawn/3.

@@ -4626,47 +4552,35 @@ true
- spawn_link(Node, Module, Function, Args) -> pid() + Create and link to a new process with a function as entry point on a given node - - Node = node() - Module = Function = atom() - Args = [term()] -

Returns the pid of a new process started by the application - of Module:Function to Args on Node. A + of Module:Function to Args on Node. A link is created between the calling process and the new - process, atomically. If Node does not exist, a useless + process, atomically. If Node does not exist, a useless pid is returned (and due to the link, an exit signal with exit reason noconnection will be received). Otherwise works like spawn/3.

- spawn_monitor(Fun) -> {pid(),reference()} + Create and monitor a new process with a fun as entry point - - Fun = fun() -

Returns the pid of a new process started by the application - of Fun to the empty list [] and reference for a monitor + of Fun to the empty list [] and reference for a monitor created to the new process. Otherwise works like spawn/3.

- spawn_monitor(Module, Function, Args) -> {pid(),reference()} + Create and monitor a new process with a function as entry point - - Module = Function = atom() - Args = [term()] -

A new process is started by the application - of Module:Function to Args, and the process is + of Module:Function to Args, and the process is monitored at the same time. Returns the pid and a reference for the monitor. Otherwise works like @@ -4674,19 +4588,11 @@ true - spawn_opt(Fun, [Option]) -> pid() | {pid(),reference()} + Create a new process with a fun as entry point - - Fun = fun() - Option = link | monitor | {priority, Level} | {fullsweep_after, Number} | {min_heap_size, Size} | {min_bin_vheap_size, VSize} -  Level = low | normal | high -  Number = int() -  Size = int() -  VSize = int() -

Returns the pid of a new process started by the application - of Fun to the empty list []. Otherwise + of Fun to the empty list []. Otherwise works like spawn_opt/4.

If the option monitor is given, the newly created @@ -4695,37 +4601,19 @@ true - spawn_opt(Node, Fun, [Option]) -> pid() + Create a new process with a fun as entry point on a given node - - Node = node() - Fun = fun() - Option = link | {priority, Level} | {fullsweep_after, Number} | {min_heap_size, Size} | {min_bin_vheap_size, VSize} -  Level = low | normal | high -  Number = int() -  Size = int() -  VSize = int() -

Returns the pid of a new process started by the application - of Fun to the empty list [] on Node. If - Node does not exist, a useless pid is returned. + of Fun to the empty list [] on Node. If + Node does not exist, a useless pid is returned. Otherwise works like spawn_opt/4.

- spawn_opt(Module, Function, Args, [Option]) -> pid() | {pid(),reference()} + Create a new process with a function as entry point - - Module = Function = atom() - Args = [term()] - Option = link | monitor | {priority, Level} | {fullsweep_after, Number} | {min_heap_size, Size} | {min_bin_vheap_size, VSize} -  Level = low | normal | high -  Number = int() -  Size = int() -  VSize = int() -

Works exactly like spawn/3, except that an @@ -4744,17 +4632,17 @@ true

Monitor the new process (just like monitor/2 does).

- {priority, Level} + {priority, Level}

Sets the priority of the new process. Equivalent to executing - process_flag(priority, Level) in the start function of the new process, + process_flag(priority, Level) in the start function of the new process, except that the priority will be set before the process is selected for execution for the first time. For more information on priorities see process_flag(priority, Level).

- {fullsweep_after, Number} + {fullsweep_after, Number}

This option is only useful for performance tuning. In general, you should not use this option unless you @@ -4776,18 +4664,18 @@ true

Here are a few cases when it could be useful to change fullsweep_after. Firstly, if binaries that are no longer used should be thrown away as soon as possible. - (Set Number to zero.) Secondly, a process that + (Set Number to zero.) Secondly, a process that mostly have short-lived data will be fullsweeped seldom or never, meaning that the old heap will contain mostly garbage. To ensure a fullsweep once in a while, set - Number to a suitable value such as 10 or 20. + Number to a suitable value such as 10 or 20. Thirdly, in embedded systems with limited amount of RAM and no virtual memory, one might want to preserve memory - by setting Number to zero. (The value may be set + by setting Number to zero. (The value may be set globally, see erlang:system_flag/2.)

- {min_heap_size, Size} + {min_heap_size, Size}

This option is only useful for performance tuning. In general, you should not use this option unless you @@ -4802,9 +4690,9 @@ true slow down the system due to worse data locality. Therefore, it is recommended to use this option only for fine-tuning an application and to measure the execution - time with various Size values.

+ time with various Size values.

- {min_bin_vheap_size, VSize} + {min_bin_vheap_size, VSize}

This option is only useful for performance tuning. In general, you should not use this option unless you @@ -4818,29 +4706,19 @@ true Setting too high value, however, might waste memory. Therefore, it is recommended to use this option only for fine-tuning an application and to measure the execution - time with various VSize values.

+ time with various VSize values.

- spawn_opt(Node, Module, Function, Args, [Option]) -> pid() + Create a new process with a function as entry point on a given node - - Node = node() - Module = Function = atom() - Args = [term()] - Option = link | {priority, Level} | {fullsweep_after, Number} | {min_heap_size, Size} | {min_bin_vheap_size, VSize} -  Level = low | normal | high -  Number = int() -  Size = int() -  VSize = int() -

Returns the pid of a new process started by the application - of Module:Function to Args on Node. If - Node does not exist, a useless pid is returned. + of Module:Function to Args on Node. If + Node does not exist, a useless pid is returned. Otherwise works like spawn_opt/4.

@@ -4874,7 +4752,7 @@ true erlang:start_timer(Time, Dest, Msg) -> TimerRef Start a timer - Time = int() + Time = integer() >= 0  0 <= Time <= 4294967295 Dest = LocalPid | RegName  LocalPid = pid() (of a process, alive or dead, on the local node) @@ -4983,7 +4861,7 @@ true
- erlang:suspend_process(Suspendee, OptList) -> true | false + erlang:suspend_process(Suspendee, OptList) -> boolean() Suspend a process Suspendee = pid() @@ -5083,15 +4961,12 @@ true - erlang:suspend_process(Suspendee) -> true + Suspend a process - - Suspendee = pid() - -

Suspends the process identified by Suspendee. The +

Suspends the process identified by Suspendee. The same as calling - erlang:suspend_process(Suspendee, []). For more information see the documentation of erlang:suspend_process/2. + erlang:suspend_process(Suspendee, []). For more information see the documentation of erlang:suspend_process/2.

This BIF is intended for debugging only.

@@ -5416,7 +5291,7 @@ true

Types:

Allocator = undefined | glibc - Version = [int()] + Version = [integer()] Features = [atom()] Settings = [{Subsystem, [{Parameter, Value}]}] Subsystem = atom() @@ -5682,7 +5557,7 @@ true fullsweep_after -

Returns {fullsweep_after, int()} which is the +

Returns {fullsweep_after, integer()} which is the fullsweep_after garbage collection setting used by default. For more information see garbage_collection described below.

@@ -6050,7 +5925,7 @@ true  MonitorPid = pid()  Options = [Option]   Option = {long_gc, Time} | {large_heap, Size} | busy_port | busy_dist_port -    Time = Size = int() +    Time = Size = integer()

Returns the current system monitoring settings set by @@ -6084,7 +5959,7 @@ true MonitorPid = pid() Option = {long_gc, Time} | {large_heap, Size} | busy_port | busy_dist_port -  Time = Size = int() +  Time = Size = integer() MonSettings = {OldMonitorPid, [Option]}  OldMonitorPid = pid() @@ -6314,7 +6189,7 @@ true time() -> {Hour, Minute, Second} Current time - Hour = Minute = Second = int() + Hour = Minute = Second = integer() >= 0

Returns the current time as {Hour, Minute, Second}.

@@ -6342,11 +6217,11 @@ true
- erlang:trace(PidSpec, How, FlagList) -> int() + erlang:trace(PidSpec, How, FlagList) -> integer() >= 0 Set trace flags for a process or processes PidSpec = pid() | existing | new | all - How = bool() + How = boolean() FlagList = [Flag]  Flag -- see below @@ -6747,7 +6622,7 @@ true PidOrFunc = pid() | new | {Module, Function, Arity} | on_load  Module = Function = atom() -  Arity = int() +  Arity = arity() Item, Res -- see below @@ -6850,7 +6725,7 @@ true - erlang:trace_pattern(MFA, MatchSpec) -> int() + erlang:trace_pattern(MFA, MatchSpec) -> integer() >= 0 Set trace patterns for global call tracing

The same as @@ -6859,7 +6734,7 @@ true - erlang:trace_pattern(MFA, MatchSpec, FlagList) -> int() + erlang:trace_pattern(MFA, MatchSpec, FlagList) -> integer() >= 0 Set trace patterns for tracing of function calls MFA, MatchSpec, FlagList -- see below @@ -7039,7 +6914,7 @@ true - trunc(Number) -> int() + trunc(Number) -> integer() Return an integer by the truncating a number Number = number() @@ -7053,7 +6928,7 @@ true - tuple_size(Tuple) -> int() + tuple_size(Tuple) -> integer() >= 0 Return the size of a tuple Tuple = tuple() @@ -7081,12 +6956,10 @@ true - erlang:universaltime() -> {Date, Time} + erlang:universaltime() -> DateTime Current date and time according to Universal Time Coordinated (UTC) - Date = {Year, Month, Day} - Time = {Hour, Minute, Second} -  Year = Month = Day = Hour = Minute = Second = int() + DateTime = calendar:datetime()

Returns the current date and time according to Universal @@ -7104,9 +6977,8 @@ true erlang:universaltime_to_localtime({Date1, Time1}) -> {Date2, Time2} Convert from Universal Time Coordinated (UTC) to local date and time - Date1 = Date2 = {Year, Month, Day} - Time1 = Time2 = {Hour, Minute, Second} -  Year = Month = Day = Hour = Minute = Second = int() + Date1 = Date2 = calendar:date() + Time1 = Time2 = calendar:time()

Converts Universal Time Coordinated (UTC) date and time to @@ -7193,7 +7065,7 @@ true - erlang:yield() -> true + Let other processes get a chance to execute

Voluntarily let other processes (if any) get a chance to diff --git a/erts/doc/src/init.xml b/erts/doc/src/init.xml index b0d0cda4fa..d5c43f6e57 100644 --- a/erts/doc/src/init.xml +++ b/erts/doc/src/init.xml @@ -47,15 +47,12 @@ - boot(BootArgs) -> void() + Start the Erlang runtime system - - BootArgs = [binary()] -

Starts the Erlang runtime system. This function is called when the emulator is started and coordinates system start-up.

-

BootArgs are all command line arguments except +

BootArgs are all command line arguments except the emulator flags, that is, flags and plain arguments. See erl(1).

init itself interprets some of the flags, see @@ -67,17 +64,12 @@ - get_argument(Flag) -> {ok, Arg} | error + Get the values associated with a command line user flag - - Flag = atom() - Arg = [Values] -  Values = [string()] -

Returns all values associated with the command line user flag - Flag. If Flag is provided several times, each - Values is returned in preserved order.

+ Flag. If Flag is provided several times, each + Values is returned in preserved order.

 % erl -a b c -a d
 ...
@@ -113,48 +105,37 @@
       
     
     
-      get_arguments() -> Flags
+      
       Get all command line user flags
-      
-        Flags = [{Flag, Values}]
-         Flag = atom()
-         Values = [string()]
-      
       
         

Returns all command line flags, as well as the system defined flags, see get_argument/1.

- get_plain_arguments() -> [Arg] + Get all non-flag command line arguments - - Arg = string() -

Returns any plain command line arguments as a list of strings (possibly empty).

- get_status() -> {InternalStatus, ProvidedStatus} + Get system status information - - InternalStatus = starting | started | stopping - ProvidedStatus = term() - +

The current status of the init process can be inspected. During system startup (initialization), - InternalStatus is starting, and - ProvidedStatus indicates how far the boot script has + InternalStatus is starting, and + ProvidedStatus indicates how far the boot script has been interpreted. Each {progress, Info} term - interpreted in the boot script affects ProvidedStatus, - that is, ProvidedStatus gets the value of Info.

+ interpreted in the boot script affects ProvidedStatus, + that is, ProvidedStatus gets the value of Info.

- reboot() -> void() + Take down and restart an Erlang node smoothly

All applications are taken down smoothly, all code is @@ -168,7 +149,7 @@ - restart() -> void() + Restart the running Erlang node

The system is restarted inside the running Erlang @@ -183,20 +164,17 @@ - script_id() -> Id + Get the identity of the used boot script - - Id = term() -

Get the identity of the boot script used to boot the system. - Id can be any Erlang term. In the delivered boot - scripts, Id is {Name, Vsn}. Name and + Id can be any Erlang term. In the delivered boot + scripts, Id is {Name, Vsn}. Name and Vsn are strings.

- stop() -> void() + Take down an Erlang node smoothly

All applications are taken down smoothly, all code is @@ -210,15 +188,12 @@ - stop(Status) -> void() + Take down an Erlang node smoothly - - Status = int()>=0 | string() -

All applications are taken down smoothly, all code is unloaded, and all ports are closed before the system - terminates by calling halt(Status). If the + terminates by calling halt(Status). If the -heart command line flag was given, the heart program is terminated before the Erlang node terminates. Refer to heart(3) for more diff --git a/erts/doc/src/specs.xml b/erts/doc/src/specs.xml new file mode 100644 index 0000000000..e5c2f4783f --- /dev/null +++ b/erts/doc/src/specs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/erts/doc/src/zlib.xml b/erts/doc/src/zlib.xml index b1e768bce9..47a649af02 100644 --- a/erts/doc/src/zlib.xml +++ b/erts/doc/src/zlib.xml @@ -4,7 +4,7 @@

- 20052010 + 20052011 Ericsson AB. All Rights Reserved. @@ -76,96 +76,92 @@ list_to_binary([Compressed|Last])
-
- DATA TYPES - -iodata = iolist() | binary() - -iolist = [char() | binary() | iolist()] - a binary is allowed as the tail of the list - -zstream = a zlib stream, see open/0 -
+ + + + +

A zlib stream, see open/0. +

+
+
+ + + + + + + + + + + + + + + +

Normally in the range -15..-9 | 9..15.

+
+
+
- open() -> Z + Open a stream and return a stream reference - - Z = zstream() -

Open a zlib stream.

- close(Z) -> ok + Close a stream - - Z = zstream() - -

Closes the stream referenced by Z.

+

Closes the stream referenced by Z.

- deflateInit(Z) -> ok + Initialize a session for compression - - Z = zstream() - -

Same as zlib:deflateInit(Z, default).

+

Same as zlib:deflateInit(Z, default).

- deflateInit(Z, Level) -> ok + Initialize a session for compression - - Z = zstream() - Level = none | default | best_speed | best_compression | 0..9 -

Initialize a zlib stream for compression.

-

Level decides the compression level to be used, 0 +

Level decides the compression level to be used, 0 (none), gives no compression at all, 1 (best_speed) gives best speed and 9 (best_compression) gives best compression.

- deflateInit(Z, Level, Method, WindowBits, MemLevel, Strategy) -> ok + Initialize a session for compression - - Z = zstream() - Level = none | default | best_speed | best_compression | 0..9 - Method = deflated - WindowBits = 9..15|-9..-15 - MemLevel = 1..9 - Strategy = default|filtered|huffman_only -

Initiates a zlib stream for compression.

-

The Level parameter decides the compression level to be +

The Level parameter decides the compression level to be used, 0 (none), gives no compression at all, 1 (best_speed) gives best speed and 9 (best_compression) gives best compression.

-

The Method parameter decides which compression method to use, +

The Method parameter decides which compression method to use, currently the only supported method is deflated.

-

The WindowBits parameter is the base two logarithm +

The WindowBits parameter is the base two logarithm of the window size (the size of the history buffer). It should be in the range 9 through 15. Larger values of this parameter result in better compression at the expense of memory usage. The default value is 15 if - deflateInit/2. A negative WindowBits + deflateInit/2. A negative WindowBits value suppresses the zlib header (and checksum) from the stream. Note that the zlib source mentions this only as a undocumented feature.

-

The MemLevel parameter specifies how much memory +

The MemLevel parameter specifies how much memory should be allocated for the internal compression - state. MemLevel=1 uses minimum memory but is slow and - reduces compression ratio; MemLevel=9 uses maximum + state. MemLevel=1 uses minimum memory but is slow and + reduces compression ratio; MemLevel=9 uses maximum memory for optimal speed. The default value is 8.

-

The Strategy parameter is used to tune the +

The Strategy parameter is used to tune the compression algorithm. Use the value default for normal data, filtered for data produced by a filter (or predictor), or huffman_only to force Huffman @@ -175,54 +171,43 @@ zstream = a zlib stream, see open/0 tuned to compress them better. The effect of filteredis to force more Huffman coding and less string matching; it is somewhat intermediate between - default and huffman_only. The Strategy + default and huffman_only. The Strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately.

- deflate(Z, Data) -> Compressed + Compress data - - Z = zstream() - Data = iodata() - Compressed = iolist() - -

Same as deflate(Z, Data, none).

+

Same as deflate(Z, Data, none).

- deflate(Z, Data, Flush) -> + Compress data - - Z = zstream() - Data = iodata() - Flush = none | sync | full | finish - Compressed = iolist() -

deflate/3 compresses as much data as possible, and stops when the input buffer becomes empty. It may introduce some output latency (reading input without producing any output) except when forced to flush.

-

If the parameter Flush is set to sync, all +

If the parameter Flush is set to sync, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. Flushing may degrade compression for some compression algorithms and so it should be used only when necessary.

-

If Flush is set to full, all output is flushed as with +

If Flush is set to full, all output is flushed as with sync, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using full too often can seriously degrade the compression.

-

If the parameter Flush is set to finish, +

If the parameter Flush is set to finish, pending input is processed, pending output is flushed and deflate/3 returns. Afterwards the only possible operations on the stream are deflateReset/1 or deflateEnd/1.

-

Flush can be set to finish immediately after +

Flush can be set to finish immediately after deflateInit if all compression is to be done in one step.

  
@@ -234,13 +219,8 @@ list_to_binary([B1,B2])
- deflateSetDictionary(Z, Dictionary) -> Adler32 + Initialize the compression dictionary - - Z = zstream() - Dictionary = binary() - Adler32 = integer() -

Initializes the compression dictionary from the given byte sequence without producing any compressed output. This @@ -253,11 +233,8 @@ list_to_binary([B1,B2]) - deflateReset(Z) -> ok + Reset the deflate session - - Z = zstream() -

This function is equivalent to deflateEnd/1 followed by deflateInit/[1|2|6], but does not free @@ -267,34 +244,26 @@ list_to_binary([B1,B2]) - deflateParams(Z, Level, Strategy) -> ok + Dynamicly update deflate parameters - - Z = zstream() - Level = none | default | best_speed | best_compression | 0..9 - Strategy = default|filtered|huffman_only -

Dynamically update the compression level and compression - strategy. The interpretation of Level and - Strategy is as in deflateInit/6. This can be + strategy. The interpretation of Level and + Strategy is as in deflateInit/6. This can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression level is changed, the input available so far is compressed with the old level (and may be flushed); the new level will take effect only at the next call of deflate/3.

-

Before the call of deflateParams, the stream state must be set as for +

Before the call of deflateParams, the stream state must be set as for a call of deflate/3, since the currently available input may have to be compressed and flushed.

- deflateEnd(Z) -> ok + End deflate session - - Z = zstream() -

End the deflate session and cleans all data used. Note that this function will throw an data_error @@ -304,43 +273,31 @@ list_to_binary([B1,B2]) - inflateInit(Z) -> ok + Initialize a session for decompression - - Z = zstream() -

Initialize a zlib stream for decompression.

- inflateInit(Z, WindowBits) -> ok + Initialize a session for decompression - - Z = zstream() - WindowBits = 9..15|-9..-15 -

Initialize decompression session on zlib stream.

-

The WindowBits parameter is the base two logarithm +

The WindowBits parameter is the base two logarithm of the maximum window size (the size of the history buffer). It should be in the range 9 through 15. The default value is 15 if inflateInit/1 is used. If a compressed stream with a larger window size is given as input, inflate() will throw the data_error - exception. A negative WindowBits value makes zlib ignore the + exception. A negative WindowBits value makes zlib ignore the zlib header (and checksum) from the stream. Note that the zlib source mentions this only as a undocumented feature.

- inflate(Z, Data) -> DeCompressed + Decompress data - - Z = zstream() - Data = iodata() - DeCompressed = iolist() -

inflate/2 decompresses as much data as possible. It may some introduce some output latency (reading @@ -353,12 +310,8 @@ list_to_binary([B1,B2]) - inflateSetDictionary(Z, Dictionary) -> ok + Initialize the decompression dictionary - - Z = zstream() - Dictionary = binary() -

Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called @@ -381,11 +334,8 @@ unpack(Z, Compressed, Dict) -> - inflateReset(Z) -> ok + >Reset the inflate session - - Z = zstream() -

This function is equivalent to inflateEnd/1 followed by inflateInit/1, but does not free and reallocate all @@ -394,11 +344,8 @@ unpack(Z, Compressed, Dict) -> - inflateEnd(Z) -> ok + End inflate session - - Z = zstream() -

End the inflate session and cleans all data used. Note that this function will throw a data_error exception @@ -407,62 +354,39 @@ unpack(Z, Compressed, Dict) -> - setBufSize(Z, Size) -> ok + Set buffer size - - Z = zstream() - Size = integer() -

Sets the intermediate buffer size.

- getBufSize(Z) -> Size + Get buffer size - - Z = zstream() - Size = integer() -

Get the size of intermediate buffer.

- crc32(Z) -> CRC + Get current CRC - - Z = zstream() - CRC = integer() -

Get the current calculated CRC checksum.

- crc32(Z, Binary) -> CRC + Calculate CRC - - Z = zstream() - Binary = binary() - CRC = integer() - -

Calculate the CRC checksum for Binary.

+

Calculate the CRC checksum for Binary.

- crc32(Z, PrevCRC, Binary) -> CRC + Calculate CRC - - Z = zstream() - PrevCRC = integer() - Binary = binary() - CRC = integer() - - -

Update a running CRC checksum for Binary. - If Binary is the empty binary, this function returns + +

Update a running CRC checksum for Binary. + If Binary is the empty binary, this function returns the required initial value for the crc.

 Crc = lists:foldl(fun(Bin,Crc0) ->  
@@ -471,49 +395,31 @@ Crc = lists:foldl(fun(Bin,Crc0) ->
       
     
     
-      crc32_combine(Z, CRC1, CRC2, Size2)  -> CRC 
+      
       Combine two CRC's
-      
-        Z = zstream()
-	CRC = integer()
-        CRC1 = integer()
-        CRC2 = integer()
-        Size2 = integer()
-      
       
 	

Combine two CRC checksums into one. For two binaries, Bin1 and Bin2 with sizes of Size1 and - Size2, with CRC checksums CRC1 and - CRC2. crc32_combine/4 returns the CRC + Size2, with CRC checksums CRC1 and + CRC2. crc32_combine/4 returns the CRC checksum of <<Bin1/binary,Bin2/binary>>, requiring - only CRC1, CRC2, and Size2. + only CRC1, CRC2, and Size2.

- adler32(Z, Binary) -> Checksum + Calculate the adler checksum - - Z = zstream() - Binary = binary() - Checksum = integer() - -

Calculate the Adler-32 checksum for Binary.

+

Calculate the Adler-32 checksum for Binary.

- adler32(Z, PrevAdler, Binary) -> Checksum + Calculate the adler checksum - - Z = zstream() - PrevAdler = integer() - Binary = binary() - Checksum = integer() - - -

Update a running Adler-32 checksum for Binary. - If Binary is the empty binary, this function returns + +

Update a running Adler-32 checksum for Binary. + If Binary is the empty binary, this function returns the required initial value for the checksum.

 Crc = lists:foldl(fun(Bin,Crc0) ->  
@@ -522,81 +428,56 @@ Crc = lists:foldl(fun(Bin,Crc0) ->
       
     
     
-      adler32_combine(Z, Adler1, Adler2, Size2)  -> Adler 
+      
       Combine two Adler-32 checksums
-      
-        Z = zstream()
-        Adler = integer()
-        Adler1 = integer()
-        Adler2 = integer()
-        Size2 = integer()
-      
       
 	

Combine two Adler-32 checksums into one. For two binaries, Bin1 and Bin2 with sizes of Size1 and - Size2, with Adler-32 checksums Adler1 and - Adler2. adler32_combine/4 returns the Adler + Size2, with Adler-32 checksums Adler1 and + Adler2. adler32_combine/4 returns the Adler checksum of <<Bin1/binary,Bin2/binary>>, requiring - only Adler1, Adler2, and Size2. + only Adler1, Adler2, and Size2.

- compress(Binary) -> Compressed + Compress a binary with standard zlib functionality - - Binary = Compressed = binary() -

Compress a binary (with zlib headers and checksum).

- uncompress(Binary) -> Decompressed + Uncompress a binary with standard zlib functionality - - Binary = Decompressed = binary() -

Uncompress a binary (with zlib headers and checksum).

- zip(Binary) -> Compressed + Compress a binary without the zlib headers - - Binary = Compressed = binary() -

Compress a binary (without zlib headers and checksum).

- unzip(Binary) -> Decompressed + Uncompress a binary without the zlib headers - - Binary = Decompressed = binary() -

Uncompress a binary (without zlib headers and checksum).

- gzip(Data) -> Compressed + Compress a binary with gz header - - Binary = Compressed = binary() -

Compress a binary (with gz headers and checksum).

- gunzip(Bin) -> Decompressed + Uncompress a binary with gz header - - Binary = Decompressed = binary() -

Uncompress a binary (with gz headers and checksum).

diff --git a/erts/preloaded/ebin/erl_prim_loader.beam b/erts/preloaded/ebin/erl_prim_loader.beam index dccb92a5af..20c82c52bb 100644 Binary files a/erts/preloaded/ebin/erl_prim_loader.beam and b/erts/preloaded/ebin/erl_prim_loader.beam differ diff --git a/erts/preloaded/ebin/erlang.beam b/erts/preloaded/ebin/erlang.beam index b537546071..9202b5be4f 100644 Binary files a/erts/preloaded/ebin/erlang.beam and b/erts/preloaded/ebin/erlang.beam differ diff --git a/erts/preloaded/ebin/init.beam b/erts/preloaded/ebin/init.beam index 901def5eba..faa2cf573c 100644 Binary files a/erts/preloaded/ebin/init.beam and b/erts/preloaded/ebin/init.beam differ diff --git a/erts/preloaded/ebin/zlib.beam b/erts/preloaded/ebin/zlib.beam index 542e266f88..d400269ed0 100644 Binary files a/erts/preloaded/ebin/zlib.beam and b/erts/preloaded/ebin/zlib.beam differ diff --git a/erts/preloaded/src/erl_prim_loader.erl b/erts/preloaded/src/erl_prim_loader.erl index 024b20eadb..ccfa7978c8 100644 --- a/erts/preloaded/src/erl_prim_loader.erl +++ b/erts/preloaded/src/erl_prim_loader.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-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 @@ -102,8 +102,14 @@ debug(#prim_state{debug = Deb}, Term) -> %%% Interface Functions. %%% -------------------------------------------------------- --spec start(term(), atom() | string(), host() | [host()]) -> - {'ok', pid()} | {'error', term()}. +-spec start(Id, Loader, Hosts) -> + {'ok', Pid} | {'error', What} when + Id :: term(), + Loader :: atom() | string(), + Hosts :: Host | [Host], + Host :: host(), + Pid :: pid(), + What :: term(). start(Id, Pgm, Hosts) when is_atom(Hosts) -> start(Id, Pgm, [Hosts]); start(Id, Pgm0, Hosts) -> @@ -123,18 +129,6 @@ start(Id, Pgm0, Hosts) -> {error,Reason} end. -start_it("ose_inet"=Cmd, Id, Pid, Hosts) -> - %% Setup reserved port for ose_inet driver (only OSE) - case catch erlang:open_port({spawn,Cmd}, [binary]) of - {'EXIT',Why} -> - ?dbg(ose_inet_port_open_fail, Why), - Why; - OseInetPort -> - ?dbg(ose_inet_port, OseInetPort), - OseInetPort - end, - start_it("inet", Id, Pid, Hosts); - %% Hosts must be a list on form ['1.2.3.4' ...] start_it("inet", Id, Pid, Hosts) -> process_flag(trap_exit, true), @@ -174,15 +168,20 @@ init_ack(Pid) -> Pid ! {self(),ok}, ok. --spec set_path([string()]) -> 'ok'. +-spec set_path(Path) -> 'ok' when + Path :: [Dir :: string()]. set_path(Paths) when is_list(Paths) -> request({set_path,Paths}). --spec get_path() -> {'ok', [string()]}. +-spec get_path() -> {'ok', Path} when + Path :: [Dir :: string()]. get_path() -> request({get_path,[]}). --spec get_file(atom() | string()) -> {'ok', binary(), string()} | 'error'. +-spec get_file(Filename) -> {'ok', Bin, FullName} | 'error' when + Filename :: atom() | string(), + Bin :: binary(), + FullName :: string(). get_file(File) when is_atom(File) -> get_file(atom_to_list(File)); get_file(File) -> @@ -202,13 +201,15 @@ get_files(ModFiles, Fun) -> ok end. --spec list_dir(string()) -> {'ok', [string()]} | 'error'. +-spec list_dir(Dir) -> {'ok', Filenames} | 'error' when + Dir :: string(), + Filenames :: [Filename :: string()]. list_dir(Dir) -> check_file_result(list_dir, Dir, request({list_dir,Dir})). -%% -> {ok,Info} | error --spec read_file_info(string()) -> {'ok', tuple()} | 'error'. - +-spec read_file_info(Filename) -> {'ok', FileInfo} | 'error' when + Filename :: string(), + FileInfo :: file:file_info(). read_file_info(File) -> check_file_result(read_file_info, File, request({read_file_info,File})). @@ -1360,9 +1361,7 @@ pathtype(Name) when is_list(Name) -> absolute; _ -> relative - end; - {ose,_} -> - unix_pathtype(Name) + end end. unix_pathtype(Name) -> diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl index 4679a916c7..5deb69edab 100644 --- a/erts/preloaded/src/erlang.erl +++ b/erts/preloaded/src/erlang.erl @@ -53,22 +53,31 @@ -compile({no_auto_import,[spawn_opt/4]}). -compile({no_auto_import,[spawn_opt/5]}). -%%-------------------------------------------------------------------------- +-export_type([timestamp/0]). --type date() :: {pos_integer(), pos_integer(), pos_integer()}. --type time() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()}. --type date_time() :: {date(), time()}. +-type timestamp() :: {MegaSecs :: non_neg_integer(), + Secs :: non_neg_integer(), + MicroSecs :: non_neg_integer()}. %%-------------------------------------------------------------------------- +-spec apply(Fun, Args) -> term() when + Fun :: function(), + Args :: [term()]. apply(Fun, Args) -> erlang:apply(Fun, Args). +-spec apply(Module, Function, Args) -> term() when + Module :: module(), + Function :: atom(), + Args :: [term()]. apply(Mod, Name, Args) -> erlang:apply(Mod, Name, Args). %% Spawns with a fun +-spec spawn(Fun) -> pid() when + Fun :: function(). spawn(F) when is_function(F) -> spawn(erlang, apply, [F, []]); spawn({M,F}=MF) when is_atom(M), is_atom(F) -> @@ -76,6 +85,9 @@ spawn({M,F}=MF) when is_atom(M), is_atom(F) -> spawn(F) -> erlang:error(badarg, [F]). +-spec spawn(Node, Fun) -> pid() when + Node :: node(), + Fun :: function(). spawn(N, F) when N =:= node() -> spawn(F); spawn(N, F) when is_function(F) -> @@ -85,6 +97,8 @@ spawn(N, {M,F}=MF) when is_atom(M), is_atom(F) -> spawn(N, F) -> erlang:error(badarg, [N, F]). +-spec spawn_link(Fun) -> pid() when + Fun :: function(). spawn_link(F) when is_function(F) -> spawn_link(erlang, apply, [F, []]); spawn_link({M,F}=MF) when is_atom(M), is_atom(F) -> @@ -92,6 +106,9 @@ spawn_link({M,F}=MF) when is_atom(M), is_atom(F) -> spawn_link(F) -> erlang:error(badarg, [F]). +-spec spawn_link(Node, Fun) -> pid() when + Node :: node(), + Fun :: function(). spawn_link(N, F) when N =:= node() -> spawn_link(F); spawn_link(N, F) when is_function(F) -> @@ -103,16 +120,30 @@ spawn_link(N, F) -> %% Spawn and atomically set up a monitor. +-spec spawn_monitor(Fun) -> {pid(), reference()} when + Fun :: function(). spawn_monitor(F) when is_function(F, 0) -> erlang:spawn_opt({erlang,apply,[F,[]],[monitor]}); spawn_monitor(F) -> erlang:error(badarg, [F]). +-spec spawn_monitor(Module, Function, Args) -> {pid(), reference()} when + Module :: module(), + Function :: atom(), + Args :: [term()]. spawn_monitor(M, F, A) when is_atom(M), is_atom(F), is_list(A) -> erlang:spawn_opt({M,F,A,[monitor]}); spawn_monitor(M, F, A) -> erlang:error(badarg, [M,F,A]). +-spec spawn_opt(Fun, Options) -> pid() | {pid(), reference()} when + Fun :: function(), + Options :: [Option], + Option :: link | monitor | {priority, Level} + | {fullsweep_after, Number :: non_neg_integer()} + | {min_heap_size, Size :: non_neg_integer()} + | {min_bin_vheap_size, VSize :: non_neg_integer()}, + Level :: low | normal | high. spawn_opt(F, O) when is_function(F) -> spawn_opt(erlang, apply, [F, []], O); spawn_opt({M,F}=MF, O) when is_atom(M), is_atom(F) -> @@ -122,6 +153,15 @@ spawn_opt({M,F,A}, O) -> % For (undocumented) backward compatibility spawn_opt(F, O) -> erlang:error(badarg, [F, O]). +-spec spawn_opt(Node, Fun, Options) -> pid() | {pid(), reference()} when + Node :: node(), + Fun :: function(), + Options :: [Option], + Option :: link | monitor | {priority, Level} + | {fullsweep_after, Number :: non_neg_integer()} + | {min_heap_size, Size :: non_neg_integer()} + | {min_bin_vheap_size, VSize :: non_neg_integer()}, + Level :: low | normal | high. spawn_opt(N, F, O) when N =:= node() -> spawn_opt(F, O); spawn_opt(N, F, O) when is_function(F) -> @@ -133,6 +173,11 @@ spawn_opt(N, F, O) -> %% Spawns with MFA +-spec spawn(Node, Module, Function, Args) -> pid() when + Node :: node(), + Module :: module(), + Function :: atom(), + Args :: [term()]. spawn(N,M,F,A) when N =:= node(), is_atom(M), is_atom(F), is_list(A) -> spawn(M,F,A); spawn(N,M,F,A) when is_atom(N), is_atom(M), is_atom(F) -> @@ -158,6 +203,11 @@ spawn(N,M,F,A) when is_atom(N), is_atom(M), is_atom(F) -> spawn(N,M,F,A) -> erlang:error(badarg, [N, M, F, A]). +-spec spawn_link(Node, Module, Function, Args) -> pid() when + Node :: node(), + Module :: module(), + Function :: atom(), + Args :: [term()]. spawn_link(N,M,F,A) when N =:= node(), is_atom(M), is_atom(F), is_list(A) -> spawn_link(M,F,A); spawn_link(N,M,F,A) when is_atom(N), is_atom(M), is_atom(F) -> @@ -183,6 +233,17 @@ spawn_link(N,M,F,A) when is_atom(N), is_atom(M), is_atom(F) -> spawn_link(N,M,F,A) -> erlang:error(badarg, [N, M, F, A]). +-spec spawn_opt(Module, Function, Args, Options) -> + pid() | {pid(), reference()} when + Module :: module(), + Function :: atom(), + Args :: [term()], + Options :: [Option], + Option :: link | monitor | {priority, Level} + | {fullsweep_after, Number :: non_neg_integer()} + | {min_heap_size, Size :: non_neg_integer()} + | {min_bin_vheap_size, VSize :: non_neg_integer()}, + Level :: low | normal | high. spawn_opt(M, F, A, Opts) -> case catch erlang:spawn_opt({M,F,A,Opts}) of {'EXIT',{Reason,_}} -> @@ -191,6 +252,18 @@ spawn_opt(M, F, A, Opts) -> Res end. +-spec spawn_opt(Node, Module, Function, Args, Options) -> + pid() | {pid(), reference()} when + Node :: node(), + Module :: module(), + Function :: atom(), + Args :: [term()], + Options :: [Option], + Option :: link | monitor | {priority, Level} + | {fullsweep_after, Number :: non_neg_integer()} + | {min_heap_size, Size :: non_neg_integer()} + | {min_bin_vheap_size, VSize :: non_neg_integer()}, + Level :: low | normal | high. spawn_opt(N, M, F, A, O) when N =:= node(), is_atom(M), is_atom(F), is_list(A), is_list(O) -> @@ -260,18 +333,25 @@ crasher(Node,Mod,Fun,Args,Opts,Reason) -> [Mod,Fun,Args,Opts,Node]), exit(Reason). --spec yield() -> 'true'. +-spec erlang:yield() -> 'true'. yield() -> erlang:yield(). --spec nodes() -> [node()]. +-spec nodes() -> Nodes when + Nodes :: [node()]. nodes() -> erlang:nodes(visible). --spec disconnect_node(node()) -> boolean(). +-spec disconnect_node(Node) -> boolean() | ignored when + Node :: node(). disconnect_node(Node) -> net_kernel:disconnect(Node). +-spec erlang:fun_info(Fun) -> [{Item, Info}] when + Fun :: function(), + Item :: arity | env | index | name + | module | new_index | new_uniq | pid | type | uniq, + Info :: term(). fun_info(Fun) when is_function(Fun) -> Keys = [type,env,arity,name,uniq,index,new_uniq,new_index,module,pid], fun_info_1(Keys, Fun, []). @@ -283,24 +363,37 @@ fun_info_1([K|Ks], Fun, A) -> end; fun_info_1([], _, A) -> A. --type dst() :: pid() | port() | atom() | {atom(), node()}. +-type dst() :: pid() + | port() + | (RegName :: atom()) + | {RegName :: atom(), Node :: node()}. --spec send_nosuspend(dst(), term()) -> boolean(). +-spec erlang:send_nosuspend(Dest, Msg) -> boolean() when + Dest :: dst(), + Msg :: term(). send_nosuspend(Pid, Msg) -> send_nosuspend(Pid, Msg, []). --spec send_nosuspend(dst(), term(), ['noconnect' | 'nosuspend']) -> boolean(). +-spec erlang:send_nosuspend(Dest, Msg, Options) -> boolean() when + Dest :: dst(), + Msg :: term(), + Options :: [noconnect]. send_nosuspend(Pid, Msg, Opts) -> case erlang:send(Pid, Msg, [nosuspend|Opts]) of ok -> true; _ -> false end. --spec localtime_to_universaltime(date_time()) -> date_time(). +-spec erlang:localtime_to_universaltime({Date1, Time1}) -> {Date2, Time2} when + Date1 :: calendar:date(), + Date2 :: calendar:date(), + Time1 :: calendar:time(), + Time2 :: calendar:time(). localtime_to_universaltime(Localtime) -> erlang:localtime_to_universaltime(Localtime, undefined). --spec suspend_process(pid()) -> 'true'. +-spec erlang:suspend_process(Suspendee) -> 'true' when + Suspendee :: pid(). suspend_process(P) -> case catch erlang:suspend_process(P, []) of {'EXIT', {Reason, _}} -> erlang:error(Reason, [P]); @@ -426,6 +519,9 @@ delay_trap(Result, Timeout) -> receive after Timeout -> Result end. %% Messages to us use our cookie. IF we change our cookie, other nodes %% have to reflect that, which we cannot forsee. %% +-spec erlang:set_cookie(Node, Cookie) -> true when + Node :: node(), + Cookie :: atom(). set_cookie(Node, C) when Node =/= nonode@nohost, is_atom(Node) -> case is_atom(C) of true -> @@ -434,14 +530,19 @@ set_cookie(Node, C) when Node =/= nonode@nohost, is_atom(Node) -> error(badarg) end. --spec get_cookie() -> atom(). +-spec erlang:get_cookie() -> Cookie | nocookie when + Cookie :: atom(). get_cookie() -> auth:get_cookie(). +-spec concat_binary(ListOfBinaries) -> binary() when + ListOfBinaries :: iolist(). concat_binary(List) -> list_to_binary(List). --spec integer_to_list(integer(), 1..255) -> string(). +-spec integer_to_list(Integer, Base) -> string() when + Integer :: integer(), + Base :: 2..36. integer_to_list(I, 10) -> erlang:integer_to_list(I); integer_to_list(I, Base) @@ -469,6 +570,9 @@ integer_to_list(I0, Base, R0) -> end. +-spec list_to_integer(String, Base) -> integer() when + String :: string(), + Base :: 2..36. list_to_integer(L, 10) -> erlang:list_to_integer(L); list_to_integer(L, Base) @@ -689,10 +793,16 @@ await_proc_exit(Proc, Op, Data) -> end end. --spec min(term(), term()) -> term(). +-spec min(Term1, Term2) -> Minimum when + Term1 :: term(), + Term2 :: term(), + Minimum :: term(). min(A, B) when A > B -> B; min(A, _) -> A. --spec max(term(), term()) -> term(). +-spec max(Term1, Term2) -> Maximum when + Term1 :: term(), + Term2 :: term(), + Maximum :: term(). max(A, B) when A < B -> B; max(A, _) -> A. diff --git a/erts/preloaded/src/init.erl b/erts/preloaded/src/init.erl index 24430a3d40..e52c813029 100644 --- a/erts/preloaded/src/init.erl +++ b/erts/preloaded/src/init.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% Copyright Ericsson AB 1996-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 @@ -28,10 +28,10 @@ %% : $Var in the boot script is expanded to %% Value. %% -loader LoaderMethod -%% : efile, inet, ose_inet +%% : efile, inet %% (Optional - default efile) %% -hosts [Node] : List of hosts from which we can boot. -%% (Mandatory if -loader inet or ose_inet) +%% (Mandatory if -loader inet) %% -mode embedded : Load all modules at startup, no automatic loading %% -mode interactive : Auto load modules (default system behaviour). %% -path : Override path in bootfile. @@ -79,19 +79,24 @@ debug(false, _) -> ok; debug(_, T) -> erlang:display(T). --spec get_arguments() -> [{atom(), [string()]}]. +-spec get_arguments() -> Flags when + Flags :: [{Flag :: atom(), Values :: [string()]}]. get_arguments() -> request(get_arguments). --spec get_plain_arguments() -> [string()]. +-spec get_plain_arguments() -> [Arg] when + Arg :: string(). get_plain_arguments() -> bs2ss(request(get_plain_arguments)). --spec get_argument(atom()) -> 'error' | {'ok', [[string()]]}. +-spec get_argument(Flag) -> {'ok', Arg} | 'error' when + Flag :: atom(), + Arg :: [Values :: [string()]]. get_argument(Arg) -> request({get_argument, Arg}). --spec script_id() -> term(). +-spec script_id() -> Id when + Id :: term(). script_id() -> request(script_id). @@ -105,7 +110,9 @@ bs2ss(L0) when is_list(L0) -> bs2ss(L) -> L. --spec get_status() -> {internal_status(), term()}. +-spec get_status() -> {InternalStatus, ProvidedStatus} when + InternalStatus :: internal_status(), + ProvidedStatus :: term(). get_status() -> request(get_status). @@ -150,10 +157,12 @@ reboot() -> init ! {stop,reboot}, ok. -spec stop() -> 'ok'. stop() -> init ! {stop,stop}, ok. --spec stop(non_neg_integer() | string()) -> 'ok'. +-spec stop(Status) -> 'ok' when + Status :: non_neg_integer() | string(). stop(Status) -> init ! {stop,{stop,Status}}, ok. --spec boot([binary()]) -> no_return(). +-spec boot(BootArgs) -> no_return() when + BootArgs :: [binary()]. boot(BootArgs) -> register(init, self()), process_flag(trap_exit, true), @@ -1024,7 +1033,7 @@ start_it({eval,Bin}) -> TsR -> reverse([{dot,1} | TsR]) end, {ok,Expr} = erl_parse:parse_exprs(Ts1), - erl_eval:exprs(Expr, []), + erl_eval:exprs(Expr, erl_eval:new_bindings()), ok; start_it([_|_]=MFA) -> Ref = make_ref(), diff --git a/erts/preloaded/src/zlib.erl b/erts/preloaded/src/zlib.erl index 51d6cd0a0b..6cc7b27114 100644 --- a/erts/preloaded/src/zlib.erl +++ b/erts/preloaded/src/zlib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2010. All Rights Reserved. +%% Copyright Ericsson AB 2003-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 @@ -124,7 +124,6 @@ -type zwindowbits() :: -15..-9 | 9..47. -type zmemlevel() :: 1..9. -type zstrategy() :: 'default' | 'filtered' | 'huffman_only'. --type zflush() :: 'none' | 'sync' | 'full' | 'finish'. %%------------------------------------------------------------------------ @@ -134,7 +133,8 @@ open() -> open_port({spawn, "zlib_drv"}, [binary]). %% close and release z_stream --spec close(zstream()) -> 'ok'. +-spec close(Z) -> 'ok' when + Z :: zstream(). close(Z) -> try true = port_close(Z), @@ -145,16 +145,25 @@ close(Z) -> catch _:_ -> erlang:error(badarg) end. --spec deflateInit(zstream()) -> 'ok'. +-spec deflateInit(Z) -> 'ok' when + Z :: zstream(). deflateInit(Z) -> call(Z, ?DEFLATE_INIT, <>). --spec deflateInit(zstream(), zlevel()) -> 'ok'. +-spec deflateInit(Z, Level) -> 'ok' when + Z :: zstream(), + Level :: zlevel(). deflateInit(Z, Level) -> call(Z, ?DEFLATE_INIT, <<(arg_level(Level)):32>>). --spec deflateInit(zstream(), zlevel(), zmethod(), - zwindowbits(), zmemlevel(), zstrategy()) -> 'ok'. +-spec deflateInit(Z, Level, Method, + WindowBits, MemLevel, Strategy) -> 'ok' when + Z :: zstream(), + Level :: zlevel(), + Method :: zmethod(), + WindowBits :: zwindowbits(), + MemLevel :: zmemlevel(), + Strategy :: zstrategy(). deflateInit(Z, Level, Method, WindowBits, MemLevel, Strategy) -> call(Z, ?DEFLATE_INIT2, <<(arg_level(Level)):32, (arg_method(Method)):32, @@ -162,24 +171,38 @@ deflateInit(Z, Level, Method, WindowBits, MemLevel, Strategy) -> (arg_mem(MemLevel)):32, (arg_strategy(Strategy)):32>>). --spec deflateSetDictionary(zstream(), binary()) -> integer(). +-spec deflateSetDictionary(Z, Dictionary) -> Adler32 when + Z :: zstream(), + Dictionary :: binary(), + Adler32 :: integer(). deflateSetDictionary(Z, Dictionary) -> call(Z, ?DEFLATE_SETDICT, Dictionary). --spec deflateReset(zstream()) -> 'ok'. +-spec deflateReset(Z) -> 'ok' when + Z :: zstream(). deflateReset(Z) -> call(Z, ?DEFLATE_RESET, []). --spec deflateParams(zstream(), zlevel(), zstrategy()) -> 'ok'. +-spec deflateParams(Z, Level, Strategy) -> ok when + Z :: zstream(), + Level :: zlevel(), + Strategy :: zstrategy(). deflateParams(Z, Level, Strategy) -> call(Z, ?DEFLATE_PARAMS, <<(arg_level(Level)):32, (arg_strategy(Strategy)):32>>). --spec deflate(zstream(), iodata()) -> iolist(). +-spec deflate(Z, Data) -> Compressed when + Z :: zstream(), + Data :: iodata(), + Compressed :: iolist(). deflate(Z, Data) -> deflate(Z, Data, none). --spec deflate(zstream(), iodata(), zflush()) -> iolist(). +-spec deflate(Z, Data, Flush) -> Compressed when + Z :: zstream(), + Data :: iodata(), + Flush :: none | sync | full | finish, + Compressed :: iolist(). deflate(Z, Data, Flush) -> try port_command(Z, Data) of true -> @@ -191,19 +214,25 @@ deflate(Z, Data, Flush) -> erlang:error(badarg) end. --spec deflateEnd(zstream()) -> 'ok'. +-spec deflateEnd(Z) -> 'ok' when + Z :: zstream(). deflateEnd(Z) -> call(Z, ?DEFLATE_END, []). --spec inflateInit(zstream()) -> 'ok'. +-spec inflateInit(Z) -> 'ok' when + Z :: zstream(). inflateInit(Z) -> call(Z, ?INFLATE_INIT, []). --spec inflateInit(zstream(), zwindowbits()) -> 'ok'. +-spec inflateInit(Z, WindowBits) -> 'ok' when + Z :: zstream(), + WindowBits :: zwindowbits(). inflateInit(Z, WindowBits) -> call(Z, ?INFLATE_INIT2, <<(arg_bitsz(WindowBits)):32>>). --spec inflateSetDictionary(zstream(), binary()) -> 'ok'. +-spec inflateSetDictionary(Z, Dictionary) -> 'ok' when + Z :: zstream(), + Dictionary :: binary(). inflateSetDictionary(Z, Dictionary) -> call(Z, ?INFLATE_SETDICT, Dictionary). @@ -211,11 +240,15 @@ inflateSetDictionary(Z, Dictionary) -> inflateSync(Z) -> call(Z, ?INFLATE_SYNC, []). --spec inflateReset(zstream()) -> 'ok'. +-spec inflateReset(Z) -> 'ok' when + Z :: zstream(). inflateReset(Z) -> call(Z, ?INFLATE_RESET, []). --spec inflate(zstream(), iodata()) -> iolist(). +-spec inflate(Z, Data) -> Decompressed when + Z :: zstream(), + Data :: iodata(), + Decompressed :: iolist(). inflate(Z, Data) -> try port_command(Z, Data) of true -> @@ -227,50 +260,81 @@ inflate(Z, Data) -> erlang:error(badarg) end. --spec inflateEnd(zstream()) -> 'ok'. +-spec inflateEnd(Z) -> 'ok' when + Z :: zstream(). inflateEnd(Z) -> call(Z, ?INFLATE_END, []). --spec setBufSize(zstream(), non_neg_integer()) -> 'ok'. +-spec setBufSize(Z, Size) -> 'ok' when + Z :: zstream(), + Size :: non_neg_integer(). setBufSize(Z, Size) -> call(Z, ?SET_BUFSZ, <>). --spec getBufSize(zstream()) -> non_neg_integer(). +-spec getBufSize(Z) -> Size when + Z :: zstream(), + Size :: non_neg_integer(). getBufSize(Z) -> call(Z, ?GET_BUFSZ, []). --spec crc32(zstream()) -> integer(). +-spec crc32(Z) -> CRC when + Z :: zstream(), + CRC :: integer(). crc32(Z) -> call(Z, ?CRC32_0, []). --spec crc32(zstream(), binary()) -> integer(). +-spec crc32(Z, Binary) -> CRC when + Z :: zstream(), + Binary :: binary(), + CRC :: integer(). crc32(Z, Binary) -> call(Z, ?CRC32_1, Binary). --spec crc32(zstream(), integer(), binary()) -> integer(). +-spec crc32(Z, PrevCRC, Binary) -> CRC when + Z :: zstream(), + PrevCRC :: integer(), + Binary :: binary(), + CRC :: integer(). crc32(Z, CRC, Binary) when is_binary(Binary), is_integer(CRC) -> call(Z, ?CRC32_2, <>); crc32(_Z, _CRC, _Binary) -> erlang:error(badarg). --spec adler32(zstream(), binary()) -> integer(). +-spec adler32(Z, Binary) -> CheckSum when + Z :: zstream(), + Binary :: binary(), + CheckSum :: integer(). adler32(Z, Binary) -> call(Z, ?ADLER32_1, Binary). --spec adler32(zstream(), integer(), binary()) -> integer(). +-spec adler32(Z, PrevAdler, Binary) -> CheckSum when + Z :: zstream(), + PrevAdler :: integer(), + Binary :: binary(), + CheckSum :: integer(). adler32(Z, Adler, Binary) when is_binary(Binary), is_integer(Adler) -> call(Z, ?ADLER32_2, <>); adler32(_Z, _Adler, _Binary) -> erlang:error(badarg). --spec crc32_combine(zstream(), integer(), integer(), integer()) -> integer(). +-spec crc32_combine(Z, CRC1, CRC2, Size2) -> CRC when + Z :: zstream(), + CRC :: integer(), + CRC1 :: integer(), + CRC2 :: integer(), + Size2 :: integer(). crc32_combine(Z, CRC1, CRC2, Len2) when is_integer(CRC1), is_integer(CRC2), is_integer(Len2) -> call(Z, ?CRC32_COMBINE, <>); crc32_combine(_Z, _CRC1, _CRC2, _Len2) -> erlang:error(badarg). --spec adler32_combine(zstream(), integer(), integer(), integer()) -> integer(). +-spec adler32_combine(Z, Adler1, Adler2, Size2) -> Adler when + Z :: zstream(), + Adler :: integer(), + Adler1 :: integer(), + Adler2 :: integer(), + Size2 :: integer(). adler32_combine(Z, Adler1, Adler2, Len2) when is_integer(Adler1), is_integer(Adler2), is_integer(Len2) -> call(Z, ?ADLER32_COMBINE, <>); @@ -282,7 +346,9 @@ getQSize(Z) -> call(Z, ?GET_QSIZE, []). %% compress/uncompress zlib with header --spec compress(binary()) -> binary(). +-spec compress(Binary) -> Compressed when + Binary :: binary(), + Compressed :: binary(). compress(Binary) -> Z = open(), deflateInit(Z, default), @@ -291,7 +357,9 @@ compress(Binary) -> close(Z), list_to_binary(Bs). --spec uncompress(binary()) -> binary(). +-spec uncompress(Binary) -> Decompressed when + Binary :: binary(), + Decompressed :: binary(). uncompress(Binary) when byte_size(Binary) >= 8 -> Z = open(), inflateInit(Z), @@ -303,7 +371,9 @@ uncompress(Binary) when is_binary(Binary) -> erlang:error(data_error); uncompress(_) -> erlang:error(badarg). %% unzip/zip zlib without header (zip members) --spec zip(binary()) -> binary(). +-spec zip(Binary) -> Compressed when + Binary :: binary(), + Compressed :: binary(). zip(Binary) -> Z = open(), deflateInit(Z, default, deflated, -?MAX_WBITS, 8, default), @@ -312,7 +382,9 @@ zip(Binary) -> close(Z), list_to_binary(Bs). --spec unzip(binary()) -> binary(). +-spec unzip(Binary) -> Decompressed when + Binary :: binary(), + Decompressed :: binary(). unzip(Binary) -> Z = open(), inflateInit(Z, -?MAX_WBITS), @@ -321,7 +393,9 @@ unzip(Binary) -> close(Z), list_to_binary(Bs). --spec gzip(iodata()) -> binary(). +-spec gzip(Data) -> Compressed when + Data :: iodata(), + Compressed :: binary(). gzip(Data) when is_binary(Data); is_list(Data) -> Z = open(), deflateInit(Z, default, deflated, 16+?MAX_WBITS, 8, default), @@ -331,7 +405,9 @@ gzip(Data) when is_binary(Data); is_list(Data) -> iolist_to_binary(Bs); gzip(_) -> erlang:error(badarg). --spec gunzip(iodata()) -> binary(). +-spec gunzip(Binary) -> Decompressed when + Binary :: binary(), + Decompressed :: binary(). gunzip(Data) when is_binary(Data); is_list(Data) -> Z = open(), inflateInit(Z, 16+?MAX_WBITS), -- cgit v1.2.3